/* ───────────────────────────────────────────────────────────────────
   Maitrium demo shell — shared design system
   Used by: close-commander, access-guardian, task-force
   ─────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Maitrium brand tokens (v3.12) */
  --ink:        #07090C;
  --paper-dark: #0A0E14;
  --wax:        #F5EBD7;
  --spice:      #6BFCED;
  --spice-deep: #07A4A6;
  --honey:      #F0A91A;

  /* Demo shell uses a light theme to maximize readability of dense product UIs.
     Accent color shifted to brand spice-deep for harmony with marketing pages. */
  --accent:    #07A4A6;
  --accent-dk: #056E70;
  --accent-lt: #DAFAFA;
  --text:      #0f1724;
  --muted:     #6b7a8d;
  --border:    #dde3ed;
  --bg:        #f7f9fc;
  --surface:   #ffffff;
  --green:     #16a34a;
  --green-lt:  #d4f5dd;
  --amber:     #F0A91A;
  --amber-lt:  #FEF3C7;
  --red:       #dc2626;
  --red-lt:    #fde7e7;
  --shadow-sm: 0 1px 3px rgba(15, 23, 36, .04);
  --shadow-md: 0 4px 16px rgba(15, 23, 36, .06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 36, .08);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Top bar ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 64px; padding: 0 28px;
  display: flex; align-items: center; gap: 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 16px; letter-spacing: -.01em;
  color: inherit; text-decoration: none;
  transition: opacity .15s;
}
a.brand:hover { opacity: .7; cursor: pointer; }
a.brand::after {
  content: '← back to maitrium.com';
  position: absolute; top: 64px; left: 28px;
  background: var(--text); color: #fff;
  padding: 5px 10px; border-radius: 6px;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500;
  letter-spacing: 0; text-transform: none;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  transform: translateY(-4px);
  white-space: nowrap; z-index: 100;
}
a.brand:hover::after { opacity: 1; transform: translateY(0); }
.brand-logo {
  width: 32px; height: 32px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><defs><mask id='m'><rect width='100' height='100' fill='white'/><path d='M 26 74 Q 26 30 32 30 Q 38 30 50 55 Q 62 30 68 30 Q 74 30 74 74' stroke='black' stroke-width='12' fill='none' stroke-linecap='round'/></mask></defs><polygon points='50,4 92,27 92,73 50,96 8,73 8,27' fill='%2307A4A6' mask='url(%23m)'/></svg>") center / contain no-repeat;
  color: transparent; font-size: 0;
  flex-shrink: 0;
}
.brand .sep      { color: var(--border); margin: 0 4px; font-weight: 300; }
.brand .product  { color: var(--muted); font-weight: 500; font-size: 14px; }
.brand .product strong { color: var(--text); font-weight: 700; margin-left: 6px; }

.env-tag {
  margin-left: auto; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.env-tag .pill {
  padding: 2px 8px; border-radius: 4px;
  font-weight: 600; font-size: 11px;
}
.env-tag .pill-red    { background: var(--red-lt);   color: var(--red); }
.env-tag .pill-amber  { background: var(--amber-lt); color: var(--amber); }
.env-tag .pill-accent { background: var(--accent-lt); color: var(--accent); }

.agent-pod {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 100px;
}
.agent-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #c2410c, #ea580c);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--accent);
  position: relative;
}
.agent-avatar::after {
  content: ''; position: absolute; bottom: -1px; right: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); border: 2px solid #fff;
}
.agent-meta { line-height: 1.2; }
.agent-name { font-size: 13px; font-weight: 600; }
.agent-title { font-size: 11px; color: var(--muted); }

/* ── Demo badge ──────────────────────────────────────────────────── */
.demo-badge {
  position: fixed; bottom: 16px; left: 16px; z-index: 60;
  background: rgba(15, 23, 36, .85); color: #fff;
  padding: 6px 12px; border-radius: 100px;
  font-size: 11px; font-weight: 600;
  backdrop-filter: blur(8px);
}

/* ── Main + screens ──────────────────────────────────────────────── */
main {
  padding: 32px 28px 100px;
  max-width: 1320px; margin: 0 auto;
}
.screen { display: none; }
.screen.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.stack .screen {
  display: block; margin-bottom: 60px;
  padding-bottom: 40px; border-bottom: 4px dashed var(--border);
}
body.stack .screen::before {
  content: 'Screen ' attr(data-num);
  display: inline-block; padding: 4px 10px; margin-bottom: 16px;
  background: var(--accent); color: #fff; border-radius: 6px;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 12px;
  letter-spacing: .04em; text-transform: uppercase;
}

/* ── Headings ────────────────────────────────────────────────────── */
h2.section-h {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 700; letter-spacing: -.015em;
  margin-bottom: 6px;
}
.section-sub {
  font-size: 13px; color: var(--muted); margin-bottom: 22px;
}
h3.sub-h {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px; font-weight: 700; letter-spacing: -.01em;
  margin-bottom: 12px;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px 22px; }

/* ── Metrics row ─────────────────────────────────────────────────── */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 28px;
}
.metric {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.metric .label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.metric .value { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 700; line-height: 1; }
.metric .delta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.metric.good .value  { color: var(--green); }
.metric.warn .value  { color: var(--amber); }
.metric.alert .value { color: var(--red); animation: pulseRed 2.4s ease-in-out infinite; }
@keyframes pulseRed { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ── Status dots ─────────────────────────────────────────────────── */
.status-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.sd-green { background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.sd-amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.sd-red   { background: var(--red);   box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
.sd-grey  { background: #c5cdd8; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 8px;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); transform: translateY(-1px); }

/* Subtle pulse on advance CTAs to invite the click */
.btn-primary[onclick*="nextScreen"] {
  box-shadow: 0 0 0 0 rgba(8, 157, 159, .35);
  animation: ctaPulse 2.6s ease-in-out infinite;
}
.btn-primary[onclick*="nextScreen"]:hover { animation: none; }
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(8, 157, 159, 0); }
  50%      { box-shadow: 0 0 0 7px rgba(8, 157, 159, .14); }
}
.btn-ghost {
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 15px 28px; font-size: 15px; }

/* ── AI inspector / agent panel ──────────────────────────────────── */
.ai-panel {
  background: linear-gradient(135deg, #f0fbfb, var(--surface));
  border: 1px solid var(--accent);
  border-radius: 12px; padding: 22px 24px;
}
.ai-panel .head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.ai-panel .head .av {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #c2410c, #ea580c); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.ai-panel .head .who { font-size: 14px; font-weight: 600; }
.ai-panel .head .who small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.ai-panel .head .thinking {
  margin-left: auto; font-size: 12px; color: var(--accent); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.ai-panel .head .thinking .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: blink 1.2s infinite;
}
.ai-panel .head .thinking .dot:nth-child(2) { animation-delay: .2s; }
.ai-panel .head .thinking .dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }
.ai-panel .text { font-size: 14px; line-height: 1.65; }
.ai-panel .text p { margin-bottom: 10px; }
.ai-panel .text strong { color: var(--accent); }
.ai-panel .actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Side rail (narrow panel for AI summaries) ──────────────────── */
.side-rail {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px;
  box-shadow: var(--shadow-sm);
}
.side-rail .head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.side-rail .head .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #c2410c, #ea580c);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px;
}
.side-rail .head .who { font-size: 13px; font-weight: 600; }
.side-rail .head .who small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.side-rail .body { font-size: 14px; line-height: 1.65; }
.side-rail .body p { margin-bottom: 12px; }
.side-rail .body strong { color: var(--accent); }
.side-rail .ts { margin-top: 16px; font-size: 11px; color: var(--muted); }

/* ── Mock Slack/Teams message panel ──────────────────────────────── */
.msg-panel {
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.msg-panel .channel-bar {
  background: #4a154b; color: #fff;
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.msg-panel .channel-bar .hash { opacity: .6; }
.msg-panel .msg-body { padding: 18px 20px; }
.msg-panel .msg {
  display: grid; grid-template-columns: 36px 1fr; gap: 12px;
  margin-bottom: 16px;
}
.msg-panel .msg-av {
  width: 36px; height: 36px; border-radius: 6px;
  background: linear-gradient(135deg, #c2410c, #ea580c);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.msg-panel .msg-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.msg-panel .msg-name small { font-weight: 400; color: var(--muted); margin-left: 8px; }
.msg-panel .msg-text { font-size: 14px; line-height: 1.6; color: var(--text); }
.msg-panel .msg-text strong { background: #fff7d6; padding: 1px 4px; border-radius: 3px; }

/* ── Impact card (dark closing card) ─────────────────────────────── */
.impact-card {
  margin-top: 28px; background: linear-gradient(135deg, #0f1724, #1f2937);
  color: #fff; border-radius: 12px; padding: 28px 32px;
  box-shadow: var(--shadow-lg);
}
.impact-card .label {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: #6BFCED; font-weight: 700; margin-bottom: 8px;
}
.impact-card .h {
  font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700;
  margin-bottom: 14px;
}
.impact-card .row { font-size: 14px; line-height: 1.7; opacity: .9; }
.impact-card .row strong { color: #6BFCED; font-weight: 700; }
.impact-card .compare {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15);
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.impact-card .compare .col-h {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.6); margin-bottom: 8px;
}
.impact-card .compare .v {
  font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700;
  margin-bottom: 6px;
}
.impact-card .compare .col-with .v { color: #6BFCED; }
.impact-card .compare .desc { font-size: 12px; opacity: .8; }

/* ── End frame ───────────────────────────────────────────────────── */
.end-hero { text-align: center; max-width: 720px; margin: 60px auto; }
.end-hero .eyebrow {
  display: inline-block; padding: 5px 14px;
  background: var(--accent-lt); color: var(--accent);
  border-radius: 100px; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 22px;
}
.end-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(34px, 4.5vw, 48px); font-weight: 700;
  line-height: 1.12; letter-spacing: -.025em; margin-bottom: 18px;
}
.end-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), #6BFCED);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.end-hero p {
  font-size: 17px; line-height: 1.65; color: var(--muted);
  margin-bottom: 36px;
}
.end-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.end-foot { margin-top: 26px; font-size: 13px; color: var(--muted); }

/* ── Bottom navigation ───────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 16px;
}
.nav-progress {
  flex: 1; max-width: 360px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.nav-progress .bar {
  flex: 1; height: 4px; border-radius: 4px; background: var(--border); overflow: hidden;
}
.nav-progress .bar .fill {
  height: 100%; background: var(--accent);
  transition: width .35s ease;
}
.nav-progress .step {
  font-size: 12px; color: var(--muted); font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}
.nav-mode {
  margin-right: auto; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.nav-mode .live {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: blink 1.5s infinite;
}
.nav-actions { display: flex; gap: 8px; }

/* ── Generic table-list for tasks/users/etc ──────────────────────── */
.list-rows .row {
  display: grid; gap: 14px; align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.list-rows .row:last-child { border-bottom: none; }
.list-rows .row .name { font-weight: 500; }
.list-rows .row .meta {
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
