@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/inter-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --line: rgba(29, 29, 31, 0.12);
  --focus: #0071e3;
  --ok: #248a3d;
  --warn: #b25000;
  --danger: #d70015;
  --radius: 16px;
  --nav: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --line: rgba(245, 245, 247, 0.16);
    --focus: #409cff;
    --ok: #30d158;
    --warn: #ff9f0a;
    --danger: #ff453a;
    --nav: #1c1c1e;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 980px;
  z-index: 100;
}
.skip:focus { top: 16px; }

.app {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 8px 16px;
  background: var(--nav);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 16px 0;
}
.tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: 980px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--line);
}

.shell {
  display: grid;
  gap: 16px;
  padding: 16px;
  width: min(1120px, 100%);
  margin-inline: auto;
}
@media (min-width: 900px) {
  .shell.split {
    grid-template-columns: minmax(280px, 360px) 1fr;
    align-items: start;
  }
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.panel h2, .panel h3 {
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}
.list { display: grid; gap: 8px; }
.row-btn, .item {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.row-btn[aria-current="true"] { border-color: var(--accent); }
.meta { color: var(--muted); font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
}
.badge-wait { background: rgba(178, 80, 0, 0.12); color: var(--warn); }
.badge-ok { background: rgba(36, 138, 61, 0.12); color: var(--ok); }
.badge-off { background: rgba(215, 0, 21, 0.1); color: var(--danger); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}
textarea { min-height: 120px; resize: vertical; }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; font-weight: 400; }
.error {
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 14px;
}
.draft {
  white-space: pre-wrap;
  font-size: 15px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.hidden { display: none !important; }
.banner {
  margin: 0 16px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  font-size: 14px;
}
.quote-line { display: flex; justify-content: space-between; padding: 6px 0; }
.quote-total { font-weight: 600; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 500;
}
.checkbox input { width: 20px; height: 20px; min-height: 20px; }
