/* Кабинет клиента — цвета и шрифты пульта водомата (water.html) и лендинга cartela; вид мобильного приложения:
   шапка с названием экрана и меню, крупные карточки и кнопки, отступы под вырез и жест «домой», переходы без перезагрузки */
:root { --bg:#0C1A24; --head:#12384F; --card:#10283A; --line:#345266; --fg:#E8F1F6; --dim:#8FB0C2;
        --acc:#5CC8FF; --bad:#FF8A7A; --go:#4FD1A5; --on-go:#04271D; --amber:#FFB84D; --pad:18px;
        --top:env(safe-area-inset-top, 0px); --bot:env(safe-area-inset-bottom, 0px); }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html { background:var(--bg); -webkit-text-size-adjust:100%; }
body { margin:0; min-height:100vh; min-height:100dvh; font-family:Karla,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
       color:var(--fg); background:var(--bg); overflow-x:hidden; }
header { position:sticky; top:0; z-index:10; background:var(--head); padding-top:var(--top);
         box-shadow:0 1px 0 rgba(255,255,255,.06), 0 6px 18px rgba(0,0,0,.25); }
.bar { max-width:520px; margin:0 auto; min-height:60px; padding:8px 10px 8px var(--pad); display:flex; align-items:center; gap:6px; }
.bar .ttl { flex:1; min-width:0; }
#back:not([hidden]) + .ttl { margin-left:-4px; }
.bar:has(#back:not([hidden])) { padding-left:6px; }
.brand { font:600 20px/1.2 Roboto,Karla,sans-serif; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.addr { margin-top:1px; color:var(--dim); font-size:13px; }
.ico { position:relative; flex:none; width:44px; height:44px; display:grid; place-items:center; border:0; border-radius:14px;
       background:transparent; color:var(--fg); cursor:pointer; }
.ico:active { background:rgba(255,255,255,.08); }
.ico svg { width:26px; height:26px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.dot { position:absolute; top:9px; right:8px; width:10px; height:10px; border-radius:50%; background:var(--amber); border:2px solid var(--head); }
.lang { display:flex; gap:4px; }
.langsel button { min-width:44px; min-height:40px; border:1px solid var(--line); background:var(--bg); color:var(--fg);
                  border-radius:10px; font:700 14px Karla,sans-serif; cursor:pointer; }
.langsel button[aria-pressed="true"] { background:var(--acc); color:var(--bg); border-color:var(--acc); }
.seg { display:flex; gap:6px; }
.seg button { flex:1; min-height:48px; font-size:16px; border-radius:14px; }
main { max-width:520px; margin:0 auto; padding:4px var(--pad) calc(36px + var(--bot)); }

/* экраны: вход справа вперёд, слева назад */
.screen { animation:in-fwd .26s cubic-bezier(.2,.8,.2,1); }
.screen.back { animation-name:in-back; }
@keyframes in-fwd { from { opacity:0; transform:translateX(28px); } to { opacity:1; transform:none; } }
@keyframes in-back { from { opacity:0; transform:translateX(-28px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation:none; } }

h1 { margin:14px 0 0; font:700 30px/1.15 Karla,sans-serif; text-align:center; }
h2 { margin:28px 0 6px; font:700 22px Karla,sans-serif; }
h3 { margin:0; font:700 20px Karla,sans-serif; }
.sub { margin:10px auto 0; color:var(--dim); font-size:17px; line-height:1.45; text-align:center; max-width:30em; }
.hero { padding:22px 0 6px; }
.drop { width:72px; height:72px; margin:0 auto; border-radius:22px; display:grid; place-items:center;
        background:linear-gradient(145deg, #1B5D80, var(--head)); box-shadow:0 8px 24px rgba(92,200,255,.18); }
.drop svg { width:38px; height:38px; fill:var(--acc); }
.card { margin-top:14px; padding:16px; border:1px solid var(--line); border-radius:20px; background:var(--card);
        display:flex; flex-direction:column; gap:10px; }
.cap { color:var(--dim); font-size:13px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; margin:22px 4px -4px; }
.card .cap { margin:4px 0 0; }
.hint { color:var(--dim); font-size:15px; line-height:1.45; margin:0; }
.hint.warn { color:var(--amber); margin-top:10px; }
.btn { width:100%; min-height:54px; display:flex; align-items:center; justify-content:center; gap:8px; padding:10px 16px; margin-top:6px;
       border:2px solid var(--line); border-radius:27px; background:var(--card); color:var(--fg);
       font:700 17px/1.1 Karla,sans-serif; text-decoration:none; text-align:center; cursor:pointer; transition:transform .08s; }
.btn:active { transform:scale(.98); }
.btn.big { min-height:60px; font-size:19px; border-radius:30px; }
.btn.go { background:var(--go); border-color:var(--go); color:var(--on-go); }
.btn.stop { border-color:#6E3B3B; color:#F2C4BC; background:#2A1A1E; }
.btn.small { min-height:40px; font-size:15px; width:auto; padding:6px 14px; margin:0; }
.btn:disabled { opacity:.5; cursor:default; }
.note { margin-top:14px; padding:14px 16px; border-radius:16px; background:var(--head); border:1px solid var(--line); line-height:1.4; font-size:16px; }
.note.ok { border-color:var(--go); }
.toast { position:fixed; left:50%; bottom:calc(18px + var(--bot)); transform:translateX(-50%); z-index:30;
         width:min(488px, calc(100% - 2 * var(--pad))); padding:14px 16px; border-radius:16px; background:#3A1D22;
         border:1px solid #6E3B3B; color:#FFD9D2; font-size:16px; line-height:1.35; box-shadow:0 10px 30px rgba(0,0,0,.45);
         animation:toast .22s ease-out; }
@keyframes toast { from { opacity:0; transform:translate(-50%, 12px); } }
.bad { color:var(--bad); }

/* карты клиента — крупные плитки */
.cards { display:flex; flex-direction:column; gap:12px; margin-top:12px; }
.wcard { position:relative; display:block; width:100%; padding:18px 20px 18px; border:1px solid #2C5C78; border-radius:24px;
         background:radial-gradient(120% 140% at 100% 0%, #1D6A90 0%, #154866 42%, #10324A 100%); color:var(--fg);
         text-align:left; font:inherit; cursor:pointer; box-shadow:0 10px 26px rgba(0,0,0,.3); overflow:hidden; }
.wcard::after { content:""; position:absolute; right:-40px; bottom:-60px; width:190px; height:190px; border-radius:50%;
                background:radial-gradient(circle, rgba(92,200,255,.16), transparent 70%); pointer-events:none; }
.wcard:active { transform:scale(.99); }
.wcard.tg { background:radial-gradient(120% 140% at 100% 0%, #276C93 0%, #1A4A6B 45%, #13334B 100%); }
.wcard.off { filter:saturate(.35); opacity:.85; }
.wcard .k { color:#B5D3E3; font-size:14px; font-weight:700; letter-spacing:.04em; }
.wcard .n { margin-top:8px; font:700 22px Karla,sans-serif; letter-spacing:.08em; font-variant-numeric:tabular-nums; }
.wcard .b { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-top:22px; }
.wcard .l { font:700 38px/1 Karla,sans-serif; color:#fff; font-variant-numeric:tabular-nums; }
.wcard .l small { font-size:20px; color:var(--acc); margin-left:4px; }
.wcard .s { color:#B5D3E3; font-size:16px; text-align:right; font-variant-numeric:tabular-nums; }
.wcard .badge { display:inline-block; margin-left:8px; padding:2px 8px; border-radius:8px; background:#5A2A2A; color:#FFD9D2;
                font-size:13px; letter-spacing:0; vertical-align:2px; }
.wcard .chev { position:absolute; right:16px; top:18px; width:22px; height:22px; fill:none; stroke:#B5D3E3; stroke-width:2.4;
               stroke-linecap:round; stroke-linejoin:round; }
.acts2 { display:grid; gap:4px; margin-top:12px; }

/* история */
.list { display:flex; flex-direction:column; }
.item { display:flex; justify-content:space-between; gap:12px; padding:14px 2px; border-bottom:1px solid var(--line); font-size:16px; }
.item:last-child { border-bottom:0; }
.item > div:first-child { min-width:0; }
.item .d { color:var(--dim); font-size:14px; margin-top:3px; line-height:1.35; }
.item .r { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; font-weight:700; }
.item .r.plus { color:var(--go); }
.item.unseen { font-weight:700; }
.doc { display:inline-flex; align-items:center; gap:6px; margin-top:8px; min-height:36px; padding:6px 12px; border-radius:12px;
       border:1px solid #2F6A8A; background:rgba(92,200,255,.1); color:var(--acc); font:700 15px Karla,sans-serif;
       text-decoration:none; cursor:pointer; }
.doc svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.tabs { display:flex; gap:4px; margin-top:8px; padding:4px; border-radius:16px; background:var(--card); border:1px solid var(--line); }
.tab { flex:1; min-height:44px; border:0; border-radius:12px; background:transparent; color:var(--dim);
       font:700 15px Karla,sans-serif; cursor:pointer; }
.tab[aria-selected="true"] { background:var(--head); color:var(--fg); box-shadow:inset 0 0 0 1px var(--acc); }
#hist, #card-hist { margin-top:6px; }

/* формы */
label { display:flex; flex-direction:column; gap:6px; color:var(--dim); font-size:14px; }
input, select { min-height:52px; padding:8px 14px; border-radius:14px; border:1px solid var(--line); background:var(--bg);
                color:var(--fg); font:600 18px Karla,sans-serif; width:100%; }
input:focus, select:focus { outline:2px solid var(--acc); outline-offset:1px; }
.chips { display:flex; gap:8px; flex-wrap:wrap; }
.chips button { flex:1; min-width:64px; min-height:44px; border-radius:14px; border:1px solid var(--line); background:var(--bg);
                color:var(--fg); font:700 16px Karla,sans-serif; cursor:pointer; }
.chips button[aria-pressed="true"] { border-color:var(--acc); background:var(--head); }
.soon { align-items:center; text-align:center; padding:26px 18px; }
.big-ico { width:64px; height:64px; border-radius:20px; display:grid; place-items:center; background:var(--head); }
.big-ico svg { width:34px; height:34px; fill:none; stroke:var(--acc); stroke-width:2; stroke-linecap:round; }
.kv { margin:0; display:grid; grid-template-columns:auto 1fr; gap:12px 14px; font-size:16px; }
.kv dt { color:var(--dim); }
.kv dd { margin:0; text-align:right; font-weight:700; word-break:break-all; }
.steps { margin:0; padding-left:24px; line-height:1.55; font-size:17px; }
.steps li + li { margin-top:8px; }
#tg-widget, #tg-link-widget { display:flex; justify-content:center; min-height:10px; }
.list:empty, #tg-link-widget:empty { display:none; }
@media (min-width:700px) { main { padding-top:12px; } }
[hidden] { display:none !important; }
