/* ==========================================================================
   WORKPASS — Everstream design system
   Aligned to the Everstream app: sage/forest palette, Montserrat display over
   DM Sans body, and hairline borders instead of drop shadows. Depth comes from
   the 1px line and a small lift on hover, never from a soft glow.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&display=swap');
:root {
  /* ---- Surfaces / neutrals (cool sage) ---- */
  --paper:      #f6f8f7;   /* app background */
  --card:       #ffffff;
  --card-2:     #eef2f0;   /* alt card / inset */
  --ink:        #26332f;
  --ink-soft:   #5c6c67;
  --ink-mute:   #83918c;
  --line:       #e4e9e7;
  --line-2:     #dde4e1;
  --line-hover: #b6c5bf;

  /* ---- Primary: forest green (trust / money actions) ---- */
  --brand:       #3d5b54;
  --brand-deep:  #26332f;
  --brand-soft:  #e8eeec;
  --brand-ink:   #26332f;

  /* ---- Dark surfaces (heroes, clock flow, marketing) ---- */
  --dark:       #151f1d;
  --dark-grad:  linear-gradient(175deg,#33443f,#1e2b28 60%,#243330);

  /* ---- Supporting accents, desaturated into the sage world ---- */
  --mint:       #4f8a72;   --mint-soft:  #e3efe9;   --mint-ink:#235240;
  --amber:      #c08a3e;   --amber-soft: #f4ebdb;   --amber-ink:#7a5518;
  --peach:      #a2705c;   --peach-soft: #f0e6e0;   --peach-ink:#6d4433;
  --lav:        #7d6a80;   --lav-soft:   #ece7ee;   --lav-ink:#4c3f52;
  --rose:       #a86169;   --rose-soft:  #f2e4e5;   --rose-ink:#6f3b41;
  --sky:        #4f7a8c;   --sky-soft:   #e4eef1;   --sky-ink:#2c5464;

  /* ---- Semantic ---- */
  --ok:        #3d7a63;   --ok-soft: #e3efe9;
  --warn:      #b8863c;   --warn-soft: #f4ebdb;
  --danger:    #b4544f;   --danger-soft: #f6e3e1;

  /* ---- Type ---- */
  --font-display: "Montserrat", system-ui, sans-serif;
  --font-body:    "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* ---- Radii ---- */
  --r-1: 8px; --r-2: 12px; --r-3: 14px; --r-4: 18px; --r-5: 20px; --r-pill: 999px;

  /* ---- Elevation. Everstream draws edges, it does not cast shadows: the
     "shadow" tokens are hairline rings so existing markup restyles in place. ---- */
  --sh-1: inset 0 0 0 1px var(--line);
  --sh-2: inset 0 0 0 1px var(--line);
  --sh-3: 0 18px 40px -24px rgba(20,35,32,.45);
  --sh-pop: none;

  /* ---- Spacing ---- */
  --s-1:4px; --s-2:8px; --s-3:12px; --s-4:16px; --s-5:20px; --s-6:24px; --s-7:32px; --s-8:44px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #e7eae8;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
.local-icon {
  width: 1em; height: 1em; border-radius: 999px;
  display: inline-grid; place-items: center; flex: none;
  font-family: var(--font-display); font-weight: 700; font-style: normal;
  text-align: center; speak: never; user-select: none;
}
.local-icon.duotone { opacity: .9; }

/* ===================== App scaffold (phone) ===================== */
.stage {
  min-height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 80% at 50% 0%, #f2f4f3, #dfe4e2);
  padding: 22px 0;
}
.phone {
  width: 390px; height: 844px;
  background: var(--paper);
  border-radius: 42px;
  box-shadow:
    0 0 0 11px #20302c,
    0 0 0 12px #3d4d48,
    0 40px 80px -30px rgba(20,35,32,.55);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.desktop-only { display: none; }
.mobile-only { display: contents; }

@media (min-width: 900px) {
  .stage { padding: 0; align-items: stretch; }
  .phone.owner-shell {
    width: 100vw; height: 100vh; max-width: none; border-radius: 0; box-shadow: none;
    display: block; overflow-y: auto; overflow-x: hidden; background: linear-gradient(175deg,#33443f,#1e2b28 60%,#243330);
  }
  .owner-shell > .statusbar { display: none; }
  .owner-shell > .mobile-only { display: none; }
  .owner-shell > .desktop-only { display: block; }
  .owner-shell > .overlay { left: 0; }
  .owner-shell .overlay > .screen.pad { width: min(1060px, calc(100% - 48px)); margin-inline: auto; }
  .owner-shell .overlay > .appbar, .owner-shell .overlay > .steps, .owner-shell .overlay > .pad:last-child { padding-left: max(24px, calc((100% - 1060px)/2)); padding-right: max(24px, calc((100% - 1060px)/2)); }

  /* ---------- Deck: sidebar + paper main ---------- */
  .deck { max-width: 1400px; margin: 0 auto; padding: 24px 24px 60px; display: flex; gap: 22px; align-items: flex-start; }
  .deck-side {
    width: 236px; flex: none; background: var(--card); border-radius: var(--r-4);
    padding: 20px 14px; position: sticky; top: 24px; border: 1px solid var(--line);
  }
  .deck-brand { font-family: var(--font-display); font-weight: 700; color: var(--brand); font-size: 11.5px; letter-spacing: .08em; padding: 2px 8px 14px; }
  .deck-biz { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; margin-bottom: 14px; border: none; background: none; border-radius: 12px; cursor: pointer; transition: background .15s; }
  .deck-biz:hover { background: var(--card-2); }
  .deck-biz-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 17px; flex: none; }
  .deck-nav { display: flex; flex-direction: column; gap: 3px; }
  .deck-nav button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px;
    border-radius: 12px; border: none; background: transparent; cursor: pointer;
    font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
    text-align: left; transition: background .15s, color .15s;
  }
  .deck-nav button:hover { background: var(--card-2); }
  .deck-nav button.active { background: var(--brand-soft); color: var(--brand-ink); }
  .deck-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }

  .deck-main { flex: 1; min-width: 0; background: var(--paper); border-radius: var(--r-4); padding: 28px 28px 44px; }
  .deck-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
  .deck-head .h-xl { font-size: 28px; }

  .deck-kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
  .deck-kpi { padding: 18px; min-height: 140px; display: flex; flex-direction: column; align-items: flex-start; }
  .deck-kpi-n { font-size: 27px; margin: 14px 0 4px; }
  .text-action { margin-top: auto; padding: 8px 0 0; border: 0; background: none; font-family: inherit; font-size: 13px; color: var(--brand); font-weight: 700; cursor: pointer; text-align: left; }

  .deck-split { display: grid; grid-template-columns: minmax(0,2fr) minmax(280px,1fr); gap: 16px; margin-top: 18px; }
  .deck-panel { border-radius: 18px; padding: 18px; }
  .deck-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 16px; }
  .deck-cards3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
  .deck-contrib { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-top: 14px; }
  .deck-row { padding: 10px 0; border-top: 1px solid var(--line); gap: 12px; }

  .deck-table { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .deck-table.flush { margin: 0; border: 0; border-radius: 0; }
  .deck-tr {
    display: grid; grid-template-columns: 1.6fr 1.2fr .7fr 1fr; align-items: center; gap: 12px;
    width: 100%; min-height: 56px; padding: 8px 14px; border: none; border-top: 1px solid var(--line);
    background: none; text-align: left; font-family: inherit; font-size: 13px; color: var(--ink);
  }
  .deck-tr.team { grid-template-columns: 1.7fr 1.2fr .8fr .9fr .9fr 74px; }
  button.deck-tr { cursor: pointer; transition: background .15s; }
  button.deck-tr:hover { background: var(--card-2); }
  .deck-tr:first-child { border-top: 0; }
  .deck-th { min-height: 38px; background: var(--card-2); color: var(--ink-mute); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
  .deck-tr small { color: var(--ink-mute); margin-top: 2px; }
  .deck-tr i { font-style: normal; }

  .deck-chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
  .deck-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: var(--r-pill);
    border: none; background: var(--card-2); color: var(--ink-soft); font-family: inherit;
    font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
  }
  .deck-chip.active { background: var(--brand); color: #fff; }
  .deck-chip-n { font-size: 11.5px; font-weight: 700; opacity: .75; }

  .deck-exc { border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
  .deck-roadmap { background: var(--card-2); border-radius: var(--r-3); padding: 16px 18px; border: 1px solid var(--line-2); }

  .deck-link { display: flex; align-items: center; gap: 12px; padding: 16px; cursor: pointer; text-align: left; transition: border-color .16s ease, transform .16s ease; }
  .deck-link:hover { transform: translateY(-2px); border-color: #a9bbb5; }
  .deck-link-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }

  .checklist { margin: 16px 0 20px; display: grid; gap: 13px; }
  .checklist > div { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
  .checklist svg { flex: none; margin-top: 1px; }
}

@media (min-width: 900px) and (max-width: 1180px) {
  .deck-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .deck-split, .deck-cards3 { grid-template-columns: 1fr; }
  .deck-contrib { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .deck-tr.team { grid-template-columns: 1.7fr .9fr .9fr .9fr 74px; }
  .deck-tr.team > *:nth-child(2) { display: none; }
}
@media (max-width: 430px) {
  .stage { padding: 0; }
  .phone { width: 100vw; height: 100vh; border-radius: 0; box-shadow: none; }
}

/* status bar */
.statusbar {
  height: 44px; flex: 0 0 44px; padding: 0 26px 0 30px;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 14px; color: var(--ink);
  position: relative; z-index: 5;
}
.statusbar.on-color { color: #fff; }
.statusbar .sb-icons { display: flex; gap: 6px; align-items: center; }
.statusbar .sb-icons i { font-style: normal; }

/* scroll body */
.screen { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; position: relative; -webkit-overflow-scrolling: touch; }
.screen::-webkit-scrollbar { width: 0; }
.pad { padding: 0 var(--s-5) var(--s-6); }

/* ===================== Type ===================== */
.display { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -.005em; }
.h-xl { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.16; }
.h-lg { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.2; }
.h-md { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.25; }
.h-sm { font-family: var(--font-display); font-weight: 600; font-size: 14px; line-height: 1.3; }
.eyebrow { font-family: var(--font-display); font-weight: 600; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-mute); }
.body { font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.small { font-size: 13px; line-height: 1.5; color: var(--ink-mute); }
.tiny { font-size: 11.5px; line-height: 1.45; color: var(--ink-mute); }
.mono-num { font-variant-numeric: tabular-nums; }
.strong { color: var(--ink); font-weight: 600; }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  border: none; border-radius: var(--r-pill);
  padding: 15px 22px; cursor: pointer; transition: background .16s ease, border-color .16s ease, opacity .16s ease;
  user-select: none; line-height: 1;
}
/* Primary is ink, not brand — Everstream's calls to action are near-black and
   the green is reserved for accents, links and active state. */
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--brand); }
.btn-primary:active { background: var(--brand); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-mint { background: var(--brand); color: #fff; }
.btn-mint:hover { background: var(--ink); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-soft:hover { background: #dde7e3; }
.btn-white { background: #fff; color: var(--ink); letter-spacing: .02em; }
.btn-white:hover { background: #eaf0ee; }
.btn-ghost { background: transparent; color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--brand); color: var(--ink); }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 17px 22px; font-size: 15px; }
.btn-sm { padding: 10px 15px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.iconbtn {
  width: 40px; height: 40px; border-radius: var(--r-pill); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--ink-soft); border: 1px solid var(--line);
  transition: border-color .16s ease;
}
.iconbtn:hover { border-color: var(--line-hover); }
.iconbtn.plain { background: transparent; border-color: transparent; }

/* ===================== Cards ===================== */
.card { background: var(--card); border-radius: var(--r-4); border: 1px solid var(--line); padding: 15px 17px; transition: border-color .16s ease; }
.card:hover { border-color: var(--line-hover); }
.card-flat { background: var(--card); border-radius: var(--r-4); border: 1px solid var(--line); padding: 15px 17px; }
.card-inset { background: var(--card-2); border-radius: var(--r-3); padding: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row-tween { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.col { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--s-3); }
.divider { height: 1px; background: var(--line); border: none; margin: var(--s-4) 0; }

/* chips / pills */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--r-pill);
  font-family: var(--font-display); font-size: 11.5px; font-weight: 600;
  background: var(--card-2); color: var(--ink-soft); white-space: nowrap;
}
.chip-mint { background: var(--mint-soft); color: var(--mint-ink); }
.chip-amber { background: var(--amber-soft); color: var(--amber-ink); }
.chip-brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip-peach { background: var(--peach-soft); color: var(--peach-ink); }
.chip-lav { background: var(--lav-soft); color: var(--lav-ink); }
.chip-rose { background: var(--rose-soft); color: var(--rose-ink); }
.chip-sky { background: var(--sky-soft); color: var(--sky-ink); }
.chip-ok { background: var(--ok-soft); color: #1d6b43; }
.chip-danger { background: var(--danger-soft); color: #a3303d; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }

/* avatar */
.av { border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; color: #fff; }

/* ===================== Fields ===================== */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-weight: 600; font-size: 12.5px; color: var(--ink-soft); }
.input, .select, textarea.input {
  width: 100%; font-family: var(--font-body); font-size: 16px; color: var(--ink);
  padding: 14px 15px; border: 1px solid var(--line-2); border-radius: var(--r-3);
  background: var(--card); outline: none; transition: border-color .16s ease;
}
.input::placeholder { color: var(--ink-mute); opacity: .75; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--brand); }
.input.with-prefix { padding-left: 34px; }
.field-wrap { position: relative; }
.field-prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); font-weight: 600; pointer-events: none; }

/* segmented */
/* Everstream segments are separate bordered pills, not a track with a slider. */
.seg { display: inline-flex; gap: 8px; width: 100%; }
.seg button {
  flex: 1; border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-3); cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--ink-soft);
  padding: 11px 8px; transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.seg button:hover { border-color: var(--line-hover); }
.seg button.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* toggle */
.toggle { width: 46px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .18s; flex: none; border: none; }
.toggle.on { background: var(--brand); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line-2); transition: left .18s; }
.toggle.on::after { left: 21px; }

/* ===================== Bottom nav ===================== */
.tabbar {
  flex: 0 0 auto; display: flex; padding: 9px 12px calc(18px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.94); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  position: relative; z-index: 6;
}
.tabbar button {
  flex: 1; border: none; background: transparent; cursor: pointer; padding: 6px 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: #a4b0ac;
  font-family: var(--font-display); font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  transition: color .15s;
}
.tabbar button.active { color: var(--ink); }
.tabbar button .ph { font-size: 21px; }
.tabbar button.fab-tab { position: relative; }
.fab {
  width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; margin-top: -18px;
  font-size: 26px;
}

/* ===================== Sheets / modal ===================== */
.scrim { position: absolute; inset: 0; background: rgba(20,29,27,.42); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .24s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--paper);
  border-radius: 24px 24px 0 0; box-shadow: 0 -18px 40px -24px rgba(20,35,32,.45);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  max-height: 92%; display: flex; flex-direction: column;
}
.sheet.show { transform: translateY(0); }
.sheet-grab { width: 40px; height: 4.5px; border-radius: 99px; background: var(--line-2); margin: 10px auto 4px; flex: none; }
.sheet-body { overflow-y: auto; padding: 4px var(--s-5) calc(var(--s-6) + env(safe-area-inset-bottom)); }
.sheet-body::-webkit-scrollbar { width: 0; }

/* full overlay page */
.overlay { position: absolute; inset: 0; z-index: 42; background: var(--paper); display: flex; flex-direction: column; animation: slideup .28s cubic-bezier(.4,0,.2,1); }
@keyframes slideup { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.appbar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.appbar .title { font-family: var(--font-display); font-weight: 600; font-size: 17px; }

/* progress */
.steps { display: flex; gap: 6px; padding: 0 var(--s-5); }
.steps .seg-bar { flex: 1; height: 5px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.steps .seg-bar i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .3s; }

/* misc */
.fadein { animation: fadein .3s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg,#e7ecea,#f4f7f6,#e7ecea); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.notch-safe { height: 6px; }

/* progress ring helper */
.ring { transform: rotate(-90deg); }
