:root {
  color-scheme: light;
  --paper: #f3f6fa;
  --white: #ffffff;
  --ink: #202a36;
  --muted: #7f8a98;
  --line: #e1e8f0;
  --accent-blue: #a7ccf5;
  --accent-blue-hover: #8bbaf0;
  --coral: #ef765b;
  --blue: #7699d4;
  --range-blue-ink: #315f9d;
  --range-blue-dark: #25486f;
  --range-blue-line: #d6e2ef;
  --range-blue-wash: #edf3f9;
  --sidebar: #202a36;
  --display: "Space Grotesk", "Avenir Next", sans-serif;
  --body: "DM Sans", "Avenir Next", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1fr) minmax(380px, 1.08fr); background: var(--paper); }
.login-panel { width: min(100%, 540px); margin: auto; padding: 56px 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 25px var(--display); letter-spacing: 0; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px 3px 10px 3px; background: var(--accent-blue); color: var(--ink); font: 700 20px var(--display); transform: rotate(-3deg); }
.brand-period { color: var(--coral); }
.login-copy { margin: 88px 0 35px; }
.eyebrow { color: #757c75; font-size: 10px; font-weight: 700; letter-spacing: 0.13em; }
.login-copy h1 { margin: 15px 0 14px; font: 600 49px/1.04 var(--display); letter-spacing: 0; }
.login-copy p, .page-heading p { max-width: 370px; margin: 0; color: #777e78; font-size: 14px; line-height: 1.65; }
.form-stack { display: grid; gap: 18px; }
.form-stack label { display: grid; gap: 9px; color: #3b413c; font-size: 12px; font-weight: 700; }
.form-stack input, .form-stack select { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #e0e4dc; border-radius: 5px; outline: none; background: var(--white); color: var(--ink); font-size: 13px; font-weight: 500; transition: border-color .18s, box-shadow .18s; }
.form-stack input::placeholder { color: #adb2ab; }
.form-stack input:focus, .form-stack select:focus { border-color: #6488b2; box-shadow: 0 0 0 3px #a7ccf538; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 15px; padding: 0 17px; border: 0; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .15s, background .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent-blue); color: #24364b; }
.button-primary:hover { background: var(--accent-blue-hover); box-shadow: 0 4px 14px #729acb36; }
.button-primary span { font-size: 18px; font-weight: 500; }
.button-wide { width: 100%; justify-content: space-between; margin-top: 4px; }
.button-quiet { background: #f0f1ed; }
.form-error { margin: -4px 0 0; color: #b54135; font-size: 12px; line-height: 1.45; }
.login-footnote { margin: 27px 0 0; color: #929890; font-size: 11px; }
.login-art { position: relative; min-height: 680px; overflow: hidden; background: #dceafa; }
.art-grid { position: absolute; inset: 0; opacity: .45; background-image: linear-gradient(#ffffff55 1px, transparent 1px), linear-gradient(90deg, #ffffff55 1px, transparent 1px); background-size: 58px 58px; mask-image: linear-gradient(145deg, black, transparent 78%); }
.art-stamp { position: absolute; top: 14%; right: 15%; width: 124px; height: 124px; display: flex; flex-direction: column; justify-content: space-between; padding: 15px; border: 1px solid #2d4057; border-radius: 50%; transform: rotate(13deg); color: #2d4057; font: 600 10px/1.3 var(--display); }
.art-stamp b { align-self: flex-end; font-size: 24px; }
.art-big-number { position: absolute; top: 36%; left: -4%; color: #27394f; font: 600 clamp(82px, 12vw, 170px)/.86 var(--display); letter-spacing: 0; white-space: nowrap; }
.art-caption { position: absolute; top: 25%; left: 13%; display: flex; align-items: center; gap: 9px; color: #485d77; font-size: 12px; font-weight: 600; }
.live-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #739bd0; box-shadow: 0 0 0 3px #739bd022; }
.art-note { position: absolute; right: 13%; bottom: 13%; color: #364b65; font: 500 26px/1.2 var(--display); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; min-height: 600px; display: flex; flex-direction: column; padding: 28px 19px 17px; background: var(--sidebar); color: #f5f7fb; }
.sidebar-brand { color: #f5f7fb; padding: 0 11px; }
.workspace-label { margin: 61px 11px 16px; color: #858d85; font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.side-nav { display: grid; gap: 5px; }
.nav-link { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 11px; border: 0; border-radius: 4px; background: transparent; color: #abb7c5; text-align: left; cursor: pointer; font-size: 12px; font-weight: 600; }
.nav-link:hover { background: #ffffff0b; color: white; }
.nav-link.active { background: #ffffff12; color: #fff; }
.nav-link.active .nav-indicator { background: var(--accent-blue); }
.nav-indicator { width: 7px; height: 7px; border: 1px solid #76879a; border-radius: 2px; transform: rotate(45deg); }
.nav-section-label { margin: 27px 11px 10px; color: #737d74; font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.sidebar-bottom { margin-top: auto; }
.sidebar-tip { position: relative; min-height: 89px; margin: 0 4px 22px; padding: 16px 14px; overflow: hidden; border: 1px solid #ffffff16; border-radius: 5px; }
.sidebar-tip p { margin: 0; color: #d0d6ce; font: 500 13px/1.5 var(--display); }
.tip-spark { position: absolute; top: 12px; right: 14px; color: var(--accent-blue); font-size: 19px; }
.profile-row { display: flex; align-items: center; gap: 10px; padding: 15px 3px 0; border-top: 1px solid #ffffff19; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #d9e8f8; color: #334b68; font: 700 14px var(--display); }
.profile-copy { min-width: 0; display: grid; gap: 3px; flex: 1; }
.profile-copy strong { overflow: hidden; color: #f1f3ef; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy span { color: #929b92; font-size: 10px; }
.logout-button { padding: 6px 5px; border: 0; background: transparent; color: #aab2aa; cursor: pointer; font-size: 10px; }
.logout-button:hover { color: white; }
.main-content { min-width: 0; max-width: 1600px; width: 100%; margin: 0 auto; padding: 0 5.2%; display: flex; flex-direction: column; }
.topbar { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #858b84; font-size: 11px; }
.breadcrumb strong { color: #323833; font-weight: 700; }
.crumb-divider { color: #bdc2bb; }
.topbar-meta { display: flex; align-items: center; gap: 24px; color: #858b84; font-size: 10px; }
.online-status { display: flex; align-items: center; gap: 8px; }
.topbar-date { color: #606861; }
.page-view { flex: 1; padding-top: 42px; animation: appear .32s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 33px; }
.page-heading h1 { margin: 9px 0 8px; font: 600 35px/1.1 var(--display); letter-spacing: 0; }
.page-heading p { font-size: 12px; }
.heading-mark { position: relative; width: 73px; height: 66px; margin: 0 10px 4px 0; display: flex; align-items: center; justify-content: center; gap: 4px; color: #465b72; }
.heading-mark span { z-index: 1; font: 600 37px var(--display); }
.heading-mark i { position: absolute; width: 16px; height: 16px; border: 1px solid #9bb2ce; border-radius: 50%; }
.heading-mark i:nth-child(2) { top: 3px; right: 2px; }
.heading-mark i:nth-child(3) { right: 0; bottom: 6px; width: 10px; height: 10px; background: var(--coral); border: 0; }
.heading-mark i:nth-child(4) { bottom: 1px; left: 4px; width: 8px; height: 8px; background: var(--accent-blue); border: 0; }
.calculator-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(285px, .8fr); gap: 16px; align-items: stretch; }
.calculator-panel, .result-panel, .admin-form-panel, .list-panel { border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.calculator-panel { padding: 23px 25px 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; min-height: 31px; margin-bottom: 24px; }
.section-heading > div { display: flex; align-items: center; gap: 11px; }
.step-index { color: #98a095; font: 600 10px var(--display); }
.section-heading h2, .list-panel-heading h2 { margin: 0; font: 600 17px var(--display); letter-spacing: 0; }
.section-tag { color: #959c94; font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.calc-form { gap: 17px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field-note { color: #939991; font-size: 10px; font-weight: 400; line-height: 1.45; }
.calc-form .button { margin-top: 1px; }
.privacy-note { display: flex; align-items: center; gap: 8px; margin: -4px 0 0; color: #858d85; font-size: 10px; }
.privacy-note span { color: #739bd0; font-size: 9px; }
.result-panel { position: relative; min-height: 356px; display: flex; flex-direction: column; overflow: hidden; padding: 19px 22px 15px; border-color: var(--range-blue-line); background: var(--range-blue-wash); }
.result-topline { display: flex; justify-content: space-between; color: #5d7796; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.result-spark { color: #537cab; font-size: 18px; }
.empty-result { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 0 21px; text-align: center; }
.empty-orbit { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 17px; border: 1px solid #c2d2e2; border-radius: 50%; color: #547394; font-size: 24px; }
.empty-result h2 { margin: 0 0 8px; font: 600 19px/1.25 var(--display); }
.empty-result p { max-width: 195px; margin: 0; color: #78899c; font-size: 10px; line-height: 1.6; }
.calculated-result { padding: 26px 2px 7px; animation: appear .25s ease both; }
.result-label { color: #45688f; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.result-number { margin: 3px 0 12px; overflow-wrap: anywhere; color: var(--range-blue-dark); font: 600 clamp(43px, 5vw, 67px)/1.05 var(--display); letter-spacing: 0; }
.result-rule { height: 1px; margin-bottom: 12px; background: #cad8e6; }
.result-detail { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 0; color: #748398; font-size: 10px; }
.result-detail strong { color: #35485f; font-size: 10px; text-align: right; }
.result-detail #result-interval { color: var(--range-blue-ink); font-size: 14px; font-weight: 700; }
.copy-button { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 11px 0 3px; border: 0; border-top: 1px solid #cad8e6; background: transparent; color: #3e6187; cursor: pointer; font-size: 10px; font-weight: 700; }
.result-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--range-blue-line); color: #75869a; font-size: 9px; }
.result-footer .live-dot { width: 6px; height: 6px; flex-basis: 6px; }
.result-footer .live-dot { background: #5c86b4; box-shadow: 0 0 0 3px #5c86b422; }
.availability-strip { display: flex; align-items: center; gap: 24px; min-height: 90px; margin-top: 17px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.availability-title { min-width: 196px; display: flex; align-items: center; gap: 12px; }
.strip-marker { width: 8px; height: 26px; border-radius: 2px; background: var(--coral); }
.availability-title div { display: grid; gap: 5px; }
.availability-title strong { font-size: 11px; }
.availability-title span:not(.strip-marker) { color: #929990; font-size: 9px; }
.availability-list { display: flex; flex-wrap: wrap; gap: 8px; }
.range-chip { display: inline-flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid #dce6f0; border-radius: 4px; color: #5c675d; font-size: 9px; }
.range-chip strong { color: #303a31; font-size: 9px; }
.range-chip span { color: var(--range-blue-ink); font-size: 12px; font-weight: 600; }
.muted-text { color: #9ba198; font-size: 10px; }
.app-footer { display: flex; align-items: center; justify-content: space-between; min-height: 57px; margin-top: auto; color: #9ba098; font-size: 9px; }
.app-footer b { color: var(--coral); }
.app-footer span:last-child { color: #747d74; }

.admin-layout { display: grid; grid-template-columns: minmax(270px, .83fr) minmax(0, 1.17fr); gap: 16px; align-items: start; }
.admin-form-panel { padding: 22px 23px; }
.admin-form-panel .section-heading { margin-bottom: 21px; }
.admin-form-panel .form-stack { gap: 15px; }
.admin-form-panel .button { margin-top: 1px; }
.list-panel { min-height: 300px; padding: 22px 22px 15px; }
.list-panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.list-panel-heading h2 { margin-top: 7px; }
.count-pill { min-width: 27px; height: 25px; display: grid; place-items: center; border-radius: 4px; background: #edf3f9; color: #4c6f99; font: 600 10px var(--display); }
.data-list { display: grid; }
.data-row { min-height: 62px; display: flex; align-items: center; gap: 13px; border-top: 1px solid #edf0ea; }
.row-marker { width: 31px; height: 31px; display: grid; flex: 0 0 31px; place-items: center; border-radius: 50%; background: #edf3f9; color: #537aa8; font: 600 10px var(--display); }
.row-main { min-width: 0; display: grid; flex: 1; gap: 4px; }
.row-main strong { overflow: hidden; color: #333b34; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.row-main span { color: #939a92; font-size: 9px; }
#range-list .row-main span { color: var(--range-blue-ink); font-size: 12px; font-weight: 600; }
.row-actions { display: flex; align-items: center; gap: 5px; }
.text-action { padding: 6px 8px; border: 0; border-radius: 3px; background: transparent; color: #667b93; cursor: pointer; font-size: 9px; font-weight: 600; }
.text-action:hover { background: #edf3f9; color: #354c68; }
.text-action.danger { color: #b95e4e; }
.role-tag { padding: 5px 7px; border-radius: 3px; background: #edf3f9; color: #58769a; font-size: 8px; font-weight: 700; }
.role-tag.admin { background: #fcebe5; color: #a85d4c; }
.empty-list { padding: 38px 10px; color: #929990; text-align: center; font-size: 11px; }
.password-dialog { width: min(440px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 24px 80px #1c282633; }
.password-dialog::backdrop { background: #202a3677; backdrop-filter: blur(3px); }
.password-dialog form { padding: 24px; }
.dialog-top { display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-top h2 { margin: 7px 0 0; font: 600 21px var(--display); }
.dialog-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #edf2f7; cursor: pointer; font-size: 20px; line-height: 1; }
.dialog-user { margin: -2px 0 1px; color: #818981; font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.toast { position: fixed; right: 24px; bottom: 23px; z-index: 5; max-width: min(380px, calc(100% - 32px)); padding: 13px 17px; border-radius: 5px; background: #26374a; color: white; box-shadow: 0 7px 25px #1c282633; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; font-size: 11px; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (min-width: 1450px) { .main-content { padding-right: 7%; padding-left: 7%; } }
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 215px minmax(0, 1fr); }
  .main-content { padding-right: 28px; padding-left: 28px; }
  .calculator-layout { grid-template-columns: minmax(0, 1.05fr) minmax(250px, .85fr); }
  .calculator-panel { padding-right: 19px; padding-left: 19px; }
  .admin-layout { grid-template-columns: minmax(250px, .9fr) minmax(0, 1.1fr); }
}
@media (max-width: 760px) {
  .login-view { min-height: 100svh; grid-template-columns: 1fr; }
  .login-panel { width: min(100%, 520px); padding: 34px 27px 38px; }
  .login-copy { margin: 55px 0 28px; }
  .login-copy h1 { font-size: 42px; }
  .login-art { display: none; }
  .app-shell { min-height: 100svh; display: flex; flex-direction: column; }
  .sidebar { position: relative; top: auto; height: auto; min-height: 0; padding: 12px 18px 0; }
  .sidebar-brand { padding: 0 1px; font-size: 21px; }
  .sidebar-brand .brand-mark { width: 29px; height: 29px; font-size: 17px; }
  .workspace-label, .sidebar-bottom, .nav-section-label { display: none; }
  .side-nav { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; }
  #admin-navigation { display: flex; gap: 4px; }
  .nav-link { width: auto; min-height: 39px; flex: 0 0 auto; padding: 0 11px; font-size: 10px; }
  .nav-indicator { width: 6px; height: 6px; }
  .main-content { padding: 0 20px; }
  .topbar { min-height: 51px; }
  .topbar-meta { gap: 10px; }
  .topbar-date { display: none; }
  .page-view { padding-top: 27px; }
  .page-heading { margin-bottom: 23px; }
  .page-heading h1 { font-size: 30px; }
  .heading-mark { transform: scale(.83); transform-origin: right bottom; margin-right: 0; }
  .calculator-layout, .admin-layout { grid-template-columns: 1fr; }
  .calculator-panel { padding: 19px 17px 17px; }
  .calculator-layout { gap: 12px; }
  .result-panel { min-height: 290px; }
  .result-number { font-size: clamp(44px, 13vw, 64px); }
  .availability-strip { align-items: flex-start; flex-direction: column; gap: 15px; padding: 15px; }
  .availability-title { min-width: 0; }
  .availability-list { padding-left: 19px; }
  .app-footer { min-height: 48px; font-size: 8px; }
}
@media (max-width: 420px) {
  .main-content { padding: 0 14px; }
  .sidebar { padding-right: 14px; padding-left: 14px; }
  .nav-link { gap: 8px; padding: 0 9px; font-size: 9px; }
  .form-row { gap: 8px; }
  .form-stack input, .form-stack select { padding-right: 9px; padding-left: 9px; }
  .section-tag { display: none; }
  .app-footer span:last-child { display: none; }
}