/* C2 interactive prototype — mobile chrome on top of shared.css */
/* Shell width locked in "C2 width lock" block at end of this file (Mike tweak). */
html, body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.app-status {
  flex-shrink: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px 4px;
  font-size: 12px; font-weight: 600; color: var(--ink);
  background: var(--paper);
  padding-top: max(10px, env(safe-area-inset-top));
}
.app-status .right { color: var(--muted); font-size: 11px; font-weight: 500; }

.app-nav {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  min-height: 40px;
}
.app-nav .brand {
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--deep);
}
.app-nav .title {
  font-size: 14px; font-weight: 700; color: var(--ink);
  flex: 1; text-align: center;
}
.app-nav .back {
  width: 36px; height: 32px;
  display: flex; align-items: center; justify-content: flex-start;
  color: var(--imperial); font-size: 20px; font-weight: 600;
  background: none; border: none; cursor: pointer; padding: 0;
}
.app-nav .spacer { width: 36px; }
.app-nav .ghost-btn {
  width: 36px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--muted); cursor: pointer;
}
.app-nav .ghost-btn svg { width: 20px; height: 20px; stroke-width: 1.75; }

#screen-root {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--paper);
  padding-bottom: 8px;
}

.screen {
  display: none;
  min-height: 100%;
  padding: 12px 14px 24px;
  flex-direction: column;
}
.screen.active { display: flex; }

/* Fixed tab bar */
.tabbar-fixed {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: var(--white);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 20;
}
.tabbar-fixed.hidden { display: none; }
.tabbar-fixed .tab {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  background: none; border: none; cursor: pointer;
  padding: 4px 0;
  font-family: var(--font-sans);
}
.tabbar-fixed .tab .ico {
  width: 28px; height: 22px; margin: 0 auto 3px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border-radius: 6px;
}
.tabbar-fixed .tab .ico svg { width: 18px; height: 18px; stroke-width: 1.75; }
.tabbar-fixed .tab.on { color: var(--deep); font-weight: 700; }
.tabbar-fixed .tab.on .ico {
  background: var(--glow); color: var(--deep);
}

/* Sticky footer CTA inside scroll area (or pinned) */
.sticky-cta {
  position: sticky;
  bottom: 0;
  margin: 12px -14px -24px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--paper) 28%);
  z-index: 5;
}
.sticky-cta .btn-primary,
.sticky-cta .action-chip.primary {
  width: 100%;
  font-size: 15px;
  padding: 14px 12px;
}

/* Forms */
.input-phone {
  display: flex; align-items: center; gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 8px 0 12px;
}
.input-phone:focus-within { border-color: var(--imperial); box-shadow: 0 0 0 3px rgba(10,122,92,.12); }
.input-phone .prefix {
  font-weight: 700; color: var(--deep); font-size: 15px;
  font-family: var(--font-en);
}
.input-phone input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 16px; font-weight: 600; color: var(--ink);
  font-family: var(--font-en); letter-spacing: 0.04em;
}
.otp-row {
  display: flex; gap: 8px; justify-content: center; margin: 16px 0 12px;
}
.otp-row input {
  width: 44px; height: 52px; text-align: center;
  font-size: 22px; font-weight: 700; color: var(--deep);
  border: 1.5px solid var(--line); border-radius: var(--radius-md);
  background: var(--white); font-family: var(--font-en);
}
.otp-row input:focus {
  border-color: var(--imperial);
  outline: none;
  box-shadow: 0 0 0 3px rgba(10,122,92,.12);
}
.otp-hint {
  text-align: center;
  font-size: 11px; color: var(--muted);
  background: var(--glow);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 8px 0 16px;
  line-height: 1.45;
}
.otp-hint strong { color: var(--deep); font-family: var(--font-en); letter-spacing: 0.08em; }

.auth-hero {
  text-align: center;
  padding: 28px 8px 8px;
}
.auth-hero .logo {
  font-family: var(--font-serif);
  font-size: 28px; font-weight: 700;
  letter-spacing: 0.1em; color: var(--deep);
  margin-bottom: 6px;
}
.auth-hero .tag {
  font-size: 13px; color: var(--muted); line-height: 1.5;
}

.btn-block {
  display: block; width: 100%; text-align: center;
  font-size: 15px; font-weight: 700;
  padding: 14px 12px; border: none; border-radius: var(--radius-md);
  background: var(--deep); color: var(--white);
  cursor: pointer; font-family: var(--font-sans);
  letter-spacing: 0.02em;
}
.btn-block:disabled {
  opacity: 0.45; cursor: not-allowed;
}
.btn-block.secondary {
  background: var(--glow); color: var(--deep);
}
.btn-block.ghost {
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 10px;
  text-decoration: underline; text-underline-offset: 2px;
}
.btn-block.danger {
  background: var(--late); color: var(--white);
}

.link-quiet {
  display: block; text-align: center;
  font-size: 12px; color: var(--muted);
  margin-top: 10px; background: none; border: none;
  cursor: pointer; font-family: var(--font-sans);
}

.toast {
  position: absolute; left: 14px; right: 14px; bottom: 72px;
  background: var(--deep); color: var(--white);
  padding: 12px 14px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-phone);
  z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  transform: translateY(8px);
}
.toast.show { opacity: 1; transform: translateY(0); }

.demo-banner {
  background: var(--due-soft);
  border: 1px solid #ead9a8;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 10.5px; color: var(--due); font-weight: 600;
  margin-bottom: 10px; text-align: center;
}

.menu-list { display: flex; flex-direction: column; gap: 6px; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  box-shadow: var(--shadow-card);
}
.menu-item .mi-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.menu-item .mi-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.menu-item .chev { color: var(--muted); font-size: 16px; }

.state-chip-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px;
}
.state-chip-row button {
  font-size: 11px; font-weight: 700;
  padding: 6px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--white);
  color: var(--ink); cursor: pointer; font-family: var(--font-sans);
}
.state-chip-row button.on {
  background: var(--deep); color: var(--white); border-color: var(--deep);
}

/* Reuse shared phone components at full width */
.screen .card { margin-bottom: 10px; }
.screen .job-card, .screen .job-sticky { margin-bottom: 10px; }
.screen .btn-primary { cursor: pointer; border: none; width: 100%; }
.screen .btn-ghost { cursor: pointer; width: 100%; }
.screen .action-chip { cursor: pointer; border: none; }
.screen .action-link { cursor: pointer; background: none; border: none; width: 100%; font-family: var(--font-sans); }

.file-fake {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; background: var(--glow);
  border-radius: var(--radius-sm); margin-top: 8px;
  font-size: 12px; font-weight: 600; color: var(--deep);
}
.file-fake svg { width: 20px; height: 20px; stroke-width: 1.75; flex-shrink: 0; }

.date-picker-row {
  display: flex; gap: 8px; margin-top: 8px;
}
.date-picker-row button {
  flex: 1; padding: 8px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink); cursor: pointer;
  font-family: var(--font-sans);
}
.date-picker-row button.on {
  border-color: var(--imperial); background: var(--glow); color: var(--deep);
}

.shake { animation: shake .35s ease; }
@keyframes shake {
  0%,100%{transform:translateX(0)}
  25%{transform:translateX(-6px)}
  75%{transform:translateX(6px)}
}

.hidden { display: none !important; }

/* Long-scroll breathing room above fixed tab */
.screen.has-tabs { padding-bottom: 28px; }

/* ===== C2 width lock (Mike tweak 2026-09-29) =====
   One phone shell everywhere. Real phones ≤430: full-bleed.
   Desktop ≥431: single 390px phone chrome. No width jump between screens.
*/
:root {
  --app-max: 390px;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  min-height: 100%;
  height: 100%;
  overflow-x: hidden !important;
  background: #0a1f18 !important;
  box-sizing: border-box;
}

#app {
  width: 100%;
  max-width: var(--app-max);
  margin-left: auto;
  margin-right: auto;
  height: 100%;
  height: 100dvh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  box-sizing: border-box;
  /* kill any inherited board col/phone widths */
  min-width: 0;
}

#app,
#app * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Don't let board mock .phone / .col / .desk-* leak into the live app */
#app .phone,
#app .col,
#app .col-desk,
#app .desk,
#app .desk-shell {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.app-status,
.app-nav,
#screen-root,
.tabbar-fixed {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#screen-root {
  overflow-x: hidden;
  min-width: 0;
}

.screen {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.sticky-cta {
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
}

/* OTP row: never force horizontal scroll on narrow phones */
.otp-row {
  flex-wrap: nowrap;
  gap: clamp(4px, 1.5vw, 8px);
  padding: 0 2px;
}
.otp-row input {
  width: clamp(36px, 12vw, 44px);
  min-width: 0;
  flex: 1 1 0;
  max-width: 48px;
  height: 48px;
  font-size: 20px;
}

.action-row,
.chip-row,
.state-chip-row {
  flex-wrap: wrap;
  max-width: 100%;
}

/* Real phone / narrow viewport: full-bleed native feel */
@media (max-width: 430px) {
  body {
    background: var(--paper) !important;
    display: block !important;
    padding: 0 !important;
  }
  #app {
    max-width: 100% !important;
    width: 100% !important;
    height: 100dvh;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

/* Desktop / wide: ONE phone chrome at locked 390 — never full-bleed wide */
@media (min-width: 431px) {
  body {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 24px !important;
    background: #072e24 !important;
  }
  #app {
    width: var(--app-max) !important;
    max-width: var(--app-max) !important;
    flex: 0 0 var(--app-max);
    height: min(844px, calc(100dvh - 48px)) !important;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(6,69,54,.12), 0 24px 80px rgba(0,0,0,.4);
  }
}

/* Override earlier soft 480px rule — superseded by 431 lock above */
@media (min-width: 480px) {
  /* intentional no-op: kept so later sheets don't reintroduce jump;
     431 rule already defines desktop chrome */
}
