/* FA-01 Foundation — New-look (v2) app shell: top bar, bottom tabs, job
   action dock, plus menu. Per BUILD_INSTRUCTIONS.md §5 and §12
   (AppShell / ActionDock / ContextAddMenu primitives).
   Every rule is scoped under [data-look="v2"]; with the switch OFF these
   elements stay hidden (frontend/index.html gives them the existing
   `.hidden` utility class, toggled by frontend/js/lookV2.js) and none of
   this CSS applies to them either way. */

[data-look="v2"] .appbar-v2 {
  display: flex;
  align-items: center;
  gap: var(--field-space-2);
  min-height: 56px;
  padding: var(--field-space-2) var(--field-space-4);
  padding-top: calc(var(--field-space-2) + env(safe-area-inset-top, 0px));
  background: var(--field-surface);
  border-bottom: 1px solid var(--field-border);
  color: var(--field-text-primary);
}
[data-look="v2"] .appbar-v2-net {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--field-status-inprogress-fill);
  flex-shrink: 0;
}
[data-look="v2"] .appbar-v2-net.offline { background: var(--field-text-secondary); }
[data-look="v2"] .appbar-v2-title {
  font: var(--field-text-section);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-look="v2"] .appbar-v2-date {
  font: var(--field-text-meta);
  color: var(--field-text-secondary);
  flex-shrink: 0;
}
[data-look="v2"] .appbar-v2-avatar {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 22px;
  color: var(--field-text-primary);
}
[data-look="v2"] .appbar-v2-avatar:focus-visible,
[data-look="v2"] .bottomnav-v2 a:focus-visible,
[data-look="v2"] .plus-menu-v2 button:focus-visible,
[data-look="v2"] .action-dock-v2-primary:focus-visible,
[data-look="v2"] .action-dock-v2-plus:focus-visible {
  outline: 2px solid var(--field-active-text);
  outline-offset: 2px;
}

[data-look="v2"] .bottomnav-v2 {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  min-height: 64px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--field-surface);
}
[data-look="v2"] .bottomnav-v2 a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--field-space-1);
  min-height: 64px;
  border-top: 1px solid var(--field-border);
  color: var(--field-text-secondary);
  text-decoration: none;
}
[data-look="v2"] .bottomnav-v2 a i { font-size: var(--field-icon-main); font-style: normal; line-height: 1; }
[data-look="v2"] .bottomnav-v2 a span { font: var(--field-text-nav); }
/* Connected selected tab (§5): active background matches the page, not a
   raised pill, and its border-top is colored to match — the divider
   visually stops at this tab's bounds instead of running under it. */
[data-look="v2"] .bottomnav-v2 a.on {
  background: var(--field-page);
  border-top-color: var(--field-page);
  color: var(--field-active-text);
}

[data-look="v2"] .action-dock-v2 {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 19;
  display: flex;
  align-items: center;
  gap: var(--field-space-3);
  padding: var(--field-space-3) var(--field-space-4);
  background: var(--field-surface);
  border-top: 1px solid var(--field-border);
}
[data-look="v2"] .action-dock-v2-primary {
  flex: 1 1 auto;
  min-height: 48px;
  border: none;
  border-radius: var(--field-radius-control);
  background: var(--field-action-fill);
  color: var(--field-action-text);
  font: var(--field-text-button);
}
[data-look="v2"] .action-dock-v2-plus {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: var(--field-radius-pill);
  background: var(--field-raised);
  color: var(--field-text-primary);
  font-size: var(--field-icon-main);
  line-height: 1;
}

/* My Day's own plus (§5): "sits at the right gutter, 16px above the
   navigation" — no action bar on this screen, so it floats alone instead of
   living inside .action-dock-v2. Reuses the dock plus button's circle/icon
   sizing but takes the primary action-fill treatment since it's the only
   proactive action on this screen. */
[data-look="v2"] .myday-fab-v2 {
  position: fixed;
  right: var(--field-space-4);
  bottom: calc(64px + env(safe-area-inset-bottom, 0px) + var(--field-space-4));
  z-index: 19;
  background: var(--field-action-fill);
  color: var(--field-action-text);
}

[data-look="v2"] .plus-menu-v2 {
  position: fixed;
  z-index: 21;
  width: min(224px, calc(100vw - 32px));
  padding: var(--field-space-2);
  border-radius: var(--field-radius-sheet);
  background: var(--field-surface);
  border: 1px solid var(--field-border);
  box-shadow: 0 10px 30px rgba(10, 25, 50, .28);
  display: flex;
  flex-direction: column;
}
[data-look="v2"] .plus-menu-v2 button {
  min-height: 48px;
  padding: 0 var(--field-space-3);
  border: none;
  background: transparent;
  color: var(--field-text-primary);
  font: var(--field-text-body);
  text-align: left;
  border-radius: var(--field-radius-control);
}
[data-look="v2"] .plus-menu-v2 button:hover,
[data-look="v2"] .plus-menu-v2 button:focus-visible { background: var(--field-raised); }

/* Content bottom padding (§5): dock + nav + safe inset + 16px, so page
   content never sits underneath either fixed bar. Applied only while the
   dock is showing (job screen); My Day/Jobs/Prices reserve just the nav. */
[data-look="v2"] #app-main:has(~ .action-dock-v2:not(.hidden)) {
  padding-bottom: calc(56px + 64px + env(safe-area-inset-bottom, 0px) + var(--field-space-4));
}
[data-look="v2"] #app-main {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px) + var(--field-space-4));
}
