:root {
    --bg: #eceef1;
    --surface: #ffffff;
    --surface-2: #f4f5f7;
    --hover: #f0f1f4;
    --selected: #eef0f3;
    --line: #e7e9ed;
    --ink: #1f2023;
    --ink-2: #5d6168;
    --ink-3: #9a9ea6;
    --accent: #ffdb4d;
    --accent-hover: #ffd21f;
    --accent-soft: #fff2bf;
    --link: #1a6dd8;
    --danger: #e5484d;
    --brand: #ff0000;
    --ok: #1f8a4c;
    --radius: 16px;
    --rail-w: 60px;
    --shadow: 0 12px 40px rgba(20, 24, 31, .16);
    color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; flex: none; }
a { color: var(--link); }
[hidden], .hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
.spinner {
    width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, .08); border-top-color: var(--ink-2);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 16px; border-radius: 10px; border: 0;
    background: var(--surface-2); font-weight: 550;
}
.btn:hover { background: var(--hover); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #1b1b1b; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-link { background: none; color: var(--ink-2); height: auto; padding: 8px; }
.icon-btn {
    display: inline-grid; place-items: center; width: 32px; height: 32px;
    border: 0; border-radius: 8px; background: none; color: var(--ink-2);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.input, .select {
    width: 100%; height: 42px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface); outline: none;
}
.input:focus, .select:focus { border-color: #c9ccd2; box-shadow: 0 0 0 3px rgba(255, 219, 77, .45); }
.login {
    min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 32px 16px;
}
.login-card {
    width: 100%; max-width: 380px; background: var(--surface); border-radius: 20px;
    padding: 32px 28px 24px; box-shadow: 0 10px 30px rgba(0, 0, 0, .06); text-align: center;
}
.login-brand h1 { margin: 12px 0 4px; font-size: 22px; font-weight: 650; }
.login-brand p { margin: 0 0 22px; }
.login-logo { width: 44px; height: 48px; }
.login-checking { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 0; }
.login-profile { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.login-avatar, .rail-avatar, .user-avatar {
    width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-soft); font-size: 22px; font-weight: 600; margin-bottom: 8px; overflow: hidden;
}
.login-avatar img, .rail-avatar img, .user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.login-profile-name { font-size: 17px; font-weight: 600; }
.login-profile-phone { margin-bottom: 16px; }
.login-tabs { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.login-tab { flex: 1; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font-weight: 500; }
.login-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.login-panel { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.login-panel p { margin: 0; }
.qr-box {
    width: 232px; height: 232px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.qr-box img, .qr-box canvas, .qr-box svg { width: 100% !important; height: auto !important; display: block; }
.login-status { min-height: 18px; margin: 14px 0 0; }
.login-error { margin: 10px 0 0; color: var(--danger); font-size: 13px; }
.login-foot { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.app { display: flex; height: 100vh; height: 100dvh; padding: 8px 8px 8px 0; }
.rail {
    width: var(--rail-w); flex: none; display: flex; flex-direction: column; align-items: center;
    padding: 6px 0 4px;
}
.rail-logo { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; }
.rail-logo img { width: 26px; height: 28px; }
.rail-services { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.rail-item {
    position: relative; display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: 12px; color: #4a4e55; text-decoration: none;
}
.rail-item svg { width: 28px; height: 28px; }
.rail-item:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.rail-item.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 4px rgba(0, 0, 0, .06); }
.rail-item .tip {
    position: absolute; left: 48px; top: 50%; transform: translateY(-50%); white-space: nowrap;
    background: #2a2c31; color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 6px;
    opacity: 0; pointer-events: none; z-index: 30;
}
.rail-item:hover .tip { opacity: 1; }
.rail-bottom { margin-top: auto; position: relative; }
.rail-avatar, .user-avatar { width: 34px; height: 34px; margin: 0; font-size: 13px; color: #5a4700; border: 0; padding: 0; }
.user-avatar { width: 44px; height: 44px; font-size: 16px; }
.user-menu {
    position: absolute; left: 46px; bottom: 0; width: 230px; background: var(--surface);
    border-radius: 14px; box-shadow: var(--shadow); padding: 12px; z-index: 40;
}
.user-menu-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.user-menu-name { font-weight: 600; }
.user-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0;
    border-radius: 8px; background: none; text-align: left;
}
.user-menu-item:hover { background: var(--hover); }
.workspace {
    flex: 1; min-width: 0; background: var(--surface); border-radius: var(--radius);
    overflow: auto; box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.desk, .public { padding: 22px 28px 32px; max-width: 1120px; }
.public { max-width: 520px; margin-left: auto; margin-right: auto; }
.desk-head, .public-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.desk-head h2, .public-head h2 { margin: 0; font-size: 22px; font-weight: 650; }
.desk-head p, .public-head p { margin: 4px 0 0; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; container-type: inline-size; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.card h3.subhead { margin-top: 18px; }
.currency-field { max-width: 180px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0 4px; cursor: pointer; }
.switch-title { display: block; font-weight: 650; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.switch > span { display: block; width: 44px; height: 26px; border-radius: 999px; background: #d7dae0; transition: background .15s; }
.switch > span::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); transition: transform .15s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(255, 219, 77, .55); }
.guest-fields { max-width: none; margin-top: 4px; }
.guest-fields .input { height: 48px; font-size: 16px; }
.guest-or {
    display: flex; align-items: center; gap: 12px; margin: 14px 0;
    color: var(--ink-3); font-size: 13px;
}
.guest-or::before, .guest-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.guest-signin { min-height: 48px; height: auto; font-size: 16px; padding: 10px 16px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 16px; }
.step-pip {
    border: 0; background: none; padding: 0; color: var(--ink-3); font-size: 11px; font-weight: 650;
    text-align: center; line-height: 1.2;
}
.summary { display: flex; flex-direction: column; gap: 12px; margin: 0 0 16px; }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.summary-row span { color: var(--ink-2); font-size: 13px; }
.summary-row strong { text-align: right; font-size: 15px; }
.step-pip::before {
    content: ""; display: block; height: 4px; border-radius: 99px; background: var(--line); margin-bottom: 6px;
}
.step-pip.on { color: var(--ink); }
.step-pip.on::before { background: var(--accent); }
.step-pip:disabled { cursor: default; }
.choice {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 56px; margin: 0 0 8px; padding: 12px 14px; text-align: left;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.choice strong { display: block; font-size: 15px; }
.choice.on { border-color: #e6c200; background: var(--accent-soft); }
.visit-summary { display: flex; flex-direction: column; gap: 2px; margin: 0 0 14px; }
.book-as { margin: 0 0 14px; font-weight: 650; }
.wizard-nav { display: flex; gap: 8px; margin-top: 8px; }
.wizard-nav .btn { flex: 1; height: 48px; font-size: 16px; }
.public .slot { height: 44px; font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12.5px; color: var(--ink-2); }
.link-row { display: flex; gap: 8px; }
.link-row .input { flex: 1; }
.hour-row, .service-row, .appt-row {
    display: grid; align-items: center; gap: 8px; margin-bottom: 8px;
}
.hour-row { grid-template-columns: 32px minmax(0, 1fr) 12px minmax(0, 1fr) max-content; }
.hour-row .input { min-width: 0; height: 36px; padding: 0 8px; }
.closed { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.service-row { grid-template-columns: minmax(0, 1fr) 80px 72px 32px; }
.service-row .input, .service-row .select { padding-left: 8px; padding-right: 8px; }
@container (min-width: 480px) {
    .service-row { grid-template-columns: minmax(0, 1fr) 108px 96px 36px; }
}
.s-price { text-align: right; }
.addon-picks { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.addon-pick { display: flex; align-items: flex-start; gap: 8px; }
.addon-pick input { margin-top: 3px; }
.total-line { margin: 0 0 14px; font-weight: 650; }
.appt-price { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 400; }
.appt-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.appt-row {
    grid-template-columns: 1fr auto auto; padding: 10px 12px; border-radius: 12px; background: var(--surface-2);
}
.appt-row strong { display: block; }
.slot-days { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 16px; }
.slot-day { font-weight: 650; margin-bottom: 8px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
    height: 36px; min-width: 72px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface);
}
.slot.on { background: var(--accent); border-color: transparent; font-weight: 650; }
.done { padding: 18px; border-radius: 14px; background: #e8f7ee; color: var(--ok); margin-bottom: 16px; }
.footer {
    display: flex; justify-content: space-between; align-items: center; margin-top: 22px;
    font-size: 12px; color: var(--ink-3);
}
.footer a { color: var(--ink-3); text-decoration: none; }
.lang-btn { border: 0; background: none; color: var(--ink-3); font-size: 12px; padding: 2px 4px; border-radius: 4px; text-transform: uppercase; }
.lang-btn:hover, .lang-btn[aria-expanded="true"] { color: var(--ink); background: var(--hover); }
.lang-menu {
    position: fixed; z-index: 90; width: 210px; max-height: min(360px, calc(100vh - 24px));
    overflow: auto; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 6px;
}
.lang-option {
    display: flex; width: 100%; text-align: left; border: 0; background: none;
    padding: 8px 10px; border-radius: 8px; font-size: 14px;
}
.lang-option:hover { background: var(--hover); }
.lang-option.active { background: var(--accent-soft); font-weight: 600; }
.dialog-backdrop {
    position: fixed; inset: 0; background: rgba(20, 22, 26, .35); display: grid; place-items: center; z-index: 80;
}
.dialog { width: min(420px, calc(100% - 32px)); background: var(--surface); border-radius: 16px; padding: 20px; }
.dialog p { margin: 0 0 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
    background: #2a2c31; color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 70;
}
@media (max-width: 800px) {
    .cards { grid-template-columns: 1fr; }
    .desk, .public { padding: 16px; }
    .app.is-public { padding: 0; }
    .app.is-public .rail { display: none; }
    .hour-row { grid-template-columns: 72px 1fr 1fr; }
    .hour-row .dash { display: none; }
    .service-row { grid-template-columns: minmax(0, 1fr) 76px 64px 32px; }
    .rail-item .tip { display: none; }
}
