/* GPT compact operating surface. Reading, login and base Nightflight tokens stay unchanged. */
body[data-route=gpt] .screen{padding-top:calc(8px + env(safe-area-inset-top));padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
body[data-route=gpt] .assistant-topline{margin-bottom:0;min-height:44px}
body[data-route=gpt] .tabs{margin:0 0 8px!important;padding:2px}
body[data-route=gpt] .work-title{font-size:18px}
.assistant-topline #sync-data{margin-left:auto;padding-inline:8px}
.sync-line{margin:0;min-height:0}.sync-line #sync-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.sync-line.has-error #sync-status{position:static;width:auto;height:auto;clip-path:none;color:var(--danger);padding:6px 0;font-size:12px}
.device-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.device-slot{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1px 6px;align-items:center;min-width:0;min-height:66px;padding:7px 10px;text-align:left;border:1px solid var(--strong);border-radius:12px;background:var(--paper-soft);color:var(--ink)}
.device-slot:focus-visible{outline-offset:1px}.device-slot-name{font-size:12px;color:var(--wine);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.device-slot-account{grid-column:1/-1;font-size:12px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.device-slot-quota{font-size:12px;color:var(--green);font-variant-numeric:tabular-nums;white-space:nowrap}
.device-slot[data-state=waiting] .device-slot-quota{color:var(--muted)}.device-slot[data-state=expired] .device-slot-quota{color:var(--danger)}
.device-slot-name{grid-column:1/-1;grid-row:1}.device-slot-account{grid-row:2}.device-slot-quota{grid-column:1/-1;grid-row:3;font-size:11px;white-space:normal;overflow-wrap:anywhere}
#device-usage{margin-bottom:6px}#other-devices summary{min-height:44px;display:flex;align-items:center;color:var(--wine);font-size:12px;cursor:pointer}
#home-devices{margin:0 0 16px}#home-devices:empty{display:none}
#view-overview .signal-grid{gap:4px;margin:0 0 4px!important}
#view-overview .signal-card{display:flex;justify-content:center;align-items:center;gap:5px;min-height:44px;padding:5px;border:0;border-radius:8px;background:transparent}
#view-overview .signal-card.selected{background:var(--wine-soft)}#view-overview .signal-card strong{font-size:16px;margin:0}
#view-overview .signal-card .eyebrow{font-size:11px;letter-spacing:0;white-space:nowrap}
#view-overview .quota-toolbar{gap:6px;margin-bottom:6px}#view-overview .quota-toolbar select{border-color:var(--rule);background:transparent}
#view-overview .quota-more summary{padding:6px 10px}
.queue-heading{margin:0}.queue-heading.is-default{display:none}.queue-heading h3{font-size:13px}.queue-heading .section-tools>[data-view-link]{display:none}
.overview-deck{gap:4px;padding-bottom:6px}
.deck-peek{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;min-height:56px;padding:6px 10px 8px;gap:2px 6px;border-radius:10px}
.deck-peek .peek-name{font-size:13px;line-height:18px}.device-badges{display:flex;gap:3px;min-width:0;max-width:130px;justify-content:flex-end}
.device-badge{font-size:11px;line-height:18px;color:var(--wine);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.peek-metrics{grid-column:1/-1;display:flex;align-items:center;gap:6px;min-width:0;font-variant-numeric:tabular-nums}
.peek-metrics>.status,.peek-topup{flex-shrink:0;white-space:nowrap}.peek-topup{font-size:12px;line-height:18px;color:var(--muted)}.deck-peek.available .peek-topup{color:var(--green)}.deck-peek.expired .peek-topup{color:var(--danger)}
.peek-metrics>.peek-time{margin-left:auto;min-width:0;text-align:right}.peek-badges{display:flex;align-items:center;gap:5px;min-width:0;max-width:150px}.peek-badges .device-badges{max-width:74px}.peek-badges .compact-card-count{flex-shrink:0}
.account-balances{margin:4px 0;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}.deck-active.available .account-balances{color:var(--green)}
.topup-shortcuts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.topup-shortcuts button{min-height:44px;font-size:13px}.topup-conflict{padding:10px 12px;background:var(--amber-soft);color:var(--amber);font-size:13px;line-height:1.6;border-radius:10px}#topup-balance{font-variant-numeric:tabular-nums}#topup-account{overflow-wrap:anywhere}
.deck-peek .peek-time{font-size:12px;line-height:18px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--muted)}
.deck-peek .status{padding:0;background:transparent;min-height:18px;font-size:12px;line-height:18px}
.compact-card-count{margin-left:auto;color:var(--amber);font-size:11px;line-height:18px;white-space:nowrap}.compact-card-count[data-urgent=true]{color:var(--danger)}
.deck-peek .reset-meter{position:absolute;left:10px;right:10px;bottom:3px;width:auto;margin:0;pointer-events:none}
.deck-peek .reset-meter-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.deck-peek .reset-track{height:2px}
.deck-active{padding:6px 10px 10px;border-radius:12px;box-shadow:none}.deck-active .account-head{min-height:36px}.deck-active>.device-badges{justify-content:flex-start;max-width:none}
.deck-active .account-time{font-size:21px;margin:5px 0 1px}.deck-active .quota-age{margin:5px 0}.deck-active .quick-copy{margin-top:8px;gap:6px}
.deck-active .account-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:6px}.deck-active .account-actions>.use-reset-card{grid-column:1/-1}
.deck-active .current-action{border:1px solid var(--strong);padding:8px;font-size:13px}.deck-active .reset-meter{margin-top:6px}
#view-accounts .page-heading{padding:0;margin-bottom:6px}#view-accounts .page-heading h2{font-size:18px;margin:0}#view-accounts .page-heading p{font-size:12px}
#view-accounts .manage-tools{margin-bottom:6px}#view-accounts .search-field{margin-bottom:4px!important}#view-accounts .search-field input{margin-top:0}
#view-accounts .cards-grant-trigger{margin-bottom:6px;min-height:44px}#view-accounts .filter-row{padding:0}
.manage-list{gap:4px}.manage-toggle{min-height:58px;padding:7px 10px}.manage-name{font-size:13px;line-height:18px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.manage-time{line-height:18px;margin-top:3px}.manage-toggle-side{flex-direction:column;gap:1px;align-items:flex-end;max-width:125px}.manage-toggle-side .manage-chevron{display:none}.manage-toggle-side .device-badges{max-width:100%}
.manage-status{font-size:11px;padding:0;background:transparent;min-height:18px}.manage-details{padding:10px}.manage-actions{margin-bottom:6px}
.manage-fields{gap:0 10px}.manage-field{padding:8px 0}.manage-field span{margin-bottom:2px}
.manage-actions>.manage-topup{grid-column:1/-1}
.device-choice-list{display:grid;gap:6px}.device-choice{min-height:52px;text-align:left;width:100%}.device-choice strong,.device-choice small{display:block;overflow-wrap:anywhere}
.device-name-form{display:flex;align-items:end;gap:8px}.device-name-form label{flex:1;min-width:0}.device-name-form button{flex-shrink:0}
.reset-all-entry{padding:12px 0;border-top:1px solid var(--rule)}.reset-all-entry h3{font-size:15px}.reset-all-entry p{font-size:12px}
.device-name-panel{margin-top:14px;border-top:1px solid var(--rule)}.device-name-panel summary{display:flex;align-items:center;min-height:44px;color:var(--wine);cursor:pointer}
.reset-all-account+.reset-all-account{margin-top:16px;padding-top:16px;border-top:1px solid var(--rule)}.reset-all-account h3{font-size:15px}.reset-all-account-name{font-size:13px;overflow-wrap:anywhere}
@media(max-width:350px){#view-overview .signal-grid{grid-template-columns:1.25fr repeat(3,minmax(0,1fr))}#view-overview .signal-card{gap:3px;padding-inline:3px}.device-slot{padding-inline:7px}.device-badges{max-width:105px}.deck-peek{padding-inline:8px}.peek-metrics{gap:4px}.compact-card-count{font-size:11px}.deck-active .account-actions{grid-template-columns:1fr}.manage-toggle-side{max-width:100px}}

/* Stone-dark work area with pale paper entries. Scope the paper contrast to
   the account surfaces so the shell, dialogs and reading keep their own tone. */
#assistant-view {
  --ledger-paper: #f5efdf;
  --ledger-ink: #292b26;
  --ledger-blue: #395b6b;
  --ledger-clay: #943d2b;
  --ledger-border: #b9aa91;
  --ledger-green: #315a3d;
}
#assistant-view .assistant-topline { gap: 8px; }
#assistant-view .assistant-topline #sync-data { margin-inline-start: auto; }
#assistant-view :is(#back-home, #sync-data, .entry-switcher-trigger) { min-height: 44px; }
#assistant-view .assistant-topline .entry-switcher-trigger {
  flex-basis: auto;
  padding-inline: 12px;
  background: var(--ledger-paper);
  color: var(--ledger-ink);
  border-color: var(--ledger-paper);
  border-radius: 100px;
}
#assistant-view .gpt-banner {
  position: relative;
  isolation: isolate;
  padding-block: 8px 4px;
}
#assistant-view .work-title {
  margin: 0 0 4px;
  position: relative;
  font: 700 clamp(33px, 10cqi, 46px)/1.13 var(--display-font, Georgia, "Songti SC", serif);
  letter-spacing: -.035em;
}
#assistant-view .gpt-banner-art {
  position: absolute;
  z-index: -1;
  inset-inline-end: 0;
  inset-block-end: 7px;
  width: min(44%, 198px);
  height: 86px;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
}
#assistant-view .tabs {
  position: relative;
  width: max-content;
  max-width: 100%;
  gap: 7px;
  margin: 5px 0 6px !important;
  padding: 0;
  background: transparent;
  border: 0;
}
#assistant-view .tabs button {
  min-width: 70px;
  padding-inline: 13px;
  border: 1px solid var(--strong);
  border-radius: 100px;
  font-size: 15px;
  color: var(--ink);
}
#assistant-view .tabs .active {
  background: var(--ledger-paper);
  border-color: var(--ledger-paper);
  color: var(--ledger-ink);
}
body[data-route=me] #assistant-view .gpt-banner { display: none; }

#assistant-view .device-grid { gap: 8px; }
#assistant-view .device-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  gap: 3px;
  position: relative;
  border-radius: 14px;
  border: 1px solid #c2b197;
  background: var(--ledger-paper);
  color: var(--ledger-ink);
  padding: 8px 10px;
  min-width: 0;
}
#assistant-view .device-slot-name {
  font: 700 17px/1.3 var(--display-font, Georgia, "Songti SC", serif);
  color: var(--ledger-ink);
}
#assistant-view .device-slot-account { min-width: 0; font-size: 12px; white-space: nowrap; }
#assistant-view .device-slot-quota { color: var(--ledger-green); font-size: 11px; line-height: 1.35; }
#assistant-view .device-slot[data-state=waiting] .device-slot-quota { color: #685b48; }
#assistant-view .device-slot[data-state=expired] .device-slot-quota { color: var(--ledger-clay); }
#assistant-view .device-slot-action {
  display: block;
  width: 100%;
  margin-block-start: 3px;
  padding: 3px 7px;
  border-radius: 7px;
  background: var(--ledger-blue);
  color: #fff8ea;
  text-align: center;
  font-size: 12px;
  font-weight: 650;
}
#assistant-view .device-slot:focus-visible,
#assistant-view .deck-peek:focus-visible,
#assistant-view .deck-toggle:focus-visible,
#assistant-view .manage-toggle:focus-visible {
  outline: 2px solid var(--ledger-blue);
  outline-offset: -3px;
}
#assistant-view #device-usage { margin-block-end: 5px; }
#assistant-view #other-devices summary { padding-inline: 4px; }
#assistant-view #other-devices[open] .device-grid { padding-block-end: 4px; }
#assistant-view #view-overview .signal-grid { gap: 4px; margin: 0 0 2px !important; }
#assistant-view #view-overview .signal-card {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 100px;
  color: var(--ink);
}
#assistant-view #view-overview .signal-card.selected {
  border-color: var(--strong);
  background: var(--paper-tint);
}
#assistant-view .signal-card .eyebrow { color: inherit; }
#assistant-view .queue-controls {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 7px;
  margin-block-end: 5px;
  border-top: 1px solid var(--rule);
}
#assistant-view .queue-heading {
  display: flex;
  gap: 8px;
  margin: 0;
  min-height: 44px;
}
#assistant-view .queue-heading h2,
#assistant-view #view-accounts .page-heading h2 {
  margin: 0;
  color: var(--ink);
  font: 700 22px/1.2 var(--display-font, Georgia, "Songti SC", serif);
}
#assistant-view #queue-all { font-size: 12px; }
#assistant-view #view-overview .quota-toolbar { flex-wrap: nowrap; gap: 5px; margin: 0; }
#assistant-view #view-overview .quota-toolbar label { min-width: 0; }
#assistant-view #view-overview .quota-toolbar select { min-height: 44px; border-color: transparent; padding-inline: 2px; }
#assistant-view #view-overview .quota-more { position: static; }
#assistant-view #view-overview .quota-more summary { border-color: transparent; padding: 5px 4px; white-space: nowrap; }
#assistant-view #view-overview .quota-more summary::after { content: "⌄"; margin-inline-start: 4px; }
#assistant-view #view-overview .quota-more-actions { left: auto; right: 0; top: calc(100% + 2px); }

#assistant-view :is(.deck-peek, .deck-active, .manage-card) {
  --paper-soft: var(--ledger-paper);
  --paper-tint: #e9dfc8;
  --ink: var(--ledger-ink);
  --muted: #605747;
  --soft: #645946;
  --rule: #c8b99e;
  --strong: var(--ledger-border);
  --wine: var(--ledger-clay);
  --wine-soft: #ead1bd;
  --green: var(--ledger-green);
  --green-soft: #e5e9d4;
  --danger: #8d3b2e;
  --danger-soft: #f0dcd1;
  --amber: #754716;
  --amber-soft: #ead8ae;
  border-color: var(--rule);
  color: var(--ink);
  background: var(--paper-soft);
}
#assistant-view :is(.deck-peek, .deck-active).available { background: var(--green-soft); border-color: #b6bc9d; }
#assistant-view :is(.deck-peek, .deck-active, .manage-card).expired { background: var(--danger-soft); border-color: #cb9d8e; }
#assistant-view .overview-deck,
#assistant-view .manage-list { gap: 5px; }
#assistant-view .deck-peek {
  grid-template-columns: 16px minmax(0, 1fr) auto 15px;
  grid-template-rows: auto auto;
  column-gap: 6px;
  min-height: 53px;
  padding: 5px 8px 7px;
  border-radius: 12px;
}
#assistant-view .deck-peek .account-mark { grid-column: 1; grid-row: 1 / 3; }
#assistant-view .deck-peek .peek-name { grid-column: 2; grid-row: 1; }
#assistant-view .deck-peek .peek-badges { grid-column: 3; grid-row: 1; }
#assistant-view .deck-peek .deck-chevron { grid-column: 4; grid-row: 1 / 3; }
#assistant-view .deck-peek .peek-metrics { grid-column: 2 / 4; grid-row: 2; flex-wrap: nowrap; }
#assistant-view .deck-peek .peek-time { flex: 0 1 auto; }
#assistant-view .deck-peek .reset-meter { inset-inline: 30px 28px; }
#assistant-view .deck-peek .reset-track,
#assistant-view .deck-active .reset-track { background: #c9c1aa; }
#assistant-view .reset-track i { background: #779065; }
#assistant-view .deck-peek .status {
  background: transparent;
  color: var(--muted);
  font-size: 12px !important;
}
#assistant-view .deck-peek .status.cell-available { color: var(--green); }
#assistant-view .deck-peek .status.cell-expired,
#assistant-view .deck-peek .compact-card-count[data-urgent=true] { color: var(--danger); }
#assistant-view .deck-peek .status.cell-pending { color: var(--amber); }
#assistant-view .deck-peek .peek-topup,
#assistant-view .deck-peek .peek-time { font-size: 11px !important; }
#assistant-view .deck-peek .peek-topup { overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
#assistant-view .peek-name,
#assistant-view .manage-name { font-size: 14px !important; line-height: 1.25; }
#assistant-view .deck-peek .peek-badges { display: flex; max-width: 119px; }
#assistant-view .deck-peek .device-badges:empty { display: none; }
#assistant-view :is(.account-mark, .deck-chevron, .manage-chevron) { display: inline-flex; align-items: center; color: var(--ledger-blue); }
#assistant-view :is(.account-mark, .deck-chevron, .manage-chevron) .icon { width: 16px; height: 16px; }
#assistant-view .deck-active .deck-chevron { transform: rotate(90deg); }
#assistant-view .deck-active { border-color: var(--ledger-clay); padding: 2px 10px 9px; border-radius: 14px; }
#assistant-view .deck-active .deck-toggle {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 16px;
  gap: 8px;
  min-height: 44px;
}
#assistant-view .deck-active .account-name { font-size: 15px !important; line-height: 1.3; }
#assistant-view .account-marks { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin-bottom: 2px; }
#assistant-view .account-marks .device-badges { justify-content: start; max-width: 100%; flex-wrap: wrap; }
#assistant-view .account-marks .device-badge { font-size: 12px; font-weight: 700; }
#assistant-view .account-marks .reset-card-badge { margin: 0; border-color: var(--ledger-border); font-size: 11px !important; }
#assistant-view .account-marks .reset-card-badge[data-urgent=true] { border-color: #c19280; }
#assistant-view .deck-active .card-information { gap: 5px; }
#assistant-view .deck-active .account-time {
  margin-block: 1px;
  font: 700 22px/1.25 var(--display-font, Georgia, "Songti SC", serif);
}
#assistant-view .deck-active.available .account-time { color: var(--green); }
#assistant-view .deck-active.expired .account-time { color: var(--danger); }
#assistant-view .deck-active .account-balances { margin-block: 1px; }
#assistant-view .deck-active .quota-age { margin-block: 1px; font-size: 11px !important; }
#assistant-view .deck-active .reset-meter { margin-block-start: 4px; }
#assistant-view .deck-active .reset-meter-label { margin-bottom: 3px; }
#assistant-view .deck-active .quick-copy { margin-top: 6px; gap: 5px; }
#assistant-view .deck-active .quick-copy:has(.record-quota) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#assistant-view .deck-active .account-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
#assistant-view .deck-active .account-actions :is(.action-button, .use-reset-card) { grid-column: 1 / -1; }
#assistant-view .deck-active :is(.account-actions button, .quick-copy button) { font-size: 12px; min-height: 44px; padding-inline: 4px; }
#assistant-view .deck-active :is(.outline, .copy-button, .current-action, .record-topup),
#assistant-view .manage-card .outline { background: transparent; border-color: var(--strong); color: var(--ink); }
#assistant-view .deck-active .record-quota { background: var(--ledger-clay); border-color: var(--ledger-clay); color: #fff8ea; }
#assistant-view .deck-active .use-reset-card { background: var(--amber-soft); border-color: var(--ledger-border); color: var(--amber); }

#assistant-view #view-accounts .page-heading { margin-block: 4px 8px; }
#assistant-view #view-accounts .manage-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 6px; }
#assistant-view #view-accounts .search-field { grid-column: 1; grid-row: 1; margin: 0 !important; }
#assistant-view #view-accounts .cards-grant-trigger { grid-column: 2; grid-row: 1; width: auto; margin: 0; font-size: 12px; padding-inline: 9px; }
#assistant-view #view-accounts .filter-row { grid-column: 1 / -1; flex-wrap: wrap; gap: 2px; overflow: visible; }
#assistant-view .filter-row .filter { border-radius: 100px; padding-inline: 7px; }
#assistant-view .filter-row .filter.active { color: var(--ledger-ink); background: var(--ledger-paper); border-color: var(--ledger-paper); }
#assistant-view .manage-toggle { min-height: 55px; }
#assistant-view .manage-toggle-side { display: grid; grid-template-columns: auto 16px; gap: 1px 4px; justify-items: end; }
#assistant-view .manage-toggle-side .device-badges { grid-column: 1; grid-row: 2; }
#assistant-view .manage-toggle-side .manage-status { grid-column: 1; grid-row: 1; }
#assistant-view .manage-toggle-side .manage-chevron { grid-column: 2; grid-row: 1 / 3; align-self: center; }
#assistant-view .manage-status.cell-pending { color: var(--amber); }
#assistant-view .manage-status.cell-expired { color: var(--danger); }
#assistant-view .manage-time { font-size: 12px !important; }
#assistant-view .manage-actions :is(.manage-cards,.manage-topup) { grid-column: auto; }
#assistant-view .manage-field .reveal-button { color: var(--wine); }

body[data-route=gpt] :is(.quota-shortcuts button, .stepper button) { min-height: 44px; }
body[data-route=gpt] .stepper { grid-template-columns: 44px minmax(0, 1fr) 44px; }
#quota-switch-dialog .quota-switch-options { border: 1px solid var(--rule); border-radius: 12px; padding: 4px 12px; }
#quota-switch-dialog .quota-switch-options legend { padding-inline: 6px; }
#quota-switch-dialog .quota-switch-options label:has(input[type=radio]) {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  min-height: 44px;
  cursor: pointer;
}
@container app (max-width: 349px) {
  #assistant-view .gpt-banner-art { width: 39%; height: 68px; }
  #assistant-view .device-slot { padding-inline: 7px; }
  #assistant-view .deck-peek { grid-template-columns: minmax(0, 1fr) auto 13px; }
  #assistant-view .deck-peek .account-mark { display: none; }
  #assistant-view .deck-peek .peek-name { grid-column: 1; }
  #assistant-view .deck-peek .peek-badges { grid-column: 2; }
  #assistant-view .deck-peek .deck-chevron { grid-column: 3; }
  #assistant-view .deck-peek .peek-metrics { grid-column: 1 / 3; }
  #assistant-view .deck-peek .reset-meter { inset-inline: 8px 23px; }
}
@media (max-height: 450px) {
  #assistant-view .gpt-banner { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
  #assistant-view .gpt-banner .work-title { margin: 0; font-size: 25px; }
  #assistant-view .gpt-banner-art { display: none; }
}
