/* ============================================================
   SCR · mobile.css — the phone app on a presentation stage.
   Tokens, buttons, chips, copilot bubbles and the intelligence
   material come from styles.css; this file adds the stage, the
   device, navigation, lists, sheets and the ink tab bar.
   ============================================================ */

/* ============ Stage (a silk field in light, liquid chrome in dark) ============ */
body[data-shell="mobile"] { overflow: hidden; }
.stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 68px 12px 16px;
  isolation: isolate; overflow: hidden;
  background:
    radial-gradient(70% 46% at 84% 112%, transparent 0 46%, rgba(255, 255, 255, 0.95) 52%, transparent 60%),
    radial-gradient(54% 40% at 104% 14%, transparent 0 48%, rgba(255, 255, 255, 0.9) 54%, transparent 62%),
    radial-gradient(60% 50% at -6% 70%, transparent 0 48%, rgba(255, 255, 255, 0.85) 55%, transparent 63%),
    radial-gradient(40% 40% at 12% 12%, rgba(250, 196, 0, 0.18), transparent 70%),
    linear-gradient(160deg, #f3f2ee, #e3e2dd);
}
[data-theme="dark"] .stage {
  background:
    radial-gradient(70% 46% at 84% 112%, transparent 0 46%, rgba(255, 255, 255, 0.2) 52%, transparent 60%),
    radial-gradient(54% 40% at 104% 14%, transparent 0 48%, rgba(220, 220, 232, 0.16) 54%, transparent 62%),
    radial-gradient(60% 50% at -6% 70%, transparent 0 48%, rgba(250, 196, 0, 0.18) 55%, transparent 63%),
    radial-gradient(40% 40% at 12% 12%, rgba(250, 196, 0, 0.12), transparent 70%),
    linear-gradient(160deg, #141317, #060607);
}
.stage::before {   /* a slow glow so the stage never sits completely still */
  content: ""; position: absolute; width: 900px; height: 900px; left: 50%; top: 50%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 196, 0, 0.14), transparent 62%);
  transform: translate(-50%, -50%); animation: stageGlow 12s ease-in-out infinite; pointer-events: none;
}
@keyframes stageGlow { 0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .8; } 50% { transform: translate(-46%, -54%) scale(1.12); opacity: 1; } }
.st-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
}
.st-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.st-mark svg { width: 34px; height: 34px; transition: transform .5s var(--ease); }
.st-brand:hover .st-mark svg { transform: rotate(-8deg) scale(1.06); }
.st-brand b { display: block; font-family: var(--font-display); font-size: 14.5px; font-weight: 700; letter-spacing: -0.035em; }
.st-brand small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.st-caption { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.st-caption b { display: block; font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.st-caption small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.st-av, .m-av {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #111013; background: var(--av);
}
.st-controls { display: flex; gap: 8px; flex-shrink: 0; margin-left: auto; }
.st-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none;
  background-image: linear-gradient(var(--brand), var(--brand)); background-repeat: no-repeat; background-size: 0% 100%;
  transition: background-size .45s var(--ease), border-color .3s, color .3s, transform .18s var(--ease-out);
}
.st-btn:hover { background-size: 100% 100%; border-color: var(--brand); color: #111013; }
.st-btn:hover svg { color: #111013; }
.st-btn:active { transform: scale(.96); }
.st-btn svg { width: 16px; height: 16px; color: var(--ink); }
.st-btn[data-guide-toggle].on { background-color: var(--brand); border-color: var(--brand); color: #111013; }
.st-btn[data-guide-toggle].on svg { color: #111013; }
.st-btn[data-guide-toggle]:not(.on) svg { color: var(--ink-4); }
@media (max-width: 1100px) { .st-caption { display: none; } }
@media (max-width: 700px) { .st-btn span { display: none; } .st-btn { padding: 0 10px; } .st-brand span:last-child { display: none; } }

/* ============ Device ============ */
.device {
  position: relative; flex-shrink: 0;
  width: 412px; height: 866px; padding: 11px;
  border-radius: 62px;
  background: linear-gradient(145deg, #303034, #0e0e10 40%, #1e1e21);
  box-shadow:
    inset 0 0 0 1.5px #4a4a4f, inset 0 0 0 4px #0b0b0c,
    0 1px 2px rgba(0, 0, 0, 0.2), 0 50px 100px -20px rgba(17, 16, 19, 0.45), 0 14px 34px rgba(0, 0, 0, 0.16);
}
.device::before, .device::after { content: ""; position: absolute; width: 4px; border-radius: 2px; background: #2c2c2f; }
.device::before { left: -3px; top: 168px; height: 64px; box-shadow: 0 86px 0 #2c2c2f; }
.device::after { right: -3px; top: 220px; height: 96px; }
.screen {
  position: relative; width: 390px; height: 844px;
  border-radius: 51px; overflow: hidden; isolation: isolate;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
}
/* the copilot thinking: a yellow arc runs round the rim and the edges warm up */
.screen::before, .screen::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 90;
  opacity: 0; transition: opacity .45s ease;
}
.screen::before {
  padding: 3px; background: var(--ai-conic); animation: aiSpin 1.8s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.screen::after { animation: edgeGlow 2.4s linear infinite; }
.screen.thinking::before, .screen.thinking::after { opacity: 1; }

.status-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 54px; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 32px 0 54px; pointer-events: none;
  font-size: 15.5px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
}
.sb-icons { display: flex; align-items: center; gap: 6px; }
.sb-icons svg:nth-child(1), .sb-icons svg:nth-child(2) { width: 18px; height: 12px; }
.sb-icons svg:nth-child(3) { width: 27px; height: 13px; }

/* Dynamic Island — expands to confirm what just happened */
.island {
  position: absolute; top: 11px; left: 50%; z-index: 80;
  width: 124px; height: 36px; border-radius: 999px;
  background: #000; color: #fff;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 0 16px 0 12px; overflow: hidden;
  transition: width .55s var(--spring), height .55s var(--spring), border-radius .55s var(--spring), box-shadow .3s;
  cursor: default;
}
.island > * { opacity: 0; transition: opacity .2s; }
.island.open { width: 362px; height: 74px; border-radius: 38px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); }
.island.open > * { opacity: 1; transition-delay: .16s; }
.island[onclick] { cursor: pointer; }
.isl-ic { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: var(--brand); color: #111013; }
.isl-ic svg { width: 18px; height: 18px; }
.isl-ic.good { background: #3cc47a; color: #111013; }
.isl-ic.warn, .isl-ic.crit { background: #ff5a4e; color: #111013; }
.isl-ic.info { background: var(--brand); color: #111013; }
.isl-ic.info svg { animation: twinkle 3.2s var(--ease) infinite; }
.isl-txt { flex: 1; min-width: 0; line-height: 1.25; }
.isl-txt b { display: block; font-size: 14px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isl-txt small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: rgba(255, 255, 255, 0.72); }
.isl-act { font-size: 12.5px; font-weight: 700; color: var(--brand); flex-shrink: 0; }

.home-indicator {
  position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); z-index: 45;
  width: 136px; height: 5px; border-radius: 3px; background: rgba(17, 16, 19, 0.82); pointer-events: none;
}
[data-theme="dark"] .home-indicator { background: rgba(255, 255, 255, 0.85); }

/* ============ Views & navigation ============ */
.views { position: absolute; inset: 0; }
.view { position: absolute; inset: 0; will-change: transform; background: var(--page); }
.view-scroll {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  padding: 98px 16px 122px; scrollbar-width: none;
}
.view-scroll::-webkit-scrollbar { display: none; }
.screen .rv.rv-in { animation-name: rvInSm; animation-duration: .7s; }
@keyframes rvInSm { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: none; } }
.nav-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30; height: 96px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 50px 10px 0;
  transition: background .3s, box-shadow .3s;
}
.view.scrolled .nav-bar {
  background: color-mix(in srgb, var(--page) 80%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 -1px 0 var(--separator);
}
.nav-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.03em; opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .3s var(--ease-out); max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view.scrolled .nav-title { opacity: 1; transform: none; }
.nav-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 3px; min-width: 0; max-width: 136px;
  height: 36px; padding: 0 12px 0 6px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 16px -10px rgba(17, 16, 19, 0.4);
  transition: background .2s, border-color .2s;
}
.nav-back:active { background: var(--brand); border-color: var(--brand); color: #111013; }
.nav-back svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* push / pop / tab transitions */
.enter-push { animation: vPushIn .5s var(--ease) both; }
.leave-push { animation: vPushOut .5s var(--ease) both; }
.enter-pop { animation: vPopIn .5s var(--ease) both; }
.leave-pop { animation: vPopOut .5s var(--ease) both; z-index: 2; }
.enter-fade { animation: vFadeIn .32s ease both; }
.leave-fade { animation: vFadeOut .22s ease both; }
.view.leaving { pointer-events: none; }
@keyframes vPushIn { from { transform: translateX(100%); box-shadow: -14px 0 34px rgba(0, 0, 0, 0.14); } to { transform: none; } }
@keyframes vPushOut { to { transform: translateX(-26%); opacity: .45; } }
@keyframes vPopIn { from { transform: translateX(-26%); opacity: .45; } to { transform: none; opacity: 1; } }
@keyframes vPopOut { to { transform: translateX(100%); } }
@keyframes vFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes vFadeOut { to { opacity: 0; } }

/* ============ Content ============ */
.m-head { margin: 0 4px 16px; }
.m-eyebrow { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.m-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.m-large { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -0.052em; line-height: 1.12; min-width: 0; overflow-wrap: anywhere; }
.view:not(.v-ask) .m-large { font-size: clamp(25px, 8.6vw, 32px); }
[data-screen^="supplier:"] .m-large, [data-screen^="material:"] .m-large, [data-screen^="product:"] .m-large,
[data-screen^="site:"] .m-large, [data-screen^="alert:"] .m-large { font-size: 26px; }
.m-sub { font-size: 14px; color: var(--ink-3); line-height: 1.45; margin-top: 6px; }
.m-sub b { color: var(--ink); }
.m-avatar {
  width: 40px; height: 40px; border-radius: 10px; border: none; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  color: #111013; background: var(--av);
  box-shadow: 0 8px 18px -10px rgba(17, 16, 19, 0.5);
  transition: transform .18s var(--ease-out);
}
.m-avatar:active, .m-icon-btn:active { transform: scale(.92); }
.m-icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: none; flex-shrink: 0;
  display: grid; place-items: center; background: var(--fill-2); color: var(--ink);
}
.m-icon-btn svg { width: 18px; height: 18px; }
.m-section { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.045em; margin: 26px 4px 10px; }
.m-section .st-dot { color: var(--brand); }
.m-stack > * + * { margin-top: 12px; }
.m-empty { color: var(--ink-3); font-size: 14px; text-align: center; padding: 26px 12px; }
.m-fine { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-top: 8px; }
.m-fine b { color: var(--ink); font-weight: 600; }
.m-kicker { display: block; font-size: 12px; font-weight: 700; color: color-mix(in srgb, var(--tone, var(--ink)) 50%, var(--ink)); margin-bottom: 2px; }
.bad { color: var(--crit-text); }
.good { color: var(--good-text); }

.m-card {
  background: var(--surface); border-radius: 18px; padding: 15px 16px;
  box-shadow: var(--shadow);
}
.m-card + .m-card { margin-top: 12px; }

/* hero: the role's headline on a dark chrome card */
.m-hero { position: relative; overflow: hidden; isolation: isolate; background: #0b0b0c; color: #fff; box-shadow: 0 22px 40px -24px rgba(17, 16, 19, 0.6); padding: 16px 17px; }
[data-theme="dark"] .m-hero { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
.m-hero .chrome-field { inset: -30%; }
.m-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background: linear-gradient(100deg, rgba(11, 11, 12, 0.86), rgba(11, 11, 12, 0.45) 60%, rgba(11, 11, 12, 0.2));
}
.m-hero > * { position: relative; }
.m-hero .chrome-field { position: absolute; }
.m-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.m-hero-label { font-size: 12.5px; font-weight: 700; color: var(--tone, var(--brand)); }
.m-hero-value { font-family: var(--font-rounded); font-size: 32px; font-weight: 600; letter-spacing: -0.05em; line-height: 1.12; font-variant-numeric: tabular-nums; color: #fff; }
.m-hero-value small { font-family: var(--font); font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, 0.6); letter-spacing: -0.02em; }
.m-spark { width: 96px; height: 38px; flex-shrink: 0; margin-top: 8px; }
.m-hero-sub { font-size: 13px; color: rgba(255, 255, 255, 0.7); line-height: 1.45; margin-top: 4px; }
.m-hero-stats { display: grid; grid-template-columns: 1fr 1fr; margin-top: 14px; padding-top: 11px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.m-hero-stats > div + div { padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.m-hero-stats span { display: block; font-size: 11.5px; color: rgba(255, 255, 255, 0.6); }
.m-hero-stats b { display: block; font-family: var(--font-rounded); font-size: 19px; font-weight: 600; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; color: #fff; }
.m-hero-stats small { display: block; font-size: 11px; color: rgba(255, 255, 255, 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* live strip under the hero */
.m-ticker { margin-top: 10px; border-radius: 12px; }
.m-ticker .tk-item { height: 40px; font-size: 12.5px; padding: 0 14px; gap: 7px; }
.m-ticker .tk-label { font-size: 10.5px; padding: 0 12px; gap: 7px; }
.m-ticker .tk-label .live-dot { width: 6px; height: 6px; }
.m-ticker .tk-sep { width: 10px; height: 10px; }

/* briefing */
.m-brief { margin-top: 14px; }
.m-brief > * { position: relative; z-index: 3; }
.m-brief-head { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; }
.m-brief-head .ai-mark { width: 30px; height: 30px; }
.m-brief-head b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.035em; }
.m-brief-head small { display: block; font-size: 11.5px; color: var(--ink-3); }
.m-brief-list { list-style: none; }
.m-brief-list li { display: flex; gap: 11px; padding: 11px 0; }
.m-brief-list li + li { border-top: 1px solid var(--separator); }
.m-brief-list p { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.m-brief-list p strong { color: var(--ink); font-weight: 600; }
.m-brief-list .ai-dot { margin-top: 2px; }
.m-pill {
  margin-top: 8px; height: 32px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600;
  transition: background .2s, border-color .2s, transform .15s;
}
.m-pill:active { transform: scale(.96); background: var(--brand); border-color: var(--brand); color: #111013; }

/* shortcuts */
.m-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 13px 13px 13px; border: none; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow);
  color: var(--ink); transition: transform .3s var(--ease-out), box-shadow .3s;
}
.m-tile:active { transform: scale(.97); box-shadow: 0 0 0 1.5px var(--brand); }
.m-tile-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--tone); background: #111013; margin-bottom: 8px; }
[data-theme="dark"] .m-tile-ic { background: #232227; }
.m-tile-ic svg { width: 17px; height: 17px; }
.m-tile b { font-size: 14px; font-weight: 700; letter-spacing: -0.03em; }
.m-tile small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.m-ask-cta {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 18px;
  height: 48px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); color: var(--ink-3); font-size: 14.5px; font-weight: 500;
}
.m-ask-cta:active { border-color: var(--ink); }
.m-ask-cta svg { width: 18px; height: 18px; color: var(--brand-text); }

/* grouped lists */
.m-list { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.m-row {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 56px;
  padding: 10px 12px 10px 16px; border: none; background: none; text-align: left; color: var(--ink);
  position: relative; transition: background .15s;
}
.m-row:active { background: var(--brand-wash); }
.m-row + .m-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--separator); }
.m-row.fresh { background: var(--brand-wash); box-shadow: inset 3px 0 0 var(--brand); }
.m-row-main { flex: 1; min-width: 0; }
.m-row-main b { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.m-row-main small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row-trail { flex-shrink: 0; text-align: right; line-height: 1.2; }
.m-row-trail b { display: block; font-family: var(--font-rounded); font-size: 14.5px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.m-row-trail small { display: block; font-size: 11px; color: var(--ink-3); text-transform: capitalize; }
.m-chev { color: var(--ink-4); flex-shrink: 0; }
.m-chev svg { width: 13px; height: 13px; }
.m-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.m-check { color: var(--ink); }
.m-check svg { width: 18px; height: 18px; }
.m-n { width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0; display: grid; place-items: center; color: #111013; font-size: 12px; font-weight: 700; }

/* controls */
.m-seg { display: flex; background: var(--fill-2); border-radius: 10px; padding: 3px; margin: 0 0 12px; gap: 2px; }
.m-seg button {
  flex: 1; height: 32px; border: none; background: none; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background .25s var(--ease), color .2s;
}
.m-seg button.on { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 14px -8px rgba(17, 16, 19, 0.6); }
.m-search {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin-bottom: 10px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink-3);
}
.m-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(250, 196, 0, 0.3); }
.m-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.m-search input { flex: 1; min-width: 0; border: none; outline: none; background: none; color: var(--ink); font-size: 16px; font-weight: 500; }
.m-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.m-scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px; }
.m-scroll-x::-webkit-scrollbar { display: none; }
.m-chip {
  flex-shrink: 0; height: 32px; padding: 0 12px; border: none; border-radius: 8px;
  background: var(--fill-2); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background .2s, color .2s;
}
.m-chip.on { background: var(--accent); color: var(--accent-ink); }

.m-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.m-fact { background: var(--surface); border-radius: 12px; padding: 10px 11px; box-shadow: var(--shadow); min-width: 0; }
.m-fact span { display: block; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-fact b { display: block; font-family: var(--font-rounded); font-size: 17px; font-weight: 700; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-result .m-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 10px 0 2px; }
.m-result .m-fact { background: var(--fill-3); box-shadow: none; }

.m-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.m-card .m-btns { margin: 12px 0 0; }
.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 0;
  height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600;
  transition: transform .18s var(--ease-out), background .2s, border-color .2s, color .2s;
}
.m-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.m-btn.primary { background: var(--cta-bg); border-color: var(--cta-bg); color: var(--cta-ink); }
.m-btn:active { transform: scale(.97); background: var(--brand); border-color: var(--brand); color: #111013; }
.m-btns .m-btn:only-child, .m-plan .m-btn.primary { grid-column: 1 / -1; }

.m-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px;
  background: var(--fill-2); color: var(--ink-2); font-size: 11.5px; font-weight: 700; text-transform: capitalize;
}
.m-badge.best { background: var(--brand); color: #111013; }
.m-badge.ok { background: var(--status-good-soft); color: var(--good-text); }
.m-badge.sev-critical { background: var(--status-critical-soft); color: var(--crit-text); }
.m-badge.sev-high { background: var(--status-serious-soft); color: var(--serious-text); }
.m-badge.sev-medium { background: var(--status-warning-soft); color: var(--warn-text); }

.m-reco h3 { font-size: 15.5px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.38; margin: 9px 0 10px; }
.m-reco-top { display: flex; gap: 6px; flex-wrap: wrap; }
.m-reco-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.m-reco-meta span { display: block; font-size: 11px; color: var(--ink-3); }
.m-reco-meta b { display: block; font-family: var(--font-rounded); font-size: 15.5px; font-weight: 700; letter-spacing: -0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-reco.fresh { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--brand); }
.m-reco.done { opacity: .66; }
.m-reco.done h3 { margin-bottom: 0; }

.m-note b { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 4px; }
.m-note p, .m-note-plain p { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.m-note-plain p + p { margin-top: 10px; }

.m-bars { display: grid; gap: 9px; }
.m-bar { display: grid; grid-template-columns: 112px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.m-bar i { display: block; height: 7px; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
.m-bar u { display: block; height: 100%; border-radius: 2px; transform-origin: left; animation: barGrow .9s var(--ease-rv) both .1s; }
.m-bar b { text-align: right; font-family: var(--font-rounded); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.m-gaps { padding: 6px 14px 12px; }
.m-gap { display: grid; grid-template-columns: minmax(0, 1fr) 96px 46px; align-items: center; gap: 10px; width: 100%; padding: 9px 0; border: none; background: none; color: var(--ink); text-align: left; }
.m-gap + .m-gap { border-top: 1px solid var(--separator); }
.m-gap-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-gap-track { position: relative; height: 18px; }
.m-gap-track i, .m-gap-legend i { display: block; height: 6px; border-radius: 2px; }
.m-gap-track i { position: absolute; left: 0; transform-origin: left; animation: barGrow .9s var(--ease-rv) both; }
.m-gap-track i.tts, .m-gap-legend i.tts { top: 2px; background: var(--series-1); }
.m-gap-track i.ttr, .m-gap-legend i.ttr { top: 10px; background: var(--status-serious); }
.m-gap b { text-align: right; font-family: var(--font-rounded); font-size: 13.5px; font-weight: 700; }
.m-gap-legend { display: flex; gap: 14px; padding-top: 8px; font-size: 11.5px; color: var(--ink-3); }
.m-gap-legend span { display: inline-flex; align-items: center; gap: 6px; }
.m-gap-legend i { width: 14px; }

/* simulate */
.m-node { display: flex; align-items: center; gap: 12px; width: 100%; border: none; text-align: left; color: var(--ink); margin-bottom: 12px; }
.m-node-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: var(--brand); background: #111013; flex-shrink: 0; }
[data-theme="dark"] .m-node-ic { background: #232227; }
.m-node-ic svg { width: 20px; height: 20px; }
.m-node small { display: block; font-size: 12px; color: var(--ink-3); }
.m-node b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.03em; }
.m-node-change { display: inline-flex; align-items: center; gap: 3px; font-size: 13.5px; font-weight: 700; color: var(--ink); flex-shrink: 0; background: linear-gradient(var(--brand), var(--brand)) no-repeat 0 100% / 100% 2px; padding-bottom: 1px; }
.m-node-change svg { width: 12px; height: 12px; }
.m-sliders { display: grid; gap: 14px; margin-bottom: 12px; }
.m-sliders label { display: grid; gap: 7px; }
.m-sliders span { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); }
.m-sliders span b { color: #111013; background: var(--brand); border-radius: 5px; padding: 0 7px; font-variant-numeric: tabular-nums; }
.m-sliders input { width: 100%; accent-color: var(--range); }
.m-result-lead { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.m-result-lead b { color: var(--ink); font-weight: 700; }
.m-result-lead b.bad { color: var(--crit-text); }
.m-plan h3 { font-size: 15.5px; font-weight: 700; letter-spacing: -0.03em; }
.m-plan .m-btns { grid-template-columns: 1fr auto; }

/* ============ Ask ============ */
.v-ask .view-scroll { padding-bottom: 240px; }
.ask-thread { display: flex; flex-direction: column; gap: 12px; }
.ask-thread .msg.user { max-width: 86%; }
.ask-thread .msg .bubble { font-size: 14.5px; }
.ask-thread .chip.follow { font-size: 12px; padding: 4px 10px; color: var(--ink-2); }
.ask-dock {
  position: absolute; left: 0; right: 0; bottom: 96px; z-index: 25;
  padding: 18px 12px 6px;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--page) 92%, transparent) 30%);
}
.ask-suggests { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 8px; padding: 0 12px; }
.ask-suggests::-webkit-scrollbar { display: none; }
.ask-suggests .chip { flex-shrink: 0; font-size: 12.5px; padding: 6px 11px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-strong); }
.ask-suggests .chip:active { background: var(--brand); color: #111013; }
.ask-context { margin-bottom: 8px; }
.ask-context .ctx-chip { border: none; }
.ask-context .ctx-chip i {
  width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; font-style: normal; font-size: 13px; line-height: 1;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.ask-context .ctx-chip i svg { width: 10px; height: 10px; }
.ask-form {
  display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 5px 0 15px;
  border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border-strong); box-shadow: 0 14px 30px -18px rgba(17, 16, 19, 0.5);
}
.ask-form:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(250, 196, 0, 0.3); }
.ask-form input { flex: 1; min-width: 0; border: none; outline: none; background: none; color: var(--ink); font-size: 16px; font-weight: 500; }
.ask-form button { width: 40px; height: 40px; border-radius: 9px; border: none; background: var(--brand); color: #111013; display: grid; place-items: center; }
.ask-form button:active { background: #111013; color: var(--brand); }
.ask-form button svg { width: 17px; height: 17px; }

/* ============ Tab bar (an ink dock with a yellow active tab) ============ */
.tabbar {
  position: absolute; left: 14px; right: 14px; bottom: 20px; z-index: 50;
  height: 64px; padding: 6px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px;
  border-radius: 20px;
  background: #111013;
  box-shadow: 0 18px 40px -14px rgba(17, 16, 19, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .tabbar { background: #1b1a1e; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 18px 40px -14px rgba(0, 0, 0, 0.8); }
.tab {
  position: relative; border: none; background: none; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: rgba(255, 255, 255, 0.6); font-size: 10px; font-weight: 700; letter-spacing: -0.01em;
  transition: color .25s, background .35s var(--ease);
}
.tab svg { width: 22px; height: 22px; transition: transform .35s var(--spring); }
.tab.on { color: #111013; background: var(--brand); }
.tab.on svg { transform: translateY(-1px) scale(1.06); }
.tab:active { transform: scale(.95); }
.tab-badge {
  position: absolute; top: 5px; left: calc(50% + 6px); display: none;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 5px;
  background: var(--status-critical); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px #111013;
}
.tab-badge.show { display: block; }

/* ============ Sheets ============ */
.sheet-host { position: absolute; inset: 0; z-index: 70; pointer-events: none; }
.m-sheet-wrap { position: absolute; inset: 0; pointer-events: auto; }
.m-sheet-scrim { position: absolute; inset: 0; background: rgba(17, 16, 19, 0.32); opacity: 0; transition: opacity .35s; }
.m-sheet-wrap.open .m-sheet-scrim { opacity: 1; }
.m-sheet {
  position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: 84%;
  display: flex; flex-direction: column;
  border-radius: 30px; overflow: hidden;
  background: var(--page);
  border: 1px solid var(--border);
  box-shadow: 0 -16px 50px -10px rgba(17, 16, 19, 0.35);
  transform: translateY(110%); transition: transform .55s var(--ease-out);
}
.m-sheet-wrap.open .m-sheet { transform: none; }
.m-sheet.tall { height: 84%; }
.m-grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--fill); margin: 8px auto 2px; flex-shrink: 0; }
.m-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 10px 20px; flex-shrink: 0; }
.m-sheet-head b { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.045em; }
.m-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--fill-2); color: var(--ink-2); display: grid; place-items: center; }
.m-close:active { background: var(--brand); color: #111013; }
.m-close svg { width: 13px; height: 13px; }
.m-sheet-body { overflow-y: auto; padding: 4px 16px 24px; scrollbar-width: none; }
.m-sheet-body::-webkit-scrollbar { display: none; }
.m-sheet .m-list, .m-sheet .m-row { background: var(--surface); }
.m-sheet .m-section { font-size: 17px; margin-top: 18px; }
.m-theme { margin: 0; }
.m-link {
  display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 18px; font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none;
}
.m-link span, .m-link { background-image: none; }
.m-link svg { width: 12px; height: 12px; }
.m-role { gap: 12px; }
.m-role .m-av { width: 38px; height: 38px; font-size: 12px; border-radius: 9px; }
/* the AI-drafted action sheet reuses the web form; one column on a phone */
.m-sheet.form .form-grid { grid-template-columns: 1fr; gap: 10px; }
.m-sheet.form .ai-note { font-size: 13px; }
.m-sheet.form .form-foot { flex-wrap: wrap; }
.m-sheet.form .form-foot .muted { flex-basis: 100%; margin: 0 0 4px; }
.m-sheet.form .form-foot .btn { flex: 1; min-height: 46px; font-size: 14.5px; }
.m-sheet .fld { font-size: 16px; background: var(--surface); }
.m-picker .m-section:first-child { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  .view, .enter-push, .leave-push, .enter-pop, .leave-pop, .enter-fade, .leave-fade { animation: none !important; }
  .stage::before { animation: none; }
}
