:root {
  color-scheme: light;
  --paper: #f4f4f1;
  --surface: #ffffff;
  --surface-muted: #ecece8;
  --ink: #171717;
  --ink-muted: #6f6f6a;
  --line: #d8d8d1;
  --line-strong: #b9b9b0;
  --success: #215a39;
  --warning: #76570c;
  --danger: #8c2d2d;
}
* { box-sizing: border-box; }
html { background: var(--paper); overflow-anchor: none; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.app-shell { max-width: 720px; margin: 0 auto; padding: 28px 20px 42px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 18px; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; }
.topbar-subtitle { margin-top: 6px; color: var(--ink-muted); font-size: 13px; }
h2 { max-width: 560px; margin: 0 0 20px; font-size: clamp(34px, 8vw, 62px); line-height: 1.02; letter-spacing: -0.065em; font-weight: 600; text-wrap: balance; }
h2 em { font-style: normal; color: var(--ink-muted); }
h3 { font-size: 20px; line-height: 1.2; letter-spacing: -0.03em; font-weight: 600; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--ink); border-radius: 50%; color: var(--ink); font-size: 13px; font-weight: 650; }
.hero-card { margin: 44px 0 48px; padding: 28px 0 0; border-top: 2px solid var(--ink); }
.hero-copy { max-width: 420px; color: var(--ink-muted); font-size: 15px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-kicker { margin: 0 0 8px; color: var(--ink-muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.live { color: var(--ink-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.live i, .dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--success); vertical-align: 1px; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 16px 0 48px; border: 1px solid var(--line); background: var(--line); }
.module { display: grid; min-height: 124px; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 16px; align-items: center; padding: 20px 20px; border: 0; border-radius: 0; background: var(--surface); color: var(--ink); text-align: start; cursor: pointer; transition: background .16s ease, color .16s ease; }
.reveal-target { opacity: 0; transform: translateY(10px); transition: opacity .42s ease, transform .42s cubic-bezier(.2,.8,.2,1), background .16s ease, color .16s ease; }
.reveal-target.is-visible { opacity: 1; transform: translateY(0); }
.module.reveal-target:nth-child(2) { transition-delay: 60ms; }
.module.reveal-target:nth-child(3) { transition-delay: 120ms; }
.module.reveal-target:nth-child(4) { transition-delay: 180ms; }
.module.reveal-target:nth-child(5) { transition-delay: 240ms; }
.module:hover, .module.active { background: var(--ink); color: #fff; }
.module:active { transform: scale(.99); }
.module-icon { display: grid; grid-row: 1 / span 2; place-items: center; width: 34px; height: 34px; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; font-weight: 700; }
.module h4 { grid-column: 2; grid-row: 1; margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.module p { grid-column: 2; grid-row: 2; margin: 2px 0 0; color: var(--ink-muted); font-size: 13px; }
.module:hover p, .module.active p { color: #cfcfca; }
.module .arrow { grid-column: 3; grid-row: 1 / span 2; align-self: center; margin: 0; color: var(--ink-muted); font-size: 18px; }
.module:hover .arrow { color: #fff; }
.activity-card { padding: 20px 0 0; border-top: 1px solid var(--line-strong); background: transparent; }
.compact { margin-bottom: 14px; }
.status-pill { color: var(--ink-muted); font-size: 12px; }
.status-line { display: flex; align-items: center; color: var(--ink-muted); font-size: 13px; }
.progress { height: 3px; margin: 16px 0 10px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ink); }
.footnote, footer { color: var(--ink-muted); font-size: 12px; }
footer { display: flex; justify-content: space-between; padding-top: 32px; border-top: 1px solid var(--line); margin-top: 36px; font-size: 11px; letter-spacing: .03em; }
.workspace { margin: 16px 0 34px; padding: 20px 0 0; border-top: 2px solid var(--ink); background: transparent; }
.workspace-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.workspace-head .back { flex: 0 0 auto; }
.workspace-head h3 { margin-bottom: 4px; }
.workspace-subtitle { color: var(--ink-muted); font-size: 13px; }
.form-card { display: grid; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
label { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); padding: 11px 12px; font-size: 16px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #96968f; }
.button-row { display: flex; gap: 8px; align-items: center; }
.button-row.wrap { flex-wrap: wrap; }
.action, .back, .tiny, .task-button { min-height: 40px; border: 1px solid var(--ink); border-radius: 4px; background: var(--surface); color: var(--ink); padding: 9px 13px; cursor: pointer; }
.action.primary { background: var(--ink); color: #fff; }
.action.secondary, .back { border-color: var(--line-strong); color: var(--ink); }
.tiny { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.tiny.selected { background: var(--ink); color: #fff; }
.tiny:disabled, .action:disabled { cursor: not-allowed; opacity: .45; }
.notice, .muted-text, .footnote { color: var(--ink-muted); font-size: 13px; white-space: pre-line; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--line); }
.stats-grid div { padding: 13px; background: var(--surface); }
.stats-grid b, .stats-grid span { display: block; }
.stats-grid b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-grid span { color: var(--ink-muted); font-size: 11px; }
.stack { display: grid; gap: 12px; margin-top: 14px; }
.lead-card { padding: 16px 0; border-top: 1px solid var(--line); background: transparent; }
.lead-card h4 { margin: 0 0 5px; font-size: 19px; font-weight: 600; }
.message-preview { max-width: 68ch; margin: 13px 0; color: var(--ink); font-size: 14px; white-space: pre-line; }
.result-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.task-button { display: block; width: 100%; margin-top: 7px; text-align: start; }
.outreach-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-select { max-width: 180px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-button { display: inline-flex; align-items: center; min-height: 36px; cursor: pointer; }
.lead-detail { display: grid; gap: 13px; }
.lead-detail h4 { font-size: 23px; }
.contact-lines { display: grid; gap: 7px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contact-lines div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.contact-lines span { color: var(--ink-muted); }
.contact-lines b { overflow-wrap: anywhere; text-align: end; font-weight: 500; }
.map-link { color: var(--ink); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.message-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.choice-button { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); padding: 8px 6px; font-size: 12px; cursor: pointer; }
.choice-button.selected { border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 650; }
.contact-action { display: inline-flex; text-decoration: none; }
.action.success { border-color: var(--success); color: var(--success); }
.action.warning { border-color: var(--warning); color: var(--warning); }
.action.danger { border-color: var(--danger); color: var(--danger); }
.lead-actions { display: grid; gap: 9px; padding-top: 13px; border-top: 1px solid var(--line); }
.action-hint { color: var(--ink-muted); font-size: 12px; }
.primary-actions { display: grid; }
.primary-action { width: 100%; min-height: 46px; }
.secondary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.secondary-actions .danger { grid-column: 1 / -1; }.lead-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.inline-error { margin: 0; padding: 10px; border-left: 3px solid var(--danger); background: #f8eeee; color: var(--danger); font-size: 13px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (max-width: 480px) { .app-shell { padding: 22px 16px 32px; } .hero-card { margin: 34px 0 38px; } .module-grid { grid-template-columns: 1fr; } .module { min-height: 96px; } .message-choices { grid-template-columns: 1fr; } .outreach-toolbar .filter-select { max-width: none; flex: 1; } .lead-nav button { padding-inline: 9px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
.knowledge-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 18px; }
.knowledge-card { display: grid; gap: 7px; }
.knowledge-tags { color: var(--ink-muted); font-size: 12px; }
.form-two { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-two { grid-template-columns: 1fr; } }
fieldset { display: grid; gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--line); }
legend { padding: 0 5px; color: var(--ink-muted); font-size: 13px; }
.reminders { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.check-label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 7px; font-weight: 500; }
.check-label input { width: 18px; height: 18px; }
.knowledge-card a { color: var(--ink); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 480px) { .knowledge-toolbar { grid-template-columns: 1fr; } }
.finance-dashboard:not(.finance-ready) .finance-summary, .finance-dashboard:not(.finance-ready) .finance-chart-card { visibility: hidden; opacity: 0; }
.finance-dashboard { display: grid; gap: 14px; margin-top: 18px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.finance-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.finance-summary { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.finance-summary b { font-size: 18px; overflow-wrap: anywhere; }
.finance-chart-card { padding: 18px 0; border-top: 1px solid var(--line); transition: opacity .2s ease; }
.finance-dashboard.is-loading .finance-summary, .finance-dashboard.is-loading .finance-chart-card { opacity: .48; }
.finance-chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; margin-bottom: 18px; }
.finance-chart-head h4 { font-size: 19px; font-weight: 600; }
.finance-bars { display: flex; align-items: end; gap: 3px; width: 100%; max-width: 100%; height: 170px; padding: 10px 0 0; border-bottom: 1px solid var(--line-strong); overflow: hidden; }
.finance-bar { display: flex; flex: 1 1 0; min-width: 0; height: 100%; flex-direction: column; align-items: center; justify-content: end; gap: 7px; }
.finance-bar-fill { display: block; width: 100%; min-width: 2px; min-height: 2px; background: var(--ink); transform-origin: bottom; animation: none; transition: height .25s ease; }
.finance-chart-card.is-visible .finance-bar-fill { animation: finance-rise .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--bar-index, 0) * 28ms); }
.finance-bar small { height: 14px; color: var(--ink-muted); font-size: 9px; white-space: nowrap; }
.finance-category-layout { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 22px; padding-bottom: 12px; }
.finance-donut { width: 150px; height: 150px; border-radius: 50%; position: relative; animation: none; }
.finance-chart-card.is-visible .finance-donut { animation: finance-pop .35s ease both; }
.finance-donut::after { content: ''; position: absolute; inset: 35px; border-radius: 50%; background: var(--paper); }
.finance-legend { display: grid; gap: 10px; }
.finance-legend-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; font-size: 12px; }
.finance-legend-row i { width: 9px; height: 9px; display: block; }
.finance-legend-row b { font-size: 11px; font-weight: 600; text-align: right; }
.finance-chart-head > .muted-text { white-space: nowrap; text-align: right; }
.finance-summary > div { animation: none; }
.finance-summary.is-visible > div { animation: finance-card-in .35s ease both; }
.finance-summary > div:nth-child(2) { animation-delay: 70ms; }
.finance-summary > div:nth-child(3) { animation-delay: 140ms; }
.finance-summary > div:nth-child(4) { animation-delay: 210ms; }
@keyframes finance-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes finance-card-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes finance-pop { from { transform: scale(.92); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 480px) { .finance-controls, .finance-category-layout { grid-template-columns: 1fr; } .finance-donut { margin: 0 auto; } }
@media (max-width: 360px) { .finance-summary { grid-template-columns: 1fr; } .finance-chart-head { align-items: flex-start; flex-direction: column; } .finance-chart-head > .muted-text { white-space: normal; text-align: left; } }
@media (prefers-reduced-motion: reduce) { .finance-bar-fill, .finance-donut, .finance-summary > div, .reveal-target { animation: none; transition: none; transform: none; opacity: 1; } }
.playlist-card { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.playlist-items { max-height: 260px; overflow-y: auto; margin: 10px 0; padding-left: 22px; font-size: 13px; }
.playlist-items li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.playlist-items li span:first-child { overflow-wrap: anywhere; }
.playlist-items li .muted-text { float: right; margin-left: 8px; font-size: 12px; }
.job-card { margin-top: 12px; }
.job-card .progress span { transition: width .4s ease; }
@media (prefers-reduced-motion: reduce) { .job-card .progress span { transition: none; } }
/* Segmented tabs */
.segmented { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 16px; border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; }
.segment { min-height: 40px; border: 0; background: var(--surface); color: var(--ink); font-size: 14px; cursor: pointer; }
.segment + .segment { border-left: 1px solid var(--ink); }
.segment.selected { background: var(--ink); color: #fff; font-weight: 600; }
/* Audio library */
.library { display: grid; gap: 10px; }
.track-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.track { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; border-bottom: 1px solid var(--line); }
.track-main { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; border: 0; background: transparent; color: var(--ink); text-align: start; cursor: pointer; }
.track-main:disabled { cursor: default; opacity: .55; }
.track-cover { position: relative; display: block; width: 44px; height: 44px; border-radius: 4px; background: var(--surface-muted); overflow: hidden; }
.track-cover::before { content: '♪'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-muted); font-size: 16px; }
.track-cover img { position: relative; width: 100%; height: 100%; object-fit: cover; display: block; }
.track-text { display: grid; min-width: 0; }
.track-text b { overflow: hidden; font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.track-text small { overflow: hidden; color: var(--ink-muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.track-duration { color: var(--ink-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.track-more { width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink-muted); font-size: 16px; letter-spacing: 1px; cursor: pointer; }
.track-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 12px 56px; }
.track-actions[hidden] { display: none; }
.link-tiny { display: inline-flex; align-items: center; text-decoration: none; }
.danger-tiny { border-color: var(--danger); color: var(--danger); }
.track.playing .track-text b { text-decoration: underline; text-underline-offset: 3px; }
.track.playing .track-cover::after { content: ''; position: absolute; inset: 0; background: rgba(23,23,23,.55) center / 16px no-repeat; }
.track.playing .track-cover::before { content: '▶'; z-index: 1; color: #fff; }
.track.playing.paused .track-cover::before { content: 'Ⅱ'; }
.track.playing .track-duration { color: var(--ink); font-weight: 600; }
/* Mini player */
body.has-player .app-shell { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.mini-player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; gap: 6px; max-width: 720px; margin: 0 auto; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); background: var(--surface); animation: mp-in .25s cubic-bezier(.2,.8,.2,1); }
.mini-player[hidden] { display: none; }
.mp-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.mp-cover { position: relative; width: 40px; height: 40px; border-radius: 4px; background: var(--surface-muted); overflow: hidden; }
.mp-cover::before { content: '♪'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-muted); }
.mp-cover img { position: relative; width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-text { display: grid; min-width: 0; }
.mp-title { overflow: hidden; font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.mp-artist { overflow: hidden; color: var(--ink-muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.mini-player.is-loading .mp-artist::after { content: ' · загрузка…'; }
.mp-controls { display: flex; gap: 2px; }
.mp-btn { width: 40px; height: 40px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font-size: 16px; cursor: pointer; }
.mp-btn:disabled { opacity: .3; cursor: default; }
.mp-play { background: var(--ink); color: #fff; }
.mp-close { color: var(--ink-muted); font-size: 14px; }
.mp-seek { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; align-items: center; gap: 8px; color: var(--ink-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mp-total { text-align: right; }
.mp-range { --fill: 0%; height: 20px; padding: 0; border: 0; background: transparent; -webkit-appearance: none; appearance: none; }
.mp-range::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(var(--ink), var(--ink)) 0 / var(--fill) 100% no-repeat, var(--line); }
.mp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%; background: var(--ink); }
.mp-range::-moz-range-track { height: 3px; background: var(--line); }
.mp-range::-moz-range-progress { height: 3px; background: var(--ink); }
.mp-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--ink); }
@keyframes mp-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (max-width: 360px) { .mp-close { display: none; } .mp-btn { width: 36px; } }
@media (prefers-reduced-motion: reduce) { .mini-player { animation: none; } }
/* Paged search */
.search-card { margin-top: 18px; }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.source-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.source-chips::-webkit-scrollbar { display: none; }
.source-chip { flex: 0 0 auto; min-height: 36px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.source-chip.selected { border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 600; }
.source-chip.selected::before { content: '✓ '; }
.source-hint { margin-top: -8px; font-size: 12px; }
.search-results { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.search-results:empty { display: none; }
.search-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); animation: row-in .25s ease both; }
.search-row .track-text b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.source-badge { color: var(--ink-muted); font-size: 10px !important; letter-spacing: .06em; text-transform: uppercase; }
.search-actions { display: flex; gap: 6px; }
.search-actions .tiny { min-width: 44px; }
.more-button { width: 100%; }
.search-sentinel { height: 1px; }
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .search-row { animation: none; } .source-chip { transition: none; } }
/* Search types + multi-select */
.search-types { margin: 0; }
.search-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.search-toolbar .tiny { flex: 0 0 auto; }
.search-row { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; border-radius: 4px; transition: background .15s ease; }
.search-row[data-url] { cursor: default; }
.search-card.is-selecting .search-row[data-url] { cursor: pointer; }
.search-row.selected { background: var(--surface-muted); }
.select-check { position: absolute; inset: 0; z-index: 2; display: none; place-items: center; background: rgba(23,23,23,.18); color: #fff; font-size: 18px; font-weight: 700; }
.search-card.is-selecting .select-check { display: grid; }
.search-card.is-selecting .search-row.selected .select-check { background: rgba(23,23,23,.78); }
.search-card.is-selecting .search-row.selected .select-check::before { content: '✓'; }
.search-card.is-selecting .search-row:not(.selected) .select-check::before { content: ''; width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; }
.search-card.is-selecting .search-row[data-url] .search-actions { visibility: hidden; }
.collection-cover { border-radius: 2px; box-shadow: 3px -3px 0 -1px var(--surface), 3px -3px 0 0 var(--line-strong); }
.collection-row .search-actions .tiny:first-child { border-color: var(--ink); background: var(--ink); color: #fff; }
.selection-bar { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--ink); border-radius: 6px; background: var(--surface); box-shadow: 0 6px 20px rgba(0,0,0,.12); animation: mp-in .2s ease; }
.selection-bar[hidden] { display: none; }
.selection-bar b { font-size: 13px; white-space: nowrap; }
.selection-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.primary-tiny { background: var(--ink); color: #fff; }
body.has-player .selection-bar { bottom: calc(132px + env(safe-area-inset-bottom)); }
@media (max-width: 360px) { .selection-bar { flex-direction: column; align-items: stretch; } .selection-actions { justify-content: stretch; } .selection-actions .tiny { flex: 1; } }
@media (prefers-reduced-motion: reduce) { .selection-bar { animation: none; } .search-row { transition: none; } }
.search-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.search-types .segment + .segment { border-left: 1px solid var(--ink); }
/* Job status cards with cover + auto-dismiss */
#playlist-jobs { display: grid; gap: 10px; margin-top: 12px; }
#playlist-jobs:empty { display: none; }
.job-card { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); overflow: hidden; animation: job-in .3s cubic-bezier(.2,.8,.2,1); transition: height .4s cubic-bezier(.4,0,.2,1), opacity .3s ease, transform .4s cubic-bezier(.4,0,.2,1), padding .4s ease, margin .4s ease, border-color .3s ease; }
.job-cover { position: relative; width: 64px; height: 64px; border-radius: 4px; background: var(--surface-muted); overflow: hidden; }
.job-cover::before { content: '♪'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-muted); font-size: 22px; }
.job-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.job-cover img.loaded { opacity: 1; }
.job-badge { position: absolute; right: 4px; bottom: 4px; z-index: 2; min-width: 22px; padding: 1px 6px; border-radius: 10px; background: rgba(23,23,23,.82); color: #fff; font-size: 10px; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
.job-card.is-done:not(.has-errors) .job-badge { background: var(--success); }
.job-card.has-errors.is-done .job-badge { background: var(--warning); }
.job-body { display: grid; gap: 3px; min-width: 0; }
.job-kicker { color: var(--ink-muted); font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.job-title { overflow: hidden; font-size: 15px; font-weight: 600; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
.job-now { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.job-card.is-done .job-now { white-space: normal; }
.job-card.is-done:not(.has-errors) .job-now { color: var(--success); }
.job-progress { margin: 8px 0 4px; }
.job-progress span { transition: width .5s ease; }
.job-card.is-done:not(.has-errors) .job-progress span { background: var(--success); }
.job-meta { font-size: 12px; }
.job-actions { display: flex; gap: 8px; margin-top: 6px; }
.job-actions:empty { display: none; }
.job-card.is-counting::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--line-strong); transform-origin: left; animation: job-countdown var(--leave-delay, 3500ms) linear forwards; }
.job-card.is-leaving { opacity: 0; transform: translateX(16px); padding-top: 0; padding-bottom: 0; margin-top: -10px; border-color: transparent; }
@keyframes job-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes job-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .job-card, .job-cover img, .job-progress span { animation: none; transition: none; } .job-card.is-counting::after { animation: none; display: none; } }

footer { flex-wrap: wrap; gap: 6px 12px; }
#claude-limits { order: 3; flex-basis: 100%; }
#claude-limits:empty { display: none; }
#claude-limits { display: grid; gap: 8px; }
.cl-row { display: grid; grid-template-columns: 72px 1fr 32px; align-items: center; gap: 10px; }
.cl-row span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.cl-row i { display: block; height: 2px; background: var(--line); }
.cl-row b { display: block; height: 100%; background: var(--ink); transition: width .5s ease; }
.cl-row b.hot { background: #b3261e; }
@media (prefers-reduced-motion: reduce) { .cl-row b { transition: none; } }

/* Volume: desktop only (mobile uses hardware buttons; iOS ignores audio.volume) */
.mp-vol { display: none; }
@media (hover: hover) and (pointer: fine) {
  .mp-vol { display: grid; grid-template-columns: 40px minmax(0, 1fr) 38px; align-items: center; gap: 8px; max-width: 280px; color: var(--ink-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
  .mp-mute { width: 40px; height: 28px; font-size: 15px; }
  .mp-vval { text-align: right; }
}
.mp-vrange { --fill: 100%; height: 20px; padding: 0; border: 0; background: transparent; -webkit-appearance: none; appearance: none; }
.mp-vrange::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(var(--ink), var(--ink)) 0 / var(--fill) 100% no-repeat, var(--line); }
.mp-vrange::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: var(--ink); }
.mp-vrange::-moz-range-track { height: 3px; background: var(--line); }
.mp-vrange::-moz-range-progress { height: 3px; background: var(--ink); }
.mp-vrange::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--ink); }
.mp-vrange:focus-visible, .mp-mute:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { body.has-player .app-shell { padding-bottom: calc(185px + env(safe-area-inset-bottom)); } body.has-player .selection-bar { bottom: calc(167px + env(safe-area-inset-bottom)); } }

.kwork-card h4 a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.kwork-card h4 a:hover, .kwork-card h4 a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.kwork-note { margin: 0 0 6px; color: var(--ink-muted); font-size: 13px; }
.kwork-card .message-preview { margin: 10px 0; font-size: 13px; overflow-wrap: anywhere; }
.kwork-settings summary { cursor: pointer; font-weight: 600; min-height: 36px; }
.kwork-settings label { display: block; margin-top: 12px; font-size: 13px; }
.kwork-settings input[type=checkbox] { width: 20px; height: 20px; margin-right: 8px; vertical-align: -4px; }
.kwork-settings .action { margin-top: 14px; }
.kwork-card a:focus-visible, .kwork-settings summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Files module */
.files-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 10px; }
.files-sep { color: var(--ink-muted, #8a8a8a); }
.files-slot:empty { display: none; }
.files-slot { margin-top: 12px; }
.files-body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.files-move { border-color: var(--ink); margin-bottom: 12px; }
.files-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 8px; margin-top: 18px; }
.files-tile { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.files-tile-main { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 6px 4px 2px; background: none; border: 0; border-radius: 8px; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.files-tile-main:active { background: var(--surface-muted, rgba(127,127,127,.15)); }
.files-icon { width: 64px; height: 64px; margin-bottom: 8px; }
.files-tile-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; font-size: 14px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.files-tile-meta { margin-top: 3px; font-size: 12px; color: var(--ink-muted, #8a8a8a); }
.files-tile-more { min-width: 44px; min-height: 28px; margin-top: 4px; padding: 0 10px; border: 0; border-radius: 12px; background: var(--surface-muted, rgba(127,127,127,.15)); color: var(--ink-muted, #8a8a8a); font-size: 11px; letter-spacing: 1px; cursor: pointer; }
.files-sheet-back { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; background: rgba(0,0,0,.45); }
.files-sheet { width: 100%; max-height: 80vh; overflow: auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; background: var(--surface, #fff); color: var(--ink, #111); }
.files-sheet-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line, #ddd); }
.files-sheet-head .files-icon { width: 40px; height: 40px; margin: 0; flex: 0 0 auto; }
.files-sheet-title { font-weight: 600; overflow-wrap: anywhere; }
.files-sheet-btn { display: block; width: 100%; min-height: 48px; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line, #ddd); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.files-sheet-btn.danger { color: #d93025; }
.files-sheet-btn:disabled { opacity: .5; }
.files-sheet-cancel { margin-top: 6px; border-bottom: 0; text-align: center; font-weight: 600; }
@media (min-width: 560px) { .files-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.module-grid[hidden], .workspace[hidden] { display: none; }
.files-icon { color: var(--ink); }
.files-icon .fi-solid { fill: var(--ink); }
.files-icon .fi-cut { fill: none; stroke: var(--paper); stroke-width: 1.5; }
.files-icon .fi-page { fill: var(--surface); stroke: var(--ink); stroke-width: 2; stroke-linejoin: miter; }
.files-icon .fi-fold { fill: none; stroke: var(--ink); stroke-width: 2; }
.files-icon .fi-line { fill: none; stroke: var(--ink-muted); stroke-width: 2; stroke-linecap: butt; }
.files-icon .fi-ext { fill: var(--ink); font: 700 12px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: .04em; }
.files-sheet-head .files-icon .fi-cut { stroke: var(--surface); }
.files-tile-main { border-radius: 4px; }
.files-sheet { border-radius: 4px 4px 0 0; }
.files-tile-more { border: 1px solid var(--line-strong); border-radius: 4px; background: transparent; }
.files-icon { display: block; flex: 0 0 auto; width: 64px; height: 64px; margin: 0 auto 8px; }
.files-tile { justify-content: flex-start; }
.files-tile-main { flex: 1 1 auto; justify-content: flex-start; }
.files-tile-name { min-height: 2.5em; }
.files-tile-more { margin-top: 6px; }
