/* Page-specific layout (grids and containers; the cards themselves are components). */

/* MyDecks — brand chips */
.brands-row { margin-bottom: 1.75rem; }
.brand-chips { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.brand-chip { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); font-size: 0.875rem; color: var(--halo); transition: border-color 0.15s ease; }
.brand-chip:hover { border-color: rgba(22, 255, 101, 0.5); }
.brand-chip-swatch { width: 0.85rem; height: 0.85rem; border-radius: 0.25rem; border: 1px solid rgba(255,255,255,0.15); }
.brand-chip-add { border-style: dashed; color: var(--tide); }
.brand-chip-add:hover { color: var(--halo); }

/* MyDecks — deck list (compact rows) */
.deck-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem; }
@media (max-width: 640px) { .deck-list { grid-template-columns: minmax(0, 1fr); } }
.deck-list > li { min-width: 0; }
.deck-row { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); transition: border-color 0.15s ease; min-width: 0; }
.deck-row:hover { border-color: rgba(22, 255, 101, 0.5); }
.deck-row-main { min-width: 0; flex: 1; }
.stretched-link::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.deck-row-text { display: flex; flex-direction: column; min-width: 0; }
.deck-row-title { font-weight: 500; color: var(--halo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-row-date { font-size: 0.75rem; color: var(--tide); font-variant-numeric: tabular-nums; }
.deck-row-status { position: relative; z-index: 1; flex: none; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tide); }
.deck-row-status.status-done { color: var(--surge); }
.deck-row-status.status-generating { color: var(--arc); }
.deck-row-status.status-failed { color: var(--danger); }
.deck-row-status.status-draft { color: var(--tide); }
.deck-delete-form { position: relative; z-index: 1; margin: 0; }
.deck-delete { border: none; background: none; color: var(--tide); cursor: pointer; font-size: 0.9rem; line-height: 1; padding: 0.25rem; transition: color 0.15s ease; }
.deck-delete:hover { color: var(--danger); }

/* Wizard (create form) */
/* create-wizard column: title + form centered at max-w-2xl (672px), matching the original */
.wizard-narrow { max-width: 42rem; margin: 0 auto; }
.form-card { max-width: 42rem; padding: 1.75rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.form-grid.one-col { grid-template-columns: 1fr; }
.form-field { display: block; }
.form-field.col-span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.form-hint { color: var(--tide); font-size: 0.85rem; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* brand-source line under the company field on the create wizard */
.brand-line { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; font-size: 0.85rem; color: var(--tide); }
.brand-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; display: inline-block; border: 1px solid var(--line); }
.brand-line select { background: transparent; border: none; border-bottom: 1px dashed var(--line); color: var(--halo); font-family: inherit; font-size: 0.85rem; padding: 0 0.15rem; cursor: pointer; color-scheme: dark; }
.brand-line select:focus { outline: none; border-bottom-color: var(--surge); }
/* Popup must stay readable: the transparent select otherwise renders white-on-white options in Chrome/Windows. */
.brand-line select option { background: var(--panel); color: var(--halo); }
.brand-line a { color: var(--surge); }

/* StorylineReview */
.review-title-field { max-width: 640px; margin-bottom: 1.5rem; }
.slide-list { display: flex; flex-direction: column; gap: 0.85rem; }
.review-actions { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 1rem; margin-top: 1.75rem; padding: 1rem 0; background: linear-gradient(180deg, transparent, var(--ink) 30%); }

/* Brands list */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.85rem; max-width: 780px; }
.brand-card { display: flex; flex-direction: column; gap: 0.4rem; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); transition: border-color 0.15s ease, transform 0.15s ease; }
.brand-card:hover { border-color: rgba(22, 255, 101, 0.45); transform: translateY(-2px); }
.brand-swatch { width: 1rem; height: 1rem; border-radius: 0.3rem; border: 1px solid rgba(255, 255, 255, 0.15); }
.brand-card-name { font-weight: 600; color: var(--halo); }
.brand-card-master { font-size: 0.75rem; color: var(--tide); }
.new-brand-card { align-items: center; justify-content: center; min-height: 6rem; border-style: dashed; color: var(--tide); font-size: 0.9rem; }
.new-brand-card:hover { color: var(--halo); transform: none; }

/* Brand editor */
.welcome-banner { margin-bottom: 1.5rem; padding: 1.1rem 1.25rem; border-radius: var(--radius); border: 1px solid rgba(22, 255, 101, 0.25); background: rgba(22, 255, 101, 0.05); }
.welcome-banner .tag { color: var(--surge); }
.welcome-banner h2 { margin-top: 0.3rem; font-size: 1.25rem; font-weight: 700; }
.welcome-banner p { margin-top: 0.35rem; color: var(--foge); font-size: 0.9rem; }

/* Step rail — pills that light up as you advance the wizard. */
.step-rail { display: flex; align-items: center; gap: 0.5rem; list-style: none; margin: 0.75rem 0 1.75rem; padding: 0; flex-wrap: wrap; }
.step-rail li { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.85rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--tide); font-size: 0.8rem; }
.step-rail .step-n { font-weight: 700; }
.step-rail li.active { background: var(--charge); border-color: transparent; color: #0b0d0e; font-weight: 600; }
.step-rail li.done { background: rgba(22, 255, 101, 0.14); border-color: rgba(22, 255, 101, 0.4); color: var(--surge); }
.step-sep { display: none; }

.editor { max-width: 640px; }
.editor-section { padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); margin-bottom: 1rem; scroll-margin-top: 5rem; }
.editor-section h3 { font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: 0.6rem; }
.editor-section .section-sub { color: var(--tide); font-size: 0.85rem; margin-top: 0.2rem; margin-bottom: 1rem; }
.color-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.color-field { display: flex; flex-direction: column; gap: 0.35rem; }
.color-field input[type="color"] { width: 3rem; height: 2.2rem; padding: 0; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--panel); cursor: pointer; }
.coming-soon { color: var(--tide); font-size: 0.9rem; }
.mb-0 { margin-bottom: 0; }

/* Brand editor — async controls */
.import-box { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1rem; margin-bottom: 1.25rem; }
.import-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.import-head .lbl { margin-bottom: 0; }
.import-hint { color: var(--tide); font-weight: 400; font-size: 0.8rem; }
.field-file { padding: 0.5rem; font-size: 0.85rem; }
.field-file::file-selector-button { margin-right: 0.75rem; border: 1px solid var(--line); background: var(--panel-2); color: var(--halo); border-radius: 0.5rem; padding: 0.3rem 0.7rem; font-family: inherit; font-size: 0.8rem; cursor: pointer; }
.import-busy, .import-done, .import-err { font-size: 0.85rem; margin-top: 0.5rem; }
.import-busy { color: var(--tide); }
.import-done { color: var(--surge); }

/* PPTX extraction review (ports Slide-Creator's PptxExtractionReview) */
.pptx-review { margin-top: 0.75rem; padding: 0.75rem; border-radius: var(--radius-sm); border: 1px solid rgba(22, 255, 101, 0.3); background: rgba(22, 255, 101, 0.05); display: flex; flex-direction: column; gap: 0.75rem; }
.pr-title { font-size: 0.75rem; font-weight: 600; color: var(--surge); }
.pr-stats { margin-top: 0.125rem; font-size: 0.75rem; color: var(--tide); }
.pr-sec-label { margin-bottom: 0.4rem; font-size: 0.75rem; color: var(--tide); }
.pr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.pr-row-wide { gap: 0.25rem 1rem; }
.pr-color, .pr-typo { display: inline-flex; align-items: center; gap: 0.25rem; }
.pr-swatch { display: inline-block; width: 1rem; height: 1rem; border-radius: 0.25rem; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); flex: none; }
.pr-swatch-sm { width: 0.875rem; height: 0.875rem; }
.pr-swatch-xs { width: 0.75rem; height: 0.75rem; border-radius: 0.125rem; }
.pr-mono { font-family: ui-monospace, monospace; font-size: 0.625rem; color: var(--tide); }
.pr-dim { font-size: 0.625rem; color: var(--tide); opacity: 0.65; }
.pr-typo-lbl { width: 1.75rem; }
.pr-typo-size { font-size: 0.625rem; color: var(--halo); }
.pr-typo-bold { font-size: 0.625rem; font-weight: 700; color: var(--halo); }
.pr-chip { border-radius: 0.25rem; background: var(--line); padding: 0.125rem 0.5rem; font-size: 0.75rem; color: var(--halo); }
.pr-zone-wrap { position: relative; height: 1.5rem; width: 100%; max-width: 180px; border-radius: 0.25rem; border: 1px solid var(--line); background: rgba(43, 47, 49, 0.4); }
.pr-zone-box { position: absolute; border-radius: 0.25rem; background: rgba(22, 255, 101, 0.2); box-shadow: inset 0 0 0 1px rgba(22, 255, 101, 0.4); }
.pr-zone-nums { margin-top: 0.125rem; }
.pr-rows { display: flex; flex-direction: column; gap: 0.25rem; }
.pr-deco-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.625rem; }
.pr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.pr-tile { display: block; width: 100%; padding: 0; border: none; background: none; cursor: pointer; border-radius: 0.25rem; }
.pr-wire { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 0.25rem; }
.pr-tile:hover .pr-wire { outline: 1px solid var(--line); }
.pr-tile.selected .pr-wire { outline: 2px solid var(--surge); }
.pr-tile-name { margin-top: 0.125rem; font-size: 0.625rem; color: var(--tide); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-source-dot { color: #fbbf24; }
.pr-detail { margin-top: 0.5rem; padding: 0.75rem; border-radius: 0.5rem; border: 1px solid var(--line); background: var(--ink); display: flex; flex-direction: column; gap: 0.75rem; text-align: left; }
.pr-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.pr-detail-name { font-size: 0.75rem; font-weight: 600; color: var(--halo); }
.pr-detail-sub { font-size: 0.625rem; color: var(--tide); }
.pr-close { border: none; background: none; color: var(--tide); cursor: pointer; font-size: 0.75rem; line-height: 1; padding: 0 0.25rem; }
.pr-close:hover { color: var(--halo); }
.pr-sublabel { margin-bottom: 0.4rem; font-size: 0.625rem; font-weight: 600; color: var(--tide); text-transform: uppercase; letter-spacing: 0.05em; }
.pr-ph-row { display: flex; align-items: center; gap: 0.5rem; border-radius: 0.25rem; padding: 0.25rem 0.5rem; font-size: 0.625rem; background: rgba(43, 47, 49, 0.4); }
.pr-ph-row.source { background: rgba(245, 158, 11, 0.10); box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.2); }
.pr-pos { margin-left: auto; flex: none; color: var(--tide); }
.pr-badge { border-radius: 0.25rem; padding: 0.125rem 0.375rem; font-size: 9px; font-weight: 500; }
.pr-deco-text { color: var(--tide); opacity: 0.7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100px; }
.pr-skipped { margin-top: 0.25rem; font-size: 9px; color: var(--tide); opacity: 0.5; }
.asset-state { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.4rem; }
.asset-status-line, .asset-stored { font-size: 0.8rem; }
.asset-preview-img { max-height: 6rem; border-radius: 0.5rem; border: 1px solid var(--line); }
.asset-warn { font-size: 0.85rem; margin-top: 0.5rem; }
.preview-err { font-size: 0.85rem; margin-top: 0.5rem; }
.preview-img { margin-top: 0.75rem; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.badge-soon { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; padding: 0.15rem 0.5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--tide); }
.editor-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.editor-actions .spacer { flex: 1; }
.editor-actions .brand-delete-form { margin: 0; }
.saved-flag { font-size: 0.85rem; }
.import-box-soon .field-file { opacity: 0.5; cursor: not-allowed; }
.brand-save-err { margin-bottom: 0.75rem; }
.btn-danger { border: 1px solid rgba(255, 107, 107, 0.4); color: var(--danger); background: transparent; border-radius: var(--radius-sm); padding: 0.5rem 1rem; font-family: inherit; font-size: 0.9rem; cursor: pointer; transition: background 0.15s ease; }
.btn-danger:hover { background: rgba(255, 107, 107, 0.08); }

/* Generation workspace */
.gen-title { max-width: 46rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-head-actions { display: flex; align-items: center; gap: 1rem; }
.gen-export-note, .gen-master-badge, .gen-master-warn { font-size: 0.78rem; line-height: 1.5; margin-bottom: 0.75rem; }
.gen-export-note { color: var(--tide); max-width: 44rem; }
.gen-master-badge { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--surge); background: rgba(22, 255, 101, 0.1); border-radius: 999px; padding: 0.25rem 0.75rem; }
.gen-master-warn { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--danger); background: rgba(255, 107, 107, 0.1); border-radius: 999px; padding: 0.25rem 0.75rem; }
.gen-export-warn { font-size: 0.78rem; line-height: 1.5; margin-bottom: 0.75rem; color: var(--danger); background: rgba(255, 107, 107, 0.1); border-radius: 8px; padding: 0.5rem 0.75rem; max-width: 44rem; }

.gen-progress { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.gen-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.gen-bar-fill { height: 100%; width: 0; background: var(--charge); transition: width 0.4s ease; }
.gen-progress-text { font-size: 0.85rem; color: var(--tide); white-space: nowrap; font-variant-numeric: tabular-nums; }

.gen-layout { display: grid; grid-template-columns: 120px 1fr 320px; gap: 1rem; align-items: start; }
@media (max-width: 960px) { .gen-layout { grid-template-columns: 1fr; } }

.filmstrip { display: flex; flex-direction: column; gap: 0.5rem; max-height: 72vh; overflow-y: auto; padding-right: 0.25rem; }
@media (max-width: 960px) { .filmstrip { flex-direction: row; overflow-x: auto; max-height: none; } }
.slide-thumb { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.5rem 0.6rem; border-radius: 0.7rem; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; min-width: 110px; transition: border-color 0.15s ease; font-family: inherit; }
.slide-thumb:hover { border-color: rgba(115, 149, 152, 0.4); }
.slide-thumb.selected { border-color: var(--surge); box-shadow: 0 0 0 1px var(--surge); }
.thumb-top { display: flex; align-items: center; justify-content: space-between; }
.thumb-num { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 0.35rem; background: var(--charge); color: #0b0d0e; font-size: 0.65rem; font-weight: 700; }
.thumb-title { font-size: 0.65rem; color: var(--tide); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thumb-status { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--tide); }
.thumb-status.status-done { background: var(--surge); }
.thumb-status.status-generating { background: var(--arc); animation: pulse 1s ease-in-out infinite; }
.thumb-status.status-idle { background: var(--tide); animation: pulse 1s ease-in-out infinite; }
.thumb-status.status-error { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.slide-stage { min-width: 0; }
.slide-stage-title { margin-bottom: 0.6rem; font-size: 0.9rem; font-weight: 500; color: var(--halo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slide-preview { position: relative; }
.slide-canvas { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); border: 1px solid var(--line); background: #15181a; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.slide-canvas .slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0b0d0e; }
.slide-shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, #15181a 30%, rgba(255,255,255,0.06) 50%, #15181a 70%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.slide-render-badge { position: absolute; bottom: 0.5rem; left: 0.5rem; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.6rem; border-radius: 999px; background: rgba(18,20,23,0.7); backdrop-filter: blur(6px); color: var(--surge); font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.render-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--surge); animation: pulse 1s ease-in-out infinite; }
.slide-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; text-align: center; padding: 1rem; }
.slide-error-title { font-size: 0.8rem; font-weight: 600; color: var(--danger); }
.slide-error-detail { font-size: 0.7rem; color: var(--tide); }
.slide-imgfail { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; text-align: center; font-size: 0.72rem; color: var(--tide); }
.slide-imgfail-retry { border: none; background: none; cursor: pointer; color: var(--surge); font-family: inherit; font-size: 0.72rem; }

.slide-version-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.6rem; font-size: 0.78rem; color: var(--tide); }
.version-nav { display: flex; align-items: center; gap: 0.4rem; }
.version-btn { border: none; background: none; cursor: pointer; color: var(--tide); font-family: inherit; font-size: 1rem; line-height: 1; padding: 0 0.25rem; }
.version-btn:hover:not(:disabled) { color: var(--halo); }
.version-btn:disabled { opacity: 0.3; cursor: default; }
.version-label { font-variant-numeric: tabular-nums; }
.revert-link { border: none; background: none; cursor: pointer; color: var(--surge); font-family: inherit; font-size: 0.78rem; }
.revert-link:hover { text-decoration: underline; }
.slide-version-instruction { margin-top: 0.35rem; font-size: 0.72rem; font-style: italic; color: var(--tide); }

.slide-stage-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.85rem; }
.slide-outline { margin-top: 1rem; }
.slide-outline > summary { cursor: pointer; list-style: none; font-size: 0.7rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tide); }
.slide-outline > summary:hover { color: var(--halo); }
.slide-outline > summary::-webkit-details-marker { display: none; }
.slide-outline-list { margin: 0.6rem 0 0; padding-left: 1.1rem; color: var(--foge); font-size: 0.85rem; }
.slide-outline-list li { margin: 0.25rem 0; }

/* Refine chat */
.refine-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; max-height: 78vh; }
.refine-title { font-size: 0.9rem; font-weight: 600; }
.chat-thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; min-height: 8rem; }
.chat-empty { font-size: 0.78rem; line-height: 1.5; color: var(--tide); }
.chat-msg { display: flex; flex-direction: column; }
.chat-msg.user { align-items: flex-end; }
.chat-msg.assistant { align-items: flex-start; }
.chat-msg-label { margin-bottom: 0.15rem; }
.chat-bubble { max-width: 85%; padding: 0.5rem 0.75rem; border-radius: 1rem; font-size: 0.82rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.chat-msg.user .chat-bubble { background: var(--charge); color: #0b0d0e; border-bottom-right-radius: 0.25rem; }
.chat-msg.assistant .chat-bubble { background: var(--panel-2); border: 1px solid var(--line); color: var(--halo); border-bottom-left-radius: 0.25rem; }
.chat-busy { font-size: 0.75rem; color: var(--surge); }
.chat-versions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; border-top: 1px solid var(--line); padding-top: 0.5rem; font-size: 0.72rem; color: var(--tide); }
.chat-version-current { font-variant-numeric: tabular-nums; }
.revert-chip { border: none; background: none; cursor: pointer; color: var(--surge); font-family: inherit; font-size: 0.72rem; padding: 0 0.15rem; }
.revert-chip:hover { text-decoration: underline; }
.chat-input { display: flex; flex-direction: column; gap: 0.5rem; }
.refine-input { resize: vertical; font-size: 0.85rem; }
.chat-input-row { display: flex; gap: 0.5rem; }
.chat-send { flex: 1; }
.chat-attach { display: inline-flex; align-items: center; justify-content: center; }
.chat-attachments { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chat-attachment { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 0.2rem 0.4rem; font-size: 0.72rem; color: var(--tide); }
.chat-attachment img { width: 1.75rem; height: 1.75rem; border-radius: 4px; object-fit: cover; }
.chat-attachment-name { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attachment-remove { border: 0; background: transparent; color: var(--tide); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.15rem; }
.chat-attachment-remove:hover { color: var(--halo); }
.chat-file-error { font-size: 0.72rem; color: var(--danger); }

/* Products — landing section + signed-in home (component: _ProductCards) */
html { scroll-behavior: smooth; }
.products { padding: 2rem 0 6rem; }
.products-title { margin: 0.5rem 0 1.75rem; font-size: 1.875rem; font-weight: 700; letter-spacing: -0.02em; }
.product-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1rem; max-width: 56rem; }
.product-card {
    height: 100%; display: flex; flex-direction: column; gap: 0.75rem; padding: 1.5rem;
    border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.product-card:hover { border-color: rgba(22, 255, 101, 0.45); transform: translateY(-2px); }
.product-icon { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 0.8rem; color: #0b0d0e; background: var(--charge); }
.product-icon svg { width: 1.4rem; height: 1.4rem; }
.product-name { margin-top: 0.25rem; font-size: 1.25rem; font-weight: 600; color: var(--halo); }
.product-desc { color: var(--foge); font-size: 0.95rem; line-height: 1.6; }
.product-go { margin-top: auto; padding-top: 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--surge); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .product-card:hover { transform: none; } }

/* SignIn */
.auth-wrap { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 4rem 1.5rem; }
.auth-panel { width: 100%; max-width: 24rem; }
.auth-title { margin-top: 2rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.auth-sub { margin-top: 0.35rem; font-size: 0.875rem; color: var(--tide); }
.auth-card { margin-top: 1.5rem; padding: 1.25rem; }
.auth-or { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--tide); }
.auth-or span { flex: 1; height: 1px; background: var(--line); }
.auth-fields { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-msg { margin-top: 1rem; font-size: 0.875rem; }
.auth-foot { margin-top: 1rem; text-align: center; font-size: 0.75rem; color: var(--tide); }
.text-ok { color: var(--surge); }
.text-err { color: var(--danger); }

/* Intake chat */
.intake-form-link { color: var(--tide); font-size: 0.85rem; align-self: flex-end; }
.intake-form-link:hover { color: var(--halo); text-decoration: underline; text-underline-offset: 2px; }
.link-muted { border: none; background: none; cursor: pointer; color: var(--tide); font-family: inherit; font-size: 0.85rem; }
.link-muted:hover { color: var(--halo); text-decoration: underline; text-underline-offset: 2px; }

.brand-picker { margin-top: 1.5rem; }
.brand-picker-title { font-size: 1.25rem; font-weight: 600; }
.brand-picker-grid { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.85rem; max-width: 760px; }
.brand-pick { display: flex; flex-direction: column; gap: 0.3rem; width: 100%; padding: 1rem; text-align: left; cursor: pointer; font-family: inherit; transition: border-color 0.15s ease, transform 0.15s ease; }
.brand-pick:hover { border-color: rgba(22, 255, 101, 0.5); transform: translateY(-2px); }
.brand-pick-swatch { width: 1rem; height: 1rem; border-radius: 0.3rem; border: 1px solid rgba(255,255,255,0.15); }
.brand-pick-name { font-weight: 600; color: var(--halo); }
.brand-pick-meta { font-size: 0.75rem; color: var(--tide); }
.brand-pick-new { display: flex; align-items: center; justify-content: center; min-height: 6rem; border-style: dashed; color: var(--tide); }
.brand-pick-new:hover { color: var(--halo); }

.intake-brand-row { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.intake-brand-chip { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.75rem; font-size: 0.85rem; }

.intake-grid { margin-top: 1.5rem; display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: stretch; }
@media (max-width: 900px) { .intake-grid { grid-template-columns: 1fr; } }

.intake-pane { display: flex; flex-direction: column; min-height: 28rem; padding: 1.25rem; }
.intake-thread { flex: 1; display: flex; flex-direction: column; gap: 0.6rem; overflow-y: auto; max-height: 60vh; }
.chat-emptystate { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem 1rem; }
.chat-avatar-lg { width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--charge); margin-bottom: 1rem; }
.chat-opener { max-width: 28rem; font-size: 1rem; font-weight: 500; line-height: 1.5; color: var(--halo); }
.chat-empty-sub { margin-top: 0.5rem; font-size: 0.85rem; color: var(--tide); }
.chat-chips { margin-top: 1.25rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }

.chat-att-img { display: block; margin-top: 0.4rem; max-width: 100%; border-radius: 0.5rem; }
.chat-att-doc { display: block; margin-top: 0.25rem; font-size: 0.75rem; opacity: 0.75; }

.intake-composer { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.intake-attachments { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.att-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.5rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--panel-2); font-size: 0.75rem; }
.att-chip img { width: 1.75rem; height: 1.75rem; border-radius: 0.3rem; object-fit: cover; }
.att-name { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tide); }
.att-remove { border: none; background: none; cursor: pointer; color: var(--tide); font-size: 1rem; line-height: 1; }
.att-remove:hover { color: var(--halo); }
.intake-file-err { font-size: 0.8rem; }
.intake-input-row { display: flex; gap: 0.5rem; }
.intake-attach { flex: none; padding: 0.5rem 0.7rem; }
.intake-text { flex: 1; }
.intake-send { flex: none; }

.typing { padding-left: 0.5rem; }
.typing-dots { display: inline-flex; gap: 0.25rem; align-items: center; }
.typing-dots span { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--surge); display: inline-block; animation: typing 1.2s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.aligned-card { border: 1px solid rgba(22, 255, 101, 0.4); background: rgba(22, 255, 101, 0.05); border-radius: var(--radius); padding: 1rem; }
.aligned-title { font-size: 0.9rem; font-weight: 600; color: var(--surge); }
.aligned-sub { margin-top: 0.25rem; font-size: 0.75rem; color: var(--tide); }
.aligned-draft { margin-top: 0.75rem; }

.brief-panel { padding: 1.25rem; height: fit-content; }
.brief-head { display: flex; align-items: center; justify-content: space-between; }
.brief-status { font-size: 0.72rem; color: var(--tide); }
.brief-fields { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.85rem; }
.brief-keys { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.brief-key-row { display: flex; align-items: center; gap: 0.5rem; }
.brief-key-remove { border: none; background: none; cursor: pointer; color: var(--tide); font-size: 1.1rem; line-height: 1; }
.brief-key-remove:hover { color: var(--halo); }
.brief-add-key { margin-top: 0.5rem; }
.brief-draft { margin-top: 1.25rem; }
.draft-err { margin-top: 0.5rem; font-size: 0.8rem; }

.drafting-inline { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 1.5rem; text-align: center; }
.drafting-stage { font-size: 0.9rem; font-weight: 500; color: var(--halo); }
.drafting-time { font-size: 0.78rem; color: var(--tide); font-variant-numeric: tabular-nums; }

/* Admin dashboard */
.admin-range { display: flex; gap: 0.35rem; }
.range-pill { padding: 0.35rem 0.75rem; border-radius: 999px; border: 1px solid var(--line); font-size: 0.8rem; color: var(--tide); }
.range-pill:hover { color: var(--halo); border-color: rgba(115,149,152,0.5); }
.range-pill.active { color: #0b0d0e; background: var(--charge); border-color: transparent; font-weight: 600; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.metric-card { padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.metric-card-accent { border-color: rgba(22, 255, 101, 0.35); background: rgba(22, 255, 101, 0.04); }
.metric-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; color: var(--halo); font-variant-numeric: tabular-nums; }
.metric-label { margin-top: 0.35rem; font-size: 0.8rem; color: var(--tide); }
