:root {
  color-scheme: dark;
  --bg: #0d141c; --surface: #151f2b; --line: #2a3949; --text: #f5f7fa;
  --muted: #9baaba; --accent: #f2bd55; --teal: #41d7b0; --red: #ff7d7d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: radial-gradient(ellipse at 55% -15%, #1b2a38 0, transparent 48%), var(--bg); }
button, input, select { font: inherit; }
a { color: inherit; }
.topbar { min-height: 76px; padding: 0 clamp(18px, 4vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(154,174,193,.13); background: rgba(12,19,27,.72); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #17212a; background: var(--accent); font-weight: 900; font-size: 21px; }
.brand strong, .brand small { display: block; letter-spacing: .11em; }
.brand strong { font-size: 14px; }.brand small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: clamp(14px,3vw,28px); }
.admin-link { color: #d4deea; text-decoration: none; font-size: 13px; font-weight: 650; }.admin-link:hover { color: var(--accent); }.admin-link span { padding-left: 4px; color: var(--accent); }
.sync-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; font-size: 11px; }
.sync-status i, .live-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px rgba(65,215,176,.35); }
.sync-status[data-state="loading"] i { background: var(--accent); }.sync-status[data-state="offline"] i { background: var(--red); }
.page-shell { width: min(1100px,calc(100% - 36px)); margin: 0 auto; padding: clamp(30px,6vw,66px) 0 32px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: 10px; letter-spacing: .16em; font-weight: 800; }
h1 { margin: 0; font-size: clamp(30px,5vw,44px); line-height: 1.08; letter-spacing: -.045em; }.subtitle { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.shift-chip { display: inline-flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; color: #c6d2de; font-size: 11px; white-space: nowrap; }
.calculator-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr); gap: 18px; }
.mode-switcher, .calculation-switcher { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #101923; }
.mode-switcher { width: min(520px,100%); margin: 0 auto 18px; }
.mode-button, .calculation-button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750; cursor: pointer; }
.mode-button.active, .calculation-button.active { color: #17212a; background: var(--accent); }
.calculation-switcher { margin-top: 16px; }
.calculation-button { min-height: 36px; font-size: 11px; }
.card { border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg,rgba(24,36,49,.97),rgba(19,29,40,.97)); box-shadow: 0 18px 42px rgba(0,0,0,.17); }
.input-card, .result-card { padding: clamp(20px,3.2vw,34px); }
.section-title { display: flex; align-items: center; gap: 13px; }.step-number { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(242,189,85,.28); border-radius: 12px; color: var(--accent); background: rgba(242,189,85,.08); font-weight: 800; font-size: 13px; }
.section-title h2 { margin: 0; font-size: 16px; }.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.field-label { display: block; margin: 20px 0 0; color: #d8e1e9; font-size: 12px; font-weight: 700; }
.search-wrap { position: relative; margin-top: 8px; }.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-52%); color: var(--accent); font-size: 24px; line-height: 1; }
input, select { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #354657; border-radius: 11px; color: var(--text); background: #101923; outline: none; transition: border-color .15s,box-shadow .15s; }
.search-wrap input { padding-left: 44px; } input:focus, select:focus { border-color: rgba(242,189,85,.8); box-shadow: 0 0 0 3px rgba(242,189,85,.12); } input::placeholder { color: #748496; }
.model-results { position: relative; z-index: 2; max-height: 264px; margin-top: 7px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #101923; box-shadow: 0 16px 28px rgba(0,0,0,.24); }
.model-option { width: 100%; min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 13px; border: 0; border-bottom: 1px solid rgba(154,174,193,.1); color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.model-option:last-child { border-bottom: 0; }.model-option:hover,.model-option:focus-visible { background: #203041; outline: 0; }.model-option strong { font-size: 13px; }.model-option span { color: var(--accent); font-size: 11px; white-space: nowrap; }.empty-results { padding: 12px 14px; margin: 0; color: var(--muted); font-size: 13px; }
.selected-model { margin-top: 12px; padding: 13px 15px; border: 1px solid rgba(65,215,176,.24); border-radius: 12px; background: rgba(65,215,176,.06); }.selected-label { display: block; margin-bottom: 6px; color: var(--teal); font-size: 9px; letter-spacing: .14em; font-weight: 800; }.selected-details { display: flex; justify-content: space-between; align-items: center; gap: 12px; }.selected-details strong { font-size: 16px; }.selected-details span { color: #a8ded0; font-size: 11px; text-align: right; }
.section-title-spaced { margin-top: 28px; }.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }.field-grid .field-label { margin-top: 17px; }.field-wide { grid-column: 1 / -1; }.hint { margin: 15px 0 0; color: #8394a6; font-size: 11px; }
.result-card { display: flex; flex-direction: column; background: radial-gradient(circle at 100% 0%,rgba(242,189,85,.11),transparent 40%),linear-gradient(145deg,#192634,#131d28); }.result-topline { display: flex; justify-content: space-between; align-items: center; }.result-topline .eyebrow { margin: 0; }.clock-icon { color: var(--accent); font-size: 26px; }.result-time { margin-top: 31px; color: var(--accent); font-size: clamp(54px,8vw,76px); line-height: 1; letter-spacing: -.075em; font-weight: 760; font-variant-numeric: tabular-nums; }.result-message { min-height: 40px; margin: 13px 0 0; color: #b1bfcc; font-size: 12px; line-height: 1.6; }.result-divider { height: 1px; margin: 28px 0 17px; background: var(--line); }.result-facts { display: grid; gap: 13px; }.result-facts div { display: flex; justify-content: space-between; gap: 12px; }.result-facts span { color: var(--muted); font-size: 12px; }.result-facts strong { font-size: 12px; text-align: right; }.result-footnote { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 29px; color: #93a3b3; font-size: 10px; }.result-footnote .live-dot { width: 6px; height: 6px; }
.page-footer { display: flex; justify-content: space-between; gap: 18px; padding: 15px 3px 0; color: #708193; font-size: 10px; }.page-footer span:first-child { color: #a9b6c3; }
.admin-shell { max-width: 1050px; }.admin-shell .page-heading { align-items: center; }.login-card { width: min(480px,100%); padding: clamp(20px,4vw,30px); }.login-form { margin-top: 16px; }.login-form .field-label { margin-top: 15px; }
.primary-button,.secondary-button,.save-button { min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; font-size: 12px; cursor: pointer; transition: filter .15s,background .15s; }.primary-button { color: #18212a; background: var(--accent); }.primary-button:hover,.save-button:hover { filter: brightness(1.07); }.primary-button:disabled,.secondary-button:disabled,.save-button:disabled { cursor: wait; opacity: .6; }.login-form .primary-button { width: 100%; margin-top: 20px; }
.secondary-button { color: #d8e2ec; background: #202d3b; border-color: #354657; }.secondary-button:hover:not(:disabled) { background: #2a3a4c; }
.form-message { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }.form-message[data-kind="error"] { color: var(--red); }.form-message[data-kind="success"] { color: var(--teal); }
.notice { max-width: 720px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid rgba(242,189,85,.35); border-radius: 12px; color: #f4d999; background: rgba(242,189,85,.08); font-size: 13px; line-height: 1.6; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 17px; padding: 17px 20px; }.admin-toolbar strong { font-size: 13px; }.muted { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.add-model-card,.table-card { margin-bottom: 17px; padding: 23px; }.add-model-form { display: grid; grid-template-columns: 1.2fr 1fr auto; align-items: end; gap: 14px; }.add-model-form .field-label { margin: 14px 0 0; }.add-model-form .primary-button { min-height: 47px; }
.table-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }.table-heading h2 { margin: 0; font-size: 17px; }.table-search { width: min(280px,48%); }.table-search input { min-height: 40px; }.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; } th { padding: 11px 14px; color: #99aabc; background: #111a24; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; } td { padding: 9px 14px; border-top: 1px solid rgba(154,174,193,.1); font-size: 12px; } tbody tr:hover { background: rgba(255,255,255,.025); }.code-cell { width: 46%; font-weight: 700; font-variant-numeric: tabular-nums; }.norm-input { width: 130px; min-height: 36px; padding: 7px 10px; }.save-button { min-height: 34px; padding: 7px 12px; color: #13221f; background: var(--teal); font-size: 11px; }.empty-cell { padding: 25px; color: var(--muted); text-align: center; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 17px; margin-top: 16px; color: var(--muted); font-size: 11px; }.pagination .secondary-button { min-height: 34px; padding: 7px 11px; font-size: 11px; }.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }[hidden] { display: none !important; }
@media(max-width:720px) {
  .topbar { min-height: 66px; padding-inline: 16px; }.topbar-actions { gap: 12px; }.sync-status { font-size: 0; gap: 0; }.sync-status i { width: 9px; height: 9px; }.admin-link { font-size: 11px; }
  .page-shell { width: min(100% - 28px,560px); padding-top: 29px; }.page-heading { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 19px; }.shift-chip { padding: 8px 10px; font-size: 10px; }
  .calculator-grid { grid-template-columns: 1fr; gap: 12px; }.input-card,.result-card { border-radius: 17px; }.result-card { min-height: 275px; }.result-time { margin-top: 24px; font-size: 64px; }.result-footnote { padding-top: 20px; }.page-footer { flex-direction: column; gap: 6px; }.mode-switcher { margin-bottom: 12px; }
  .admin-shell .page-heading { flex-direction: row; align-items: center; }.admin-toolbar { padding: 14px; }.add-model-card,.table-card { padding: 16px; border-radius: 16px; }.add-model-form { grid-template-columns: 1fr 1fr; gap: 4px 11px; }.add-model-form .primary-button { grid-column: 1 / -1; margin-top: 10px; }.table-heading { align-items: flex-start; flex-direction: column; }.table-search { width: 100%; }.code-cell { width: auto; }
}
@media(max-width:390px) { .brand small { font-size: 8px; }.admin-link { font-size: 10px; }.field-grid { grid-template-columns: 1fr; }.field-wide { grid-column: auto; }.selected-details { align-items: flex-start; flex-direction: column; gap: 4px; }.selected-details span { text-align: left; }.admin-shell .page-heading { align-items: flex-start; flex-direction: column; } }
