/* Adsmith console. Builds on adsmith.css tokens. */
body.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* Sidebar */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px; background: var(--bg-2); border-right: 1.5px solid var(--ink); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; }
.side-brand span { font-family: var(--font-display); font-weight: 700; font-size: 25px; line-height: 1; letter-spacing: -.02em; }
.side-org { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; }
.side-org .muted { font-size: 12px; font-weight: 400; }
.org-dot { width: 34px; height: 34px; flex: none; border-radius: 4px; display: grid; place-items: center; background: #7C1D2E; color: #FAF3E6; font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 19px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 4px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
@media (hover: hover) and (pointer: fine) { .side-nav a:hover { background: rgba(23, 20, 15, .06); } }
.side-nav a[aria-current='page'] { background: var(--ink); color: var(--bg); }
.side-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 3px; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; font-weight: 700; }
.side-foot { margin-top: auto; padding: 0 8px; color: var(--muted); }

/* Main */
.main { min-width: 0; padding: 0 clamp(16px, 3vw, 36px) 40px; }
.demo-bar { margin: 0 calc(-1 * clamp(16px, 3vw, 36px)) 20px; padding: 8px clamp(16px, 3vw, 36px); background: var(--butter); border-bottom: 1.5px solid var(--ink); font-size: 13px; color: var(--ink); }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.top-kicker { font-size: 12px; color: var(--accent-deep); letter-spacing: .06em; }
.top-title { font-family: var(--font-display); font-weight: 500; font-size: 46px; line-height: 1.05; letter-spacing: -.025em; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.top-actions[hidden] { display: none; }
.view[data-entering] { animation: viewIn 360ms var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* Batch progress */
.progress-strip { display: grid; gap: 10px; margin-bottom: 18px; }
.ps-bar { display: flex; height: 10px; gap: 2px; border-radius: 2px; overflow: hidden; }
.ps-bar i { height: 100%; transition: flex-grow 500ms var(--ease-in-out); }
.ps-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.ps-legend li { display: flex; align-items: center; gap: 7px; }
.ps-legend i { width: 10px; height: 10px; border-radius: 2px; }
.ps-legend b { font-weight: 700; }
.c-approved { background: var(--leaf); }
.c-waiting { background: var(--marigold); }
.c-changes { background: var(--accent); }
.c-rejected { background: #9E968A; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 12px 0; border-block: 1px solid var(--line-2); margin-bottom: 12px; }
.fgroup { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 11px; border-radius: 3px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.chip:active { transform: scale(.97); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--ink); } }
.fselect { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.fselect select { height: 32px; padding: 0 28px 0 10px; border-radius: 3px; border: 1px solid var(--line-2); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='m1 1 4 4 4-4' stroke='%2317140F' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") right 10px center no-repeat; appearance: none; -webkit-appearance: none; font-size: 13px; font-weight: 600; color: var(--ink); }
.result-line { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ccard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; transition: opacity var(--t-ui) ease, border-color var(--t-ui) ease; }
.ccard[data-status='approved'] { border-color: var(--leaf); box-shadow: inset 0 3px 0 var(--leaf); }
.ccard[data-status='changes'] { box-shadow: inset 0 3px 0 var(--accent); }
.ccard[data-status='rejected'] .pv { opacity: .45; }
.pv { position: relative; aspect-ratio: 1 / 1.08; background: var(--bg-2); display: flex; align-items: center; justify-content: center; padding: 0; border-bottom: 1px solid var(--line); transition: opacity var(--t-ui) ease; }
.pv .cr { height: 86%; display: flex; }
.pv .cr-art, .dr-preview .cr-art { height: 100%; width: auto; }
@media (hover: hover) and (pointer: fine) { .pv:hover .cr-art { transform: translateY(-3px); } }
.pv .cr-art { transition: transform var(--t-ui) var(--ease-out); }
.pv-id { position: absolute; left: 8px; top: 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.cbody { padding: 12px; display: grid; gap: 8px; }
.cbody h3 { font-size: 14px; font-weight: 700; line-height: 1.3; }
.ctags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tag { height: 20px; padding: 0 6px; border-radius: 3px; border: 1px solid var(--line-2); font-family: var(--font-mono); font-size: 10.5px; display: inline-flex; align-items: center; color: var(--ink-2); }
.status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 3px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-waiting { background: var(--butter); color: var(--butter-ink); }
.st-approved { background: var(--leaf-soft); color: var(--leaf); }
.st-changes { background: var(--accent-soft); color: var(--accent-deep); }
.st-rejected { background: #ECE8E1; color: #5C554B; }
.cnote { font-size: 12.5px; color: var(--accent-deep); line-height: 1.35; }
.cact { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-top: auto; padding: 0 12px 12px; }
.act { height: 34px; border-radius: 3px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.act:active { transform: scale(.97); }
.act[aria-pressed='true'].a-approve { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.act[aria-pressed='true'].a-change { background: var(--accent); border-color: var(--accent); color: #fff; }
.act[aria-pressed='true'].a-reject { background: var(--ink); border-color: var(--ink); color: var(--bg); }
@media (hover: hover) and (pointer: fine) { .act:hover { border-color: var(--ink); } }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Boxes */
.box { padding: 20px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line-2); min-width: 0; }
.box-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.box-head h3 { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -.015em; }

/* Kit */
.kit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.span-2 { grid-column: span 2; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.swatch { border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.swatch i { display: block; height: 76px; }
.swatch div { padding: 8px 9px; font-size: 12.5px; }
.swatch b { display: block; font-weight: 700; }
.swatch span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.logos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.logo-tile { height: 96px; border-radius: 3px; display: grid; place-items: center; align-content: center; gap: 4px; border: 1px solid var(--line); }
.logo-tile span { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 26px; line-height: 1; }
.logo-tile small { font-size: 11px; opacity: .8; }
.fonts { display: grid; gap: 10px; }
.fonts li { display: flex; align-items: center; gap: 12px; }
.f-sample { width: 44px; height: 44px; border-radius: 3px; background: var(--bg-2); display: grid; place-items: center; font-size: 24px; line-height: 1; }
.fonts b { display: block; font-size: 14px; }
.fonts div span { font-size: 12.5px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { height: 30px; padding: 0 11px; border-radius: 3px; background: var(--bg-2); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.chips-ban li { background: var(--surface); border: 1px solid var(--line-2); padding-right: 4px; }
.chips-ban li span { text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.chips-ban li[data-new] { animation: chipIn 320ms var(--ease-out); }
@keyframes chipIn { from { opacity: 0; transform: translateY(4px); } }
.chip-x { width: 22px; height: 22px; border-radius: 3px; display: grid; place-items: center; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .chip-x:hover { background: var(--bg-2); color: var(--ink); } }
.add-word { display: flex; gap: 6px; margin-top: 12px; }
.add-word input, .change-form textarea { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 3px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; }
.add-word input:focus, .change-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.claims { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.claims li { padding: 10px 12px; border-radius: 3px; border-left: 3px solid var(--leaf); background: var(--bg); }
.claims b { display: block; font-size: 14px; }
.claims span { font-size: 12.5px; color: var(--muted); }
.rules-list { display: grid; gap: 8px; }
.rules-list li { position: relative; padding-left: 22px; font-size: 14px; }
.rules-list li::before { content: ''; position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--accent); background: linear-gradient(45deg, transparent 45%, var(--accent) 45% 58%, transparent 58%); }

/* Products */
.prod-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; }
.pcard-img { height: 190px; display: grid; place-items: center; padding: 14px; }
.pcard-img svg { height: 100%; width: auto; filter: drop-shadow(0 10px 10px rgba(23, 20, 15, .18)); }
.pcard-body { padding: 14px; display: grid; gap: 6px; flex: 1; }
.pcard-body h3 { font-size: 16px; }
.pcard-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.pcard-row b { color: var(--ink); font-weight: 700; }
.pcard .btn { margin: 0 14px 14px; }

/* Angles */
.sample-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 14px; border-radius: 4px; border: 1.5px dashed var(--ink); background: repeating-linear-gradient(135deg, var(--butter) 0 12px, #FDF2CC 12px 24px); font-size: 14px; }
.sample-banner div { max-width: 70ch; }
.sample-tag { display: inline-block; padding: 1px 6px; border-radius: 3px; background: var(--butter); color: var(--butter-ink); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; vertical-align: 1px; }
.ang-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.acard { padding: 16px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface); display: grid; gap: 6px; }
.acard b { font-family: var(--font-display); font-size: 44px; font-weight: 500; line-height: 1; }
.acard p { font-size: 13px; color: var(--muted); }
.view[data-view='angles'] > .box { margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
.atable { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.atable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.atable td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.atable .num { text-align: right; font-family: var(--font-mono); font-size: 13px; }
.sbar { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.sbar i { display: block; height: 12px; min-width: 4px; border-radius: 2px; background: repeating-linear-gradient(135deg, #CFC7B9 0 4px, #E4DDD1 4px 8px); }
.lang-bars { display: grid; gap: 10px; }
.lrow { display: grid; grid-template-columns: 80px 1fr 40px; gap: 12px; align-items: center; font-size: 14px; }
.lrow .track { height: 14px; background: var(--bg-2); border-radius: 2px; overflow: hidden; }
.lrow .track i { display: block; height: 100%; background: var(--ink); transform-origin: left; transition: transform 700ms var(--ease-out); }
.lrow b { font-family: var(--font-mono); font-size: 13px; text-align: right; }

.demo-note { margin-top: 28px; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; text-align: center; font-size: 12px; color: var(--muted); }

/* Drawer */
.drawer-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(23, 20, 15, .36); opacity: 0; transition: opacity 280ms ease; }
.drawer-scrim[data-open] { opacity: 1; }
.drawer { position: fixed; z-index: 90; top: 0; right: 0; bottom: 0; width: min(540px, 100%); display: flex; flex-direction: column; background: var(--bg); border-left: 1.5px solid var(--ink); transform: translateX(100%); transition: transform 420ms var(--ease-drawer); visibility: hidden; }
.drawer[data-open] { transform: none; visibility: visible; }
.drawer:not([data-open]) { transition: transform 260ms var(--ease-out), visibility 0s 260ms; }
.dr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.dr-title { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.15; letter-spacing: -.015em; }
.icon-btn { width: 36px; height: 36px; flex: none; border-radius: 4px; display: grid; place-items: center; color: var(--ink-2); transition: background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.icon-btn:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--bg-2); } }
.dr-body { flex: 1; overflow: auto; padding: 18px 20px; display: grid; gap: 20px; align-content: start; }
.size-tabs { display: flex; gap: 4px; }
.size-tabs button { flex: 1; height: 34px; border-radius: 3px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 600; transition: background-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.size-tabs button:active { transform: scale(.97); }
.size-tabs button[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dr-preview { height: 380px; display: flex; align-items: center; justify-content: center; background: var(--bg-2); border-radius: 4px; padding: 16px; }
.dr-preview .cr { height: 100%; display: flex; flex-direction: column; align-items: center; }
.dr-preview .cr-art { flex: 1; min-height: 0; }
.dr-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.dr-h { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.copy-list { display: grid; gap: 8px; margin: 0; }
.copy-list div { padding: 10px 12px; border-radius: 3px; background: var(--surface); border: 1px solid var(--line); }
.copy-list dt { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.copy-list dd { margin: 2px 0 0; font-size: 15px; }
.copy-list dd small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; font-family: var(--font-ui); }
.dr-note { padding: 10px 12px; border-radius: 3px; background: var(--accent-soft); color: var(--accent-deep); font-size: 13.5px; margin-bottom: 10px; }
.change-form { display: grid; gap: 8px; justify-items: start; }
.change-form textarea { width: 100%; height: auto; padding: 10px 12px; resize: vertical; font-family: var(--font-ui); line-height: 1.4; }
.dr-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.btn-approve { background: var(--leaf); color: #fff; }
@media (hover: hover) and (pointer: fine) { .btn-approve:hover { background: #0A5840; } }

/* Responsive */
@media (max-width: 1180px) {
  .kit-grid { grid-template-columns: 1fr 1fr; }
  .ang-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  body.app { grid-template-columns: 1fr; padding-bottom: 76px; }
  .side { position: fixed; z-index: 60; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1.5px solid var(--ink); background: var(--bg); }
  .side-brand, .side-org, .side-foot { display: none; }
  .side-nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .side-nav a { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 11.5px; }
  .side-badge { position: absolute; top: 2px; right: calc(50% - 24px); min-width: 18px; height: 16px; font-size: 10px; }
  .swatches { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .top-title { font-size: 34px; }
  .top-actions { width: 100%; }
  .top-actions .btn { flex: 1; padding: 0 10px; }
  .kit-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cbody { padding: 10px; }
  .cact { padding: 0 10px 10px; grid-template-columns: 1fr 1fr 1fr; }
  .act { font-size: 11.5px; }
  .act svg { display: none; }
  .filters { gap: 8px 12px; }
  .ang-grid { grid-template-columns: 1fr 1fr; }
  .acard b { font-size: 34px; }
  .dr-preview { height: 300px; }
  .toasts { left: 12px; right: 12px; bottom: 84px; }
  .toast { min-width: 0; max-width: none; }
}
@media (max-width: 380px) {
  .cards { grid-template-columns: 1fr; }
}
