/* Общие стили прототипа — токены дизайн-системы PMD (shadcn neutral, ч/б) */
:root{
  --background:#ffffff;--foreground:#0a0a0a;--muted:#f5f5f5;--muted-foreground:#737373;
  --border:#e5e5e5;--input:#e5e5e5;--primary:#171717;--primary-foreground:#fafafa;
  --secondary:#f5f5f5;--destructive:#e7000b;--ring:#a1a1a1;--radius:10px;
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Helvetica Neue",Roboto,"Segoe UI",system-ui,sans-serif;
}
*{box-sizing:border-box}
body{margin:0;font-family:var(--font);color:var(--foreground);-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
a{color:inherit;text-decoration:none}

/* каркас экрана 390×844 */
.app{position:relative;width:390px;height:844px;display:flex;flex-direction:column;overflow:hidden;background:var(--background);font-family:var(--font);color:var(--foreground);font-size:16px;line-height:1.35}
.app.grouped{background:var(--muted)}
.scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden}

/* шапка */
.bar{flex:none;display:flex;align-items:center;min-height:56px;padding:6px 4px 2px}
.bar-title{flex:1;min-width:0;text-align:center;font-size:17px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bar-gap{width:44px;height:44px;flex:none}
.large-title{margin:0;padding:2px 16px 10px;font-size:32px;font-weight:700;letter-spacing:-0.02em;line-height:1.15}
.iconbtn{flex:none;width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:999px;background:transparent;cursor:pointer;color:var(--foreground)}
.iconbtn:active{background:var(--muted)}
.textbtn{flex:none;height:44px;padding:0 12px;display:inline-flex;align-items:center;border:0;background:transparent;font-size:16px;font-weight:500;cursor:pointer;color:var(--foreground)}

/* иконки lucide */
.i{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.i16{width:16px;height:16px}
.i24{width:24px;height:24px}
.i28{width:28px;height:28px;stroke-width:1.75}
.chev{color:#a3a3a3}

/* типографика */
.title{margin:0;font-size:24px;font-weight:600;letter-spacing:-0.01em;line-height:1.2}
.headline{font-size:17px;font-weight:600}
.callout{font-size:15px}
.footnote{font-size:13px;color:var(--muted-foreground);line-height:1.4}
.muted{color:var(--muted-foreground)}
.num{font-variant-numeric:tabular-nums}
.strike{text-decoration:line-through}

/* списки */
.list-h{padding:18px 16px 6px;font-size:13px;font-weight:500;color:var(--muted-foreground)}
.sec-h{padding:22px 32px 7px;font-size:13px;color:var(--muted-foreground)}
.sec-f{padding:7px 32px 0;font-size:13px;color:var(--muted-foreground);line-height:1.4}
.section{margin:0 16px;background:var(--background);border-radius:14px;overflow:hidden}
.row{position:relative;display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:11px 16px;border:0;background:transparent;text-align:left;cursor:pointer;color:inherit}
.row:active{background:var(--muted)}
.row + .row::before,.row + .opt::before,.opt + .row::before{content:"";position:absolute;top:0;left:var(--inset,16px);right:0;height:1px;background:var(--border)}
.static{cursor:default}
.static:active{background:transparent}
.row-icon{width:36px;height:36px;border-radius:10px;background:var(--muted);display:flex;align-items:center;justify-content:center;flex:none}
.row-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.row-title{font-size:16px;line-height:1.3}
.row-sub{font-size:13px;color:var(--muted-foreground);line-height:1.35}
.row-val{flex:none;color:var(--muted-foreground);font-size:16px;text-align:right}
.row-strong{flex:none;font-size:16px;font-weight:600;text-align:right}
.danger{color:var(--destructive)}

/* кнопки */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 16px;border-radius:8px;border:1px solid transparent;font-size:16px;font-weight:500;line-height:1;cursor:pointer;white-space:nowrap;text-align:center}
.btn:active{opacity:.8}
.btn-lg{height:52px;font-size:17px;border-radius:10px}
.btn-sm{height:36px;padding:0 12px;font-size:14px}
.btn-primary{background:var(--primary);color:var(--primary-foreground)}
.btn-outline{background:var(--background);border-color:var(--border);color:var(--foreground)}
.btn-secondary{background:var(--secondary);color:var(--foreground)}
.btn-ghost{background:transparent;color:var(--foreground)}
.btn-destructive{background:var(--destructive);color:#fff}
.btn[disabled]{opacity:.5;cursor:default}
.block{width:100%}
.actionbar{flex:none;display:flex;flex-direction:column;gap:8px;padding:12px 16px 28px;background:var(--background);border-top:1px solid var(--border)}
.actionbar-row{display:flex;gap:8px}
.actionbar-row > *{flex:1}

/* таб-бар и FAB */
.tabbar{flex:none;display:flex;background:var(--background);border-top:1px solid var(--border);padding:4px 8px 24px}
.tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:50px;font-size:11px;font-weight:500;color:var(--muted-foreground);border:0;background:transparent;cursor:pointer}
.tab[aria-current="page"]{color:var(--foreground)}
.tab[aria-current="page"] .i{stroke-width:2.5}
.fab{position:absolute;right:16px;bottom:100px;z-index:5;display:inline-flex;align-items:center;gap:8px;height:56px;padding:0 22px 0 18px;border:0;border-radius:999px;background:var(--primary);color:var(--primary-foreground);font-size:16px;font-weight:600;box-shadow:0 6px 16px rgba(0,0,0,.18);cursor:pointer}

/* переключатель */
.switch{position:relative;width:51px;height:31px;border-radius:999px;background:#e5e5e5;border:0;padding:0;flex:none;cursor:pointer;transition:background .15s}
.switch::after{content:"";position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:999px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .15s}
.switch[aria-checked="true"]{background:var(--foreground)}
.switch[aria-checked="true"]::after{transform:translateX(20px)}

/* бейджи, чипсы, переключатели */
.badge{display:inline-flex;align-items:center;gap:4px;height:24px;padding:0 9px;border-radius:999px;font-size:12px;font-weight:500;white-space:nowrap;flex:none}
.badge-outline{border:1px solid var(--border);color:var(--foreground)}
.badge-soft{background:var(--muted);color:var(--foreground)}
.badge-solid{background:var(--primary);color:var(--primary-foreground)}
.badge-dashed{border:1px dashed #b5b5b5;color:var(--muted-foreground)}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{display:inline-flex;align-items:center;gap:6px;height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--border);background:var(--background);font-size:15px;cursor:pointer}
.chip[aria-pressed="true"]{border-color:var(--foreground);box-shadow:inset 0 0 0 1px var(--foreground);font-weight:600}
.tile{display:flex;align-items:center;gap:10px;min-height:52px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--background);text-align:left;font-size:15px;cursor:pointer}
.tile[aria-pressed="true"]{border-color:var(--foreground);box-shadow:inset 0 0 0 1px var(--foreground);font-weight:600}
.seg{display:flex;gap:2px;padding:3px;border-radius:10px;background:#ececec}
.seg > button{flex:1;height:36px;border:0;border-radius:8px;background:transparent;font-size:14px;font-weight:500;color:#5c5c5c;cursor:pointer}
.seg > button[aria-pressed="true"]{background:var(--background);color:var(--foreground);font-weight:600;box-shadow:0 1px 3px rgba(0,0,0,.12)}

/* поля */
.card{margin:0 16px;padding:16px;background:var(--background);border-radius:14px;display:flex;flex-direction:column;gap:14px}
.field{display:flex;flex-direction:column;gap:6px}
.label{font-size:15px;font-weight:500}
.input{width:100%;height:44px;padding:0 12px;border:1px solid var(--input);border-radius:8px;background:var(--background);font-size:16px;outline:none}
.input:focus{border-color:var(--ring);box-shadow:0 0 0 3px rgba(161,161,161,.35)}
.input::placeholder{color:#a3a3a3}
.input[aria-invalid="true"]{border-color:var(--destructive)}
textarea.input{height:auto;min-height:72px;padding:10px 12px;resize:none;line-height:1.4}
.field-error{font-size:13px;color:var(--destructive)}
.unit{position:relative}
.unit .input{padding-right:44px}
.unit > span{position:absolute;right:12px;top:50%;transform:translateY(-50%);color:var(--muted-foreground);font-size:15px;pointer-events:none}
.big .input{height:56px;font-size:22px;font-weight:600;font-variant-numeric:tabular-nums}
.stepper{display:inline-flex;align-items:center;border:1px solid var(--border);border-radius:8px;overflow:hidden;flex:none}
.stepper button{width:40px;height:40px;border:0;background:transparent;display:flex;align-items:center;justify-content:center;cursor:pointer}
.stepper button:active{background:var(--muted)}
.stepper output{min-width:30px;text-align:center;font-weight:600;font-variant-numeric:tabular-nums}

/* варианты-радио */
.opt{position:relative;display:flex;gap:12px;align-items:flex-start;width:100%;padding:14px 16px;border:0;background:transparent;text-align:left;cursor:pointer}
.opt + .opt::before{content:"";position:absolute;top:0;left:50px;right:0;height:1px;background:var(--border)}
.opt:active{background:var(--muted)}
.radio{width:22px;height:22px;border-radius:999px;border:2px solid #c4c4c4;flex:none;margin-top:1px;display:flex;align-items:center;justify-content:center}
.opt[aria-pressed="true"] .radio{border-color:var(--foreground)}
.opt[aria-pressed="true"] .radio::after{content:"";width:10px;height:10px;border-radius:999px;background:var(--foreground)}

/* шторка и тост */
.backdrop{position:absolute;inset:0;z-index:20;width:100%;background:rgba(0,0,0,.4);border:0;padding:0;cursor:default}
.sheet{position:absolute;left:0;right:0;bottom:0;z-index:21;max-height:88%;overflow-y:auto;display:flex;flex-direction:column;gap:14px;padding:8px 16px 32px;background:var(--background);border-radius:16px 16px 0 0}
.grip{align-self:center;width:36px;height:5px;border-radius:3px;background:#d4d4d4}
.sheet-title{margin:0;text-align:center;font-size:17px;font-weight:600}
.sheet-text{margin:-6px 0 0;text-align:center;font-size:15px;color:var(--muted-foreground);line-height:1.45}
.sheet .section{margin:0;border:1px solid var(--border)}
.toast{position:absolute;left:16px;right:16px;bottom:120px;z-index:30;display:flex;align-items:center;gap:10px;padding:14px 16px;border-radius:12px;background:var(--background);border:1px solid var(--border);box-shadow:0 8px 24px rgba(0,0,0,.12);font-size:15px;font-weight:500}

/* пустое состояние, загрузка, прогресс */
.empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;padding:48px 32px}
.empty-icon{width:64px;height:64px;border-radius:999px;background:var(--muted);display:flex;align-items:center;justify-content:center;margin-bottom:6px}
.empty h2{margin:0;font-size:20px;font-weight:600}
.empty p{margin:0;font-size:15px;color:var(--muted-foreground);line-height:1.45}
.skel{background:#ececec;border-radius:8px;animation:pmdpulse 1.4s ease-in-out infinite}
@keyframes pmdpulse{50%{opacity:.45}}
.progress{display:flex;gap:4px}
.progress > span{flex:1;height:4px;border-radius:2px;background:#e5e5e5}
.progress > span.done{background:var(--foreground)}
.progress > span.cur{background:#8a8a8a}
/* лёгкая шкала этапов в шапке шаговых экранов */
.bar-steps{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-height:44px;padding:0;border:0;background:transparent;cursor:pointer;color:var(--foreground)}
.bar-steps:active{opacity:.6}
.bar-sub{display:inline-flex;align-items:center;gap:2px;font-size:12px;font-weight:500;color:var(--muted-foreground)}
.bar-slot{flex:none;width:44px;display:flex;align-items:center}
.bar-slot.end{justify-content:flex-end}
.progress-thin{flex:none;gap:3px;margin:0 16px 8px}
.progress-thin > span{height:3px;background:#dadada}
.avatar{width:44px;height:44px;border-radius:999px;background:var(--muted);display:flex;align-items:center;justify-content:center;font-weight:600;font-size:15px;flex:none}

/* мини-документ */
.page{background:#fff;border:1px solid var(--border);border-radius:6px;padding:18px 16px;display:flex;flex-direction:column;gap:7px}
.line{height:6px;border-radius:3px;background:#e5e5e5}
