/* ───────────── Inbox (app/views/inbox.js) ─────────────
   One column of items that need you, beside the autopilot and what happened. Built on the tokens
   (tokens.css) so it follows the app's accent and the light and dark theme. */

.ix-page{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,380px);gap:var(--s-6);align-items:start}
.ix-column{display:grid;gap:var(--s-3);min-width:0}
.ix-side{display:grid;gap:var(--s-4);position:sticky;top:var(--s-4)}

/* The hero: how many things need you, or all clear. */
.ix-hero{display:flex;align-items:center;justify-content:space-between;gap:var(--s-4);padding:var(--s-5) var(--s-6);border-radius:var(--r-xl);
  background:linear-gradient(135deg,var(--accent-soft),color-mix(in srgb,var(--accent-soft) 35%,var(--surface)));border:1px solid var(--accent-line);box-shadow:var(--shadow-1),var(--edge)}
.ix-hero h2{font-family:var(--font-display);font-size:var(--t-title-2);font-weight:700;letter-spacing:-.02em;margin:0 0 4px;color:var(--ink)}
.ix-hero p{margin:0;font-size:var(--t-body-s);max-width:56ch}
.ix-hero-mark{flex:none;display:grid;place-items:center;width:52px;height:52px;border-radius:16px;background:var(--surface);color:var(--accent-ink);box-shadow:var(--shadow-1),var(--hairline)}
.ix-hero-mark .icon{width:26px;height:26px}
.ix-hero.clear .ix-hero-mark{background:var(--accent);color:var(--on-accent);animation:pop-in var(--dur-3) var(--ease-spring) both}

/* Which app. */
.ix-filter{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:2px 0}
.ix-filter::-webkit-scrollbar{display:none}
.ix-filter button{flex:none;display:inline-flex;align-items:center;gap:7px;min-height:32px;padding:4px 12px;border-radius:var(--r-full);border:1px solid var(--line);background:var(--surface);color:var(--ink-2);font-size:var(--t-body-s);font-weight:560;box-shadow:none}
.ix-filter button:hover{border-color:var(--line-strong);color:var(--ink)}
.ix-filter button.active{background:var(--inverse);border-color:var(--inverse);color:var(--on-inverse)}
.ix-filter button small{font-size:11px;font-weight:650;font-variant-numeric:tabular-nums;padding:0 6px;border-radius:var(--r-full);background:var(--surface-3);color:var(--muted)}
.ix-filter button.active small{background:color-mix(in srgb,var(--on-inverse) 18%,transparent);color:var(--on-inverse)}
.ix-filter .brand-mark,.ix-filter .app-mark{width:18px;height:18px}

.ix-group{margin:var(--s-3) 0 0;font-size:var(--t-caption);font-weight:650;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.ix-list{display:grid;gap:var(--s-2)}

/* One item. */
.ix-item{display:grid;grid-template-columns:auto minmax(0,1fr);gap:var(--s-4);padding:var(--s-4) var(--s-5);border-radius:var(--r-lg);background:var(--surface);
  border:1px solid var(--line);box-shadow:var(--shadow-1),var(--edge);cursor:default;transition:border-color var(--dur-2),box-shadow var(--dur-2),transform var(--dur-2) var(--ease-spring),opacity var(--dur-2);
  animation:ix-in var(--dur-3) var(--ease-spring) both}
.ix-item:hover{border-color:var(--line-strong)}
.ix-item.selected{border-color:var(--accent-line);box-shadow:0 0 0 3px var(--focus),var(--shadow-1)}
.ix-item.high{border-left:3px solid var(--danger);padding-left:calc(var(--s-5) - 2px)}
.ix-item.busy{opacity:.55;transform:scale(.99)}
@keyframes ix-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.ix-item{animation:none}}

.ix-mark .brand-mark,.ix-mark .app-mark{width:36px;height:36px}
.ix-hub{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:var(--surface-3);color:var(--ink-2)}
.ix-hub .icon{width:18px;height:18px}

.ix-main{display:grid;gap:6px;min-width:0}
.ix-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:var(--t-small);color:var(--muted)}
.ix-area{display:inline-flex;align-items:center;gap:5px;font-weight:600;color:var(--ink-2)}
.ix-area .icon{width:13px;height:13px}
.ix-dot{color:var(--faint)}
.ix-urgent{display:inline-flex;align-items:center;gap:4px;padding:1px 8px;border-radius:var(--r-full);background:var(--danger-soft);color:var(--danger);font-weight:650}
.ix-urgent .icon{width:12px;height:12px}
.ix-main h3{margin:0;font-size:var(--t-lead);font-weight:640;letter-spacing:-.01em;color:var(--ink);line-height:1.35}
.ix-main p{margin:0;font-size:var(--t-body-s);color:var(--ink-2);line-height:1.55}

.ix-proposal{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border-radius:var(--r-md);background:var(--accent-softer);border:1px solid var(--accent-line);font-size:var(--t-body-s);color:var(--ink-2)}
.ix-proposal .icon{flex:none;width:15px;height:15px;margin-top:2px;color:var(--accent-ink)}
.ix-proposal strong{color:var(--ink);font-weight:620}
.ix-confidence{margin-left:auto;font-variant-numeric:tabular-nums;font-weight:650;color:var(--accent-ink)}

.ix-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:6px}
.ix-actions button{min-height:32px;font-size:var(--t-body-s)}
.ix-actions button .icon{width:15px;height:15px}
.ix-actions .icon-only{margin-left:auto;padding:0;width:32px;justify-content:center}

.ix-keys{margin:var(--s-1) 0 0;font-size:var(--t-small);color:var(--faint);text-align:center}
.ix-keys kbd{font-size:10.5px;min-width:18px}

/* What was handled this week. */
.ix-recent-toggle{justify-self:start;display:inline-flex;align-items:center;gap:6px;font-size:var(--t-body-s);color:var(--muted)}
.ix-recent-toggle small{font-size:11px;font-weight:650;color:var(--faint)}
.ix-recent{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.ix-recent li{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--r-sm);font-size:var(--t-body-s)}
.ix-recent li:hover{background:var(--surface-3)}
.ix-recent-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2)}
.ix-recent small{color:var(--faint);white-space:nowrap}
.ix-status{font-size:11px;font-weight:650;padding:1px 8px;border-radius:var(--r-full);background:var(--surface-3);color:var(--muted)}
.ix-status.done{background:var(--success-soft);color:var(--success)}
.ix-status.failed{background:var(--danger-soft);color:var(--danger)}
.ix-status.approved{background:var(--info-soft);color:var(--info)}

/* Autopilot. */
.ap-intro{margin:-4px 0 var(--s-3);font-size:var(--t-body-s);color:var(--muted);line-height:1.5}
.ap-list{display:grid;gap:2px}
.ap-row{display:grid;gap:8px;padding:10px 0;border-top:1px solid var(--line)}
.ap-row:first-child{border-top:0;padding-top:0}
.ap-name{display:flex;align-items:center;gap:10px}
.ap-name>span:last-child{display:grid;min-width:0}
.ap-name strong{font-size:var(--t-body-s);font-weight:620;color:var(--ink)}
.ap-name small{font-size:var(--t-small);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ap-icon{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--surface-3);color:var(--ink-2)}
.ap-icon .icon{width:15px;height:15px}
.ap-levels{display:grid;grid-template-columns:repeat(4,1fr);width:100%}
.ap-levels button{padding:5px 4px;font-size:12px}
.ap-levels.level-off button.active{color:var(--muted)}
.ap-levels.level-notify button.active,.ap-levels.level-auto button.active{background:var(--accent);color:var(--on-accent)}
.ap-help{margin:0;font-size:var(--t-small);color:var(--muted);line-height:1.45;display:none}
.ap-row:hover .ap-help,.ap-row:focus-within .ap-help{display:block}

/* The AI agents and their money. */
.ag-money{display:grid;gap:6px;padding:10px 12px;border-radius:var(--r-md);background:var(--surface-2);border:1px solid var(--line);margin-bottom:10px}
.ag-money-row{display:flex;align-items:baseline;gap:6px}
.ag-money-row strong{font-family:var(--font-display);font-size:var(--t-title-3);font-weight:700;letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.ag-money-row .muted{font-size:var(--t-small)}
.ag-limit{margin-left:auto;min-height:26px;padding:2px 10px;font-size:12px}
.ag-bar{height:6px;border-radius:var(--r-full);background:var(--surface-3);overflow:hidden}
.ag-bar span{display:block;height:100%;border-radius:inherit;background:var(--accent);transition:width var(--dur-3) var(--ease-spring)}
.ag-bar span.high{background:var(--danger)}
.ag-money small{font-size:var(--t-small)}
.ag-limit-form{display:flex;align-items:flex-end;gap:8px}
.ag-limit-form label{display:grid;gap:3px;font-size:var(--t-small);color:var(--muted);flex:1}
.ag-limit-form input{width:100%;box-sizing:border-box}
.ag-warn{display:flex;gap:8px;align-items:flex-start;margin:0 0 10px;padding:8px 10px;border-radius:var(--r-sm);background:var(--warn-soft);color:var(--warn);font-size:var(--t-small)}
.ag-warn .icon{flex:none;width:14px;height:14px;margin-top:1px}
.ag-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.ag-list li{display:grid;gap:8px;padding:12px;border-radius:var(--r-md);border:1px solid var(--line)}
.ag-list li.off{opacity:.7}
.ag-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.ag-head strong{font-size:var(--t-body);font-weight:640}
.ag-about{margin:0;font-size:var(--t-small);color:var(--ink-2);line-height:1.5}
.ag-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:var(--t-small);color:var(--muted)}
.ag-meta>span{display:inline-flex;align-items:center;gap:5px}
.ag-meta .icon{width:13px;height:13px}
.ag-model{font-size:12px;min-height:26px;padding:2px 6px}
.ag-run{display:grid;gap:3px;padding:8px 10px;border-radius:var(--r-sm);background:var(--surface-2);font-size:var(--t-small);color:var(--ink-2)}
.ag-run small{color:var(--muted);white-space:pre-line;line-height:1.45}
.ag-run.failed{background:var(--danger-soft)}
.ag-run.failed b{color:var(--danger)}
.ag-run.done b{color:var(--success)}
.ag-run.running b{color:var(--info)}
.ag-never{margin:0;font-size:var(--t-small)}
.ag-run-now{justify-self:start;display:inline-flex;align-items:center;gap:6px;min-height:30px;font-size:12.5px}
.ag-run-now .icon{width:14px;height:14px}
.ag-switch{position:relative;display:inline-block;width:34px;height:20px;flex:none}
.ag-switch input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer;z-index:1}
.ag-switch span{position:absolute;inset:0;border-radius:var(--r-full);background:var(--line-strong);transition:background var(--dur-2)}
.ag-switch span::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:var(--shadow-1);transition:transform var(--dur-2) var(--ease-spring)}
.ag-switch input:checked+span{background:var(--accent)}
.ag-switch input:checked+span::after{transform:translateX(14px)}
.ag-switch input:focus-visible+span{box-shadow:0 0 0 3px var(--focus)}

/* App Store Connect webhooks. */
.wh-list{list-style:none;margin:0;padding:0;display:grid}
.wh-list li{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px 0;border-top:1px solid var(--line)}
.wh-list li:first-child{border-top:0;padding-top:2px}
.wh-list .brand-mark,.wh-list .app-mark{width:24px;height:24px}
.wh-text{display:grid;min-width:0}
.wh-text strong{font-size:var(--t-body-s);font-weight:620}
.wh-text small{font-size:var(--t-small);color:var(--muted)}
.wh-text small.wh-on{color:var(--success)}
.wh-list button{min-height:28px;padding:3px 12px;font-size:12.5px}

/* What happened. */
.ix-timeline ol{list-style:none;margin:0;padding:0;display:grid;gap:2px;max-height:420px;overflow:auto}
.ix-timeline li{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:start;padding:8px 2px;border-top:1px solid var(--line)}
.ix-timeline li:first-child{border-top:0}
.tl-icon{display:grid;place-items:center;width:22px;height:22px;color:var(--muted)}
.tl-icon .icon{width:15px;height:15px}
.tl-icon .brand-mark,.tl-icon .app-mark{width:20px;height:20px}
.tl-text{display:grid;min-width:0;font-size:var(--t-body-s)}
.tl-text strong{font-weight:560;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tl-text small{color:var(--muted);font-size:var(--t-small)}
.ix-timeline time{font-size:var(--t-small);color:var(--faint);white-space:nowrap}
.ix-quiet{margin:0;font-size:var(--t-body-s)}

/* The badge in the navigation turns red when something is urgent. */
.nav-count.danger,nav button.active .nav-count.danger{color:var(--danger);background:var(--danger-soft)}

@media (max-width:1100px){
  .ix-page{grid-template-columns:minmax(0,1fr)}
  .ix-side{position:static}
}
@media (max-width:720px){
  .ix-hero{padding:var(--s-4)}
  .ix-hero h2{font-size:var(--t-title-3)}
  .ix-hero-mark{width:44px;height:44px;border-radius:13px}
  .ix-item{padding:var(--s-3) var(--s-4);gap:var(--s-3)}
  .ix-mark .brand-mark,.ix-mark .app-mark,.ix-hub{width:30px;height:30px}
  .ix-keys{display:none}
  .ap-help{display:block}
}

/* A release text the Release Agent drafted: the whole text, readable, with its length; Edit turns it into a field. */
.ix-draft{display:grid;gap:8px;padding:12px 14px;border-radius:var(--r-md);background:var(--surface-2);box-shadow:var(--hairline)}
.ix-draft-head{display:flex;align-items:center;gap:10px;font-size:var(--t-small);color:var(--muted)}
.ix-draft-head>span{display:inline-flex;align-items:center;gap:6px;flex:1;font-weight:620;color:var(--ink-2)}
.ix-draft-head .icon{width:14px;height:14px}
.ix-draft-head button{min-height:0;padding:4px 10px;font-size:12.5px}
.ix-draft-text{margin:0;white-space:pre-wrap;font-size:var(--t-body-s);line-height:1.55;color:var(--ink);max-height:280px;overflow:auto}
.ix-draft textarea{width:100%;box-sizing:border-box;font:inherit;font-size:var(--t-body-s);line-height:1.55;resize:vertical}
/* The Event Agent's idea: the event as it would go in the plan. */
.ix-idea{gap:4px}
.ix-idea .ix-draft-head{margin-bottom:4px}
.ix-idea-name{font-size:var(--t-body);font-weight:680;color:var(--ink)}
.ix-idea-meta{color:var(--muted);font-size:var(--t-small);margin-top:4px}
/* An item's text keeps its lines (the Release Agent's brief is a list). */
.ix-main>p{white-space:pre-line}
/* A review the Review Agent replies to: the customer's words as a quote above the draft. */
.ix-quote{margin:6px 0 4px;padding:8px 12px;border-left:3px solid color-mix(in srgb,var(--accent,#3a72e8) 55%,transparent);border-radius:0 var(--r-s,8px) var(--r-s,8px) 0;background:color-mix(in srgb,var(--ink) 4%,transparent);font-size:var(--t-body-s);line-height:1.5;color:var(--ink);white-space:pre-line;font-style:italic}
/* A fix from the Quality Agent: the wrong words struck through, the right ones highlighted. */
.ix-fix{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:6px 0 2px;font-size:var(--t-body-s);line-height:1.5}
.ix-fix del{padding:1px 6px;border-radius:6px;background:color-mix(in srgb,#e5484d 12%,transparent);color:light-dark(#b42318,#ff8a8a);text-decoration-thickness:1.5px}
.ix-fix ins{padding:1px 6px;border-radius:6px;background:color-mix(in srgb,#30a46c 14%,transparent);color:light-dark(#1d7a4c,#5fd497);text-decoration:none;font-weight:600}
.ix-fix svg{width:14px;height:14px;opacity:.55;flex:none}
.ix-note{color:var(--ink-2,var(--muted));font-size:var(--t-body-s)}
/* The screenshot a Quality Agent finding is about: a small portrait thumbnail that opens it full size. */
.ix-shot{display:block;justify-self:start;align-self:start;width:132px;margin:8px 0 2px;border-radius:12px;overflow:hidden;box-shadow:0 0 0 1px var(--line),0 8px 20px -12px rgba(0,0,0,.35);transition:transform .35s var(--spring),box-shadow .35s var(--ease-out)}
.ix-shot img{display:block;width:132px;height:auto;min-height:80px;background:var(--surface-2)}
.ix-shot:hover{transform:translateY(-2px) scale(1.02);box-shadow:0 0 0 1px var(--line),0 14px 28px -14px rgba(0,0,0,.45)}
