:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0c3340;
  background: #f4f8f7;
  --surface: #ffffff;
  --muted: #557078;
  --border: #cbdcda;
  --brand: #075f65;
  --brand-strong: #04474c;
  --danger: #a42c35;
  --focus: #006dcc;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f4f8f7; }
button, select { font: inherit; }
button, select { min-height: 44px; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .58; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-link {
  position: fixed; left: 1rem; top: -5rem; z-index: 10;
  padding: .75rem 1rem; color: white; background: var(--brand-strong); border-radius: .5rem;
}
.skip-link:focus { top: 1rem; }
.topbar {
  display: flex; align-items: end; justify-content: space-between; gap: 1.5rem;
  padding: 1.5rem clamp(1rem, 4vw, 3rem); background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar h1, .panel-heading h2, .detail-panel h2 { margin: .15rem 0 0; }
.eyebrow { margin: 0; color: var(--brand); font-size: .75rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: end; gap: 1rem; }
.language-toggle { display: inline-flex; padding: .2rem; border: 1px solid var(--border); border-radius: .75rem; }
.language-toggle button { min-width: 3rem; border: 0; border-radius: .55rem; color: var(--brand-strong); background: transparent; }
.language-toggle button[aria-pressed="true"] { color: white; background: var(--brand); }
.workspace-label { display: grid; gap: .35rem; color: var(--muted); font-size: .82rem; font-weight: 650; }
select { max-width: 100%; padding: .55rem 2rem .55rem .7rem; border: 1px solid var(--border); border-radius: .65rem; color: inherit; background: var(--surface); }

.workspace { display: grid; grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr); gap: 1.25rem; max-width: 78rem; margin: 0 auto; padding: 1.5rem; }
.inbox-panel, .detail-panel { min-width: 0; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 0 .4rem 1.5rem rgba(7, 55, 60, .06); }
.panel-heading, .detail-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.secondary-button, .primary-button, .danger-button {
  padding: .65rem 1rem; border: 1px solid transparent; border-radius: .7rem; font-weight: 700;
}
.secondary-button { border-color: var(--border); color: var(--brand-strong); background: var(--surface); }
.primary-button { color: white; background: var(--brand); }
.primary-button:hover { background: var(--brand-strong); }
.danger-button { color: white; background: var(--danger); }
.status { min-height: 1.5rem; color: var(--muted); }
.status[data-kind="error"] { color: var(--danger); font-weight: 650; }
.status[data-kind="success"] { color: var(--brand-strong); font-weight: 650; }

.inquiry-list { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.inquiry-card { width: 100%; padding: .9rem; border: 1px solid var(--border); border-radius: .75rem; text-align: left; color: inherit; background: var(--surface); }
.inquiry-card:hover, .inquiry-card[aria-current="true"] { border-color: var(--brand); background: #eff9f7; }
.inquiry-card strong, .inquiry-card span { display: block; }
.inquiry-card span { margin-top: .3rem; color: var(--muted); font-size: .9rem; }
.empty-state { max-width: 34rem; margin: clamp(2rem, 10vh, 7rem) auto; text-align: center; color: var(--muted); }
.empty-state h2 { color: #0c3340; }
.state-pill { padding: .35rem .65rem; border-radius: 999px; color: var(--brand-strong); background: #dff2ee; font-size: .82rem; font-weight: 750; }
.state-pill[data-state="declined"] { color: #7d1e25; background: #f9e1e3; }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1.25rem; margin: 1rem 0 1.5rem; }
.details-grid div { min-width: 0; padding-bottom: .65rem; border-bottom: 1px solid #e5eeec; }
.details-grid dt { color: var(--muted); font-size: .8rem; }
.details-grid dd { overflow-wrap: anywhere; margin: .25rem 0 0; font-weight: 600; white-space: pre-wrap; }
.decision-form { padding-top: .5rem; border-top: 1px solid var(--border); }
.decision-controls { display: grid; grid-template-columns: auto minmax(12rem, 1fr) auto; align-items: end; gap: .75rem; }
.decision-controls label { display: grid; gap: .35rem; color: var(--muted); font-size: .82rem; font-weight: 650; }

@media (max-width: 760px) {
  .topbar, .topbar-actions { align-items: stretch; flex-direction: column; }
  .topbar-actions { gap: .75rem; }
  .workspace { grid-template-columns: 1fr; padding: .75rem; }
  .details-grid { grid-template-columns: 1fr; }
  .decision-controls { grid-template-columns: 1fr; }
  .decision-controls button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; color: #e5f2f0; background: #0b2025; --surface: #102b31; --muted: #aac1c4; --border: #36565b; --focus: #77b9ff; }
  body { background: #0b2025; }
  .empty-state h2 { color: #e5f2f0; }
  .inquiry-card:hover, .inquiry-card[aria-current="true"] { background: #153b3f; }
  .details-grid div { border-bottom-color: #29494e; }
}

[hidden] { display: none !important; }
.auth-panel { width: min(100% - 2rem, 28rem); margin: 3rem auto; padding: 1.5rem; border: 1px solid #9aa7a1; border-radius: 1rem; }
.auth-panel form { display: grid; gap: .75rem; }
.auth-panel input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: .75rem; font: inherit; }
.auth-panel button { min-height: 44px; margin-top: .75rem; }
@media (max-width: 760px) { .auth-panel { margin: 1rem auto; } }

/* PWA (20.10.2026): полосы связи и обновления, вырезы экрана, планшет, установленное приложение. */
.app-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; max-width: 78rem; margin: .75rem auto 0; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); }
.app-banner[data-kind="error"] { border-color: var(--danger); color: var(--danger); font-weight: 650; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
@media (min-width: 761px) and (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr); padding: 1rem; }
  .details-grid { grid-template-columns: 1fr; }
}
@media (pointer: coarse) {
  .inquiry-card, .language-toggle button, select { min-height: 48px; }
}
@media (display-mode: standalone) {
  .topbar { padding-top: max(1rem, env(safe-area-inset-top)); }
}
