/* Зубной Архитектор · AI CAD */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/onest-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/onest-latin.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; }

:root {
  --ink: #16233b; --text: #3a4559; --muted: #6b7588; --line: #e2e6ee; --line2: #eef1f6;
  --bg: #f3f5f8; --card: #fff; --primary: #2148c9; --primary-d: #1a3aa6; --primary-l: #e8eefc;
  --enamel: #f3e8cf; --green: #17885a; --green-l: #e3f5ec; --red: #c93b3b; --red-l: #fbe9e9;
  --amber: #9a6a12; --amber-l: #fbf1dc; --radius: 12px; --side: 92px; --top: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 "Onest", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.t-right { text-align: right; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.boot { display: grid; place-items: center; height: 100vh; }

/* ---------- оболочка ---------- */
.app { min-height: 100vh; }
.top { position: fixed; inset: 0 0 auto 0; height: var(--top); background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 20px; gap: 14px; z-index: 20; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.logo__icon { height: 30px; width: auto; }
.logo__tooth { fill: none; stroke: var(--ink); stroke-width: 4.4; stroke-linejoin: round; }
.logo__dim { stroke: var(--primary); stroke-width: 3.8; }
.logo__arrow { fill: var(--primary); }
.logo__text { font-weight: 650; font-size: 15px; line-height: 1.05; display: flex; flex-direction: column; }
.logo__text small { font-size: 11px; font-weight: 600; color: var(--primary); letter-spacing: .08em; }
.logo--lg .logo__icon { height: 40px; }
.logo--lg .logo__text { font-size: 18px; }
.top__sep { width: 1px; height: 22px; background: var(--line); }
.top__title { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--primary-l); color: var(--primary-d); font-size: 14px; text-decoration: none !important; white-space: nowrap; }
.top__role { font-size: 13px; color: var(--muted); }
.pill b { font-variant-numeric: tabular-nums; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 650; text-decoration: none !important; }
.side { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); background: #fff; border-right: 1px solid var(--line); padding: 16px 8px; display: flex; flex-direction: column; gap: 6px; z-index: 10; overflow-y: auto; }
.side__item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 10px; color: var(--text); font-size: 12.5px; text-align: center; line-height: 1.2; text-decoration: none !important; transition: background .15s, color .15s; }
.side__item .ico { width: 22px; height: 22px; }
.side__item:hover { background: var(--bg); color: var(--ink); }
.side__item.is-on { background: var(--ink); color: #fff; }
.main { margin: var(--top) 0 0 var(--side); padding: 24px; max-width: 1440px; }

/* ---------- элементы ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad, .pad { padding: 22px 24px; }
.card + .card, .card + .sec-head, .tiles + .notice, .notice + .sec-head { margin-top: 18px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 26px 0 12px; flex-wrap: wrap; }
.sec-head:first-child { margin-top: 0; }
.sec-head h1, .sec-head h2 { margin: 0; }
.sec-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sec-head__tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; margin-bottom: 6px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn .ico { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--primary-d); }
.btn--outline { background: #fff; border-color: var(--ink); color: var(--ink); }
.btn--outline:hover:not(:disabled) { background: var(--ink); color: #fff; }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn--ghost:hover:not(:disabled) { border-color: #c7cfdc; color: var(--ink); }
.btn--danger { background: var(--red); color: #fff; }
.danger-text { color: var(--red) !important; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0 4px; font-size: 13px; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.input, select, .field input, .field textarea { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input, .field textarea { height: auto; padding: 10px 12px; resize: vertical; }
select { width: auto; padding-right: 30px; height: 36px; }
.input:focus, select:focus, .field input:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.input--num { width: 110px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13.5px; font-weight: 550; color: var(--ink); margin-bottom: 6px; }
.check { display: flex; gap: 8px; font-size: 13.5px; align-items: flex-start; margin-bottom: 12px; }
.check input { margin-top: 3px; }
.form-err { color: var(--red); font-size: 14px; min-height: 1.2em; margin: 0 0 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row-end { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 550; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--wait { background: var(--amber-l); color: var(--amber); }
.badge--work { background: var(--primary-l); color: var(--primary); }
.badge--done { background: var(--green-l); color: var(--green); }
.badge--fail { background: var(--red-l); color: var(--red); }
.chip { display: inline-block; padding: 2px 9px; margin: 2px 0; border-radius: 6px; font-size: 13px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.chip--crown { border-color: #b8c8f5; background: var(--primary-l); }
.chip--inlay { border-color: #c4e6d5; background: var(--green-l); }
.chip--veneer { border-color: #f0dca8; background: var(--amber-l); }
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; background: var(--primary-l); color: var(--ink); font-size: 14px; }
.notice > span { flex: 1; }
.notice--warn { background: var(--amber-l); color: #5b4108; }
.notice--err { background: var(--red-l); color: #7c1f1f; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg__btn { border: 0; background: none; padding: 6px 14px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--text); white-space: nowrap; }
.seg__btn input { position: absolute; opacity: 0; pointer-events: none; }
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-on { background: var(--ink); color: #fff; }
.seg--sm .seg__btn { padding: 5px 11px; font-size: 13.5px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs__item { padding: 10px 14px; color: var(--text); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; }
.tabs__item.is-on { color: var(--primary); border-color: var(--primary); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--primary-l); border-top-color: var(--primary); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 8px; border-radius: 9px; background: var(--line2); overflow: hidden; margin: 12px 0 6px; }
.bar i { display: block; height: 100%; background: var(--primary); transition: width .2s; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 90vw; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind="err"] { background: var(--red); }
.modal { position: fixed; inset: 0; background: rgba(22, 35, 59, .45); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal__box { background: #fff; border-radius: 14px; padding: 24px; width: min(460px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.modal__err { color: var(--red); font-size: 14px; min-height: 1em; margin: 0; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; color: var(--muted); }
.empty .ico { width: 40px; height: 40px; stroke-width: 1.2; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; margin: 0 0 12px; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; color: var(--ink); }
.kv--tight { gap: 6px 12px; font-size: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #b8c4d6; }
.dot--upper { background: #e9dcc0; border: 1px solid #c9b78f; }
.dot--lower { background: #d9cfbd; border: 1px solid #b0a385; }
.dot--result { background: #2f5fe0; }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth__art { background: var(--ink) radial-gradient(circle at 20% 110%, #2148c9 0, transparent 55%); color: #fff; display: flex; align-items: center; padding: 48px; }
.auth__pitch { max-width: 520px; }
.auth__pitch h1 { color: #fff; font-size: 40px; margin-bottom: 24px; }
.auth__kicker { color: #9fb4f0; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; }
.auth__pitch ul { padding: 0; list-style: none; display: grid; gap: 12px; color: #d6deef; }
.auth__pitch li { padding-left: 26px; position: relative; }
.auth__pitch li::before { content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 2px; background: var(--enamel); }
.auth__card { align-self: center; justify-self: center; width: min(420px, calc(100% - 32px)); background: #fff; padding: 32px; border-radius: 16px; border: 1px solid var(--line); margin: 32px 0; }
.auth__card h2 { margin: 26px 0 18px; }
.auth__alt { text-align: center; font-size: 14px; margin: 16px 0 0; }

/* ---------- панель ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px; }
.tile { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: 10px; background: var(--bg); color: var(--ink); text-decoration: none !important; transition: background .15s, transform .15s; }
.tile:hover { background: #eaeef5; }
.tile > .ico { margin-left: auto; color: var(--muted); }
.tile__ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--primary); flex: none; }
.tile__ico .ico { width: 28px; height: 28px; }
.tile__ico--done { color: var(--green); }
.tile__body { display: flex; flex-direction: column; }
.tile__label { color: var(--muted); font-size: 14px; }
.tile__n { font-size: 32px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile__n--blue { color: var(--primary); }
.tile__n--green { color: var(--green); }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 650; color: var(--ink); padding: 14px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13.5px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table tbody tr:hover td { background: #fafbfd; }
.table tr.is-off td { opacity: .5; }
.table .plus { color: var(--green); font-weight: 600; }
.table .minus { color: var(--red); font-weight: 600; }
.w-check { width: 40px; }
.link-strong { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.table-foot { display: flex; align-items: center; gap: 16px; padding: 12px 16px; }
.pager { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.filters { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; height: 36px; flex: 1 1 240px; max-width: 340px; color: var(--muted); }
.search input { border: 0; outline: none; flex: 1; min-width: 0; height: 100%; background: none; }
.is-loading { opacity: .6; transition: opacity .2s; }
.price-table td { padding: 16px 18px; }

/* ---------- AI Дизайн ---------- */
.design-hero { padding: 32px; }
.design-hero h1 { font-size: 30px; }
.lead { font-size: 16.5px; color: var(--muted); margin-bottom: 26px; }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.svc { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; background: #fff; transition: border-color .15s, box-shadow .15s; }
.svc:hover { border-color: #c4cfe4; box-shadow: 0 8px 28px rgba(22, 35, 59, .07); }
.svc__art { height: 170px; display: grid; place-items: center; background: linear-gradient(180deg, #f6f1e4, #efe5cd); }
.svc__art svg { width: 78%; max-height: 140px; }
.svc--main .svc__art { background: linear-gradient(180deg, #e9effd, #d8e3fb); }
.svc__body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.svc__body h2 { font-size: 20px; }
.svc--main h2 { color: var(--primary); }
.svc__body p { color: var(--muted); font-size: 14.5px; flex: 1; }
.svc__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.a-gum { fill: #e9a7a0; } .a-tooth { fill: #fbf7ee; stroke: #b9ab8a; stroke-width: 2; }
.a-crown { fill: #6f8fe8; stroke: #2148c9; stroke-width: 2; } .a-margin { stroke: #2148c9; stroke-width: 3; stroke-dasharray: 6 5; fill: none; }
.a-arrow { stroke: #16233b; stroke-width: 3; stroke-linecap: round; fill: none; } .a-base { fill: #dfe6f3; stroke: #9aa9c4; stroke-width: 2; }
.a-hex { fill: none; stroke: #9aa9c4; stroke-width: 1.6; }

/* ---------- мастер ---------- */
.wiz__head { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line2); font-weight: 650; font-size: 13px; }
.steps li.is-on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.steps li.is-on span { background: var(--ink); color: #fff; }
.steps li.is-done span { background: var(--green); color: #fff; }
.wiz__name { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.wiz__name .input { width: 260px; height: 38px; }
.wiz__body { display: grid; grid-template-columns: 1fr 460px; min-height: 620px; overflow: hidden; }
.wiz__viewer { position: relative; border-right: 1px solid var(--line); background: #f7f8fb; }
.wiz__panel { padding: 20px; overflow-y: auto; max-height: calc(100vh - 230px); }
.panel__title { font-weight: 650; color: var(--ink); font-size: 16px; }
.wiz__foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; }
.wiz__foot .form-err { margin: 0 auto 0 0; }
.wiz.is-drag .wiz__body { outline: 3px dashed var(--primary); outline-offset: -3px; }
.viewer { position: absolute; inset: 0; }
.viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.viewer__empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); pointer-events: none; text-align: center; padding: 20px; }
.viewer__empty .ico { width: 44px; height: 44px; stroke-width: 1.3; margin-bottom: 8px; }
.vbar { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 6px; background: #fff; padding: 6px; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(22, 35, 59, .06); }
.vbar__btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.vbar__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.vbar__btn svg .fill { fill: currentColor; stroke: none; }
.vbar__btn:hover { background: var(--bg); }
.vbar__btn.is-on { background: var(--primary-l); color: var(--primary); }
.layers { position: absolute; top: 14px; left: 14px; display: flex; flex-direction: column; gap: 6px; }
.layer { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .92); padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.slot { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.slot__head { display: flex; justify-content: space-between; padding: 9px 14px; background: var(--bg); font-weight: 600; color: var(--ink); font-size: 14px; }
.slot__body { display: flex; align-items: center; gap: 12px; padding: 14px; }
.slot__body > .ico { color: var(--muted); }
.slot__text { flex: 1; display: flex; flex-direction: column; font-size: 14px; min-width: 0; }
.slot__text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.slot.is-full { border-color: #b8c8f5; }
.slot.is-full .slot__head { background: var(--primary-l); }
.extra { list-style: none; margin: 0; padding: 0 14px 12px; font-size: 13px; display: grid; gap: 4px; }
.jaw-pick { display: flex; gap: 10px; margin-bottom: 18px; }
.check-card { flex: 1; display: flex; gap: 8px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.check-card:has(input:checked) { border-color: var(--primary); background: var(--primary-l); }

/* зубная формула */
.seg--types { margin-bottom: 16px; }
.seg--types .seg__btn::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.type-dot--crown::before { background: var(--primary); } .type-dot--inlay::before { background: var(--green); }
.type-dot--veneer::before { background: #d39b1c; } .type-dot--pontic::before { background: #8a6bd6; }
.chart { display: flex; flex-direction: column; gap: 6px; }
.chart__jaw { display: flex; flex-direction: column; gap: 4px; }
.chart__label { font-size: 12px; color: var(--muted); text-align: center; }
.chart__row { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; }
.chart__row .tooth:nth-child(8) { margin-right: 4px; }
.chart__mid { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 2px; }
.tooth { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 0; cursor: pointer; color: var(--ink); min-width: 0; }
.tooth:hover:not(:disabled) { background: var(--bg); }
.tooth:disabled { cursor: default; }
.tooth__svg { width: 100%; max-width: 26px; height: 30px; fill: #fff; stroke: #9aa6bd; stroke-width: 1.4; }
.tooth__svg.is-lower { transform: scaleY(-1); }
.tooth__n { font-size: 10.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.tooth__tag { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 9.5px; font-weight: 700; color: #fff; pointer-events: none; }
.tooth--crown .tooth__svg { fill: var(--primary); stroke: var(--primary-d); }
.tooth--inlay .tooth__svg { fill: var(--green); stroke: #0f6643; }
.tooth--veneer .tooth__svg { fill: #d39b1c; stroke: #a87810; }
.tooth--pontic .tooth__svg { fill: #8a6bd6; stroke: #6a4cb6; }
.tooth[aria-pressed="true"] .tooth__n { color: var(--ink); font-weight: 650; }
.chart__sum { font-size: 14px; margin-top: 14px; padding: 10px 12px; background: var(--bg); border-radius: 8px; }

/* параметры */
.pform fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px 4px; margin: 0 0 14px; }
.pform legend { font-weight: 650; color: var(--ink); padding: 0 6px; }
.pf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.pf:last-child { border-bottom: 0; }
.pf__label { font-size: 14px; color: var(--ink); }
.pf .seg { flex-wrap: nowrap; flex: none; }
label.pf .input { width: 190px; height: 36px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; height: 36px; flex: none; }
.stepper button { width: 34px; height: 100%; border: 0; background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.stepper button:hover { background: var(--bg); }
.stepper button .ico { width: 16px; height: 16px; }
.stepper input { width: 62px; height: 100%; border: 0; border-left: 1px solid var(--line); text-align: right; padding: 0 4px; outline: none; -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper__unit { width: 34px; padding-left: 4px; font-size: 13px; color: var(--muted); border-right: 1px solid var(--line); height: 100%; display: flex; align-items: center; }
.params { display: grid; grid-template-columns: 460px 1fr; gap: 20px; align-items: start; }
.params__actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.params__art { display: grid; place-items: center; padding: 24px; min-height: 520px; }
.diagram { width: 100%; max-width: 560px; }
.d-stump { fill: #efe2c4; stroke: #b9ab8a; stroke-width: 2; }
.d-gap { fill: none; stroke: #e9a7a0; stroke-width: 6; }
.d-crown { fill: #dce6fb; stroke: var(--primary); stroke-width: 2.5; }
.d-occl { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 5; }
.d-base { fill: #eceff4; stroke: #b5bfce; stroke-width: 2; }
.d-lbl path { stroke: var(--ink); stroke-width: 1.2; fill: none; }
.d-lbl text { font-size: 14px; fill: var(--ink); }

/* заказ */
.order { display: grid; grid-template-columns: 1fr 420px; gap: 20px; align-items: start; }
.order__view { position: sticky; top: calc(var(--top) + 20px); height: calc(100vh - var(--top) - 140px); min-height: 480px; overflow: hidden; background: #f7f8fb; }
.order__side { display: flex; flex-direction: column; gap: 16px; }
.order__side .card + .card { margin-top: 0; }
.files { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 9px; }
.files li > .ico { color: var(--muted); }
.files li span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.files small { color: var(--muted); font-size: 12.5px; }
.comment-box { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; }
.params-details summary { cursor: pointer; color: var(--primary); font-size: 14px; margin-bottom: 8px; }
.progress-state { display: flex; gap: 14px; align-items: flex-start; }
.progress-state p { margin: 2px 0 0; }
.log { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; max-height: 340px; overflow-y: auto; font-size: 14px; }
.log li { padding: 8px 10px; border-radius: 8px; background: var(--bg); white-space: pre-wrap; }
.log__event { background: none !important; padding: 2px 0 !important; color: var(--muted); font-size: 13px; }
.log__comment.is-staff { background: var(--primary-l); }
.log__meta { display: block; font-size: 12px; color: var(--muted); }
.comment-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.staff { border-color: #b8c8f5; background: #fbfcff; }
.staff h3 { display: flex; gap: 8px; align-items: center; color: var(--primary-d); }
.staff__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.drop { display: flex; gap: 12px; align-items: center; padding: 16px; border: 2px dashed #b8c8f5; border-radius: 10px; cursor: pointer; color: var(--primary-d); margin-bottom: 12px; }
.drop span { display: flex; flex-direction: column; font-weight: 600; }
.drop small { font-weight: 400; color: var(--muted); }
.drop:hover { background: var(--primary-l); }

/* пополнение и аккаунт */
.buy { max-width: 1000px; margin: 0 auto; text-align: center; padding-top: 12px; }
.buy h1 { font-size: 30px; }
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 30px 0 20px; align-items: end; }
.pack { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px 24px; text-align: left; }
.pack--hot { border: 2px solid var(--primary); padding-top: 40px; }
.pack__flag { position: absolute; top: 0; left: 0; right: 0; background: var(--primary); color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 5px; border-radius: 13px 13px 0 0; }
.pack h3 { font-weight: 600; }
.pack__n { color: var(--muted); }
.pack__price { font-size: 32px; font-weight: 700; color: var(--ink); margin: 18px 0 2px; font-variant-numeric: tabular-nums; }
.pack .btn { margin-top: 18px; }
.account { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.account .card + .card { margin-top: 0; }
.account .wide { grid-column: 1 / -1; }
.account .wide h3 { margin-top: 24px; }
.balance__n { font-size: 15px; color: var(--muted); }
.balance__n b { font-size: 44px; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 4px; }
.balance .btn + .btn { margin-top: 10px; }

/* ---------- адаптив ---------- */
@media (max-width: 1200px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .wiz__body, .order { grid-template-columns: 1fr; }
  .wiz__viewer { height: 420px; border-right: 0; border-bottom: 1px solid var(--line); }
  .wiz__panel { max-height: none; }
  .order__view { position: relative; top: 0; height: 460px; }
  .params { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: 1fr; }
  .svc { flex-direction: row; } .svc__art { width: 240px; height: auto; flex: none; }
}
@media (max-width: 760px) {
  :root { --side: 0px; }
  .side { top: auto; bottom: 0; width: 100%; height: 64px; flex-direction: row; padding: 4px; border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; }
  .side__item { flex: 1 0 54px; padding: 6px 2px; font-size: 10.5px; }
  .main { padding: 16px 12px 84px; }
  .top { padding: 0 12px; } .top__sep, .top__title { display: none; } .logo__text { font-size: 13px; }
  .tiles { grid-template-columns: 1fr 1fr; padding: 12px; gap: 10px; } .tile { padding: 14px; gap: 10px; } .tile__ico { width: 40px; height: 40px; } .tile > .ico { display: none; } .tile__n { font-size: 26px; }
  .auth { grid-template-columns: 1fr; } .auth__art { display: none; }
  .grid2, .account { grid-template-columns: 1fr; }
  .svc { flex-direction: column; } .svc__art { width: auto; height: 140px; }
  .wiz__name { margin-left: 0; width: 100%; } .wiz__name .input { flex: 1; width: auto; }
  .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; }
  .pf { flex-wrap: wrap; }
  .tooth__n { font-size: 8.5px; }
}
