:root { color-scheme:light; --ink:#17283a; --muted:#60788c; --line:#e0e9f1; --bg:#f1f6fb; --blue:#2468d8; --blue-dark:#1956b5; --white:#fff; --danger:#b73746; --soft-red:#fff1f1; --soft-red-line:#f2d8dc; --soft-red-text:#8e4e57; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { min-height:100%; }
body { margin:0; min-height:100vh; background:radial-gradient(ellipse 70% 360px at 50% 0%,#daeaff 0%,transparent 100%),var(--bg); color:var(--ink); font:16px/1.45 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
button,input,select { font:inherit; }
button { cursor:pointer; }
button:disabled { cursor:not-allowed; opacity:.56; }
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible { outline:3px solid #91bcfb; outline-offset:3px; }
.wrap { max-width:760px; padding:33px 20px 70px; margin:auto; }
.top { display:flex; align-items:center; gap:14px; margin-bottom:30px; }
.mark { width:55px; height:55px; display:grid; place-items:center; flex:none; border-radius:18px; background:#d9eaff; color:var(--blue); }
.header-copy { flex:1; min-width:0; }
h1 { font-size:clamp(1.7rem,6vw,2.25rem); margin:0; letter-spacing:-.045em; line-height:1.14; font-weight:780; }
.subtitle { margin:5px 0 0; color:var(--muted); font-size:.94rem; }
.logout { border:0; color:var(--muted); font-size:.82rem; background:transparent; text-decoration:underline; padding:8px 0; align-self:flex-start; }
.card { background:var(--white); border:1px solid #e4ebf4; box-shadow:0 9px 28px rgba(34,66,108,.04); border-radius:20px; }
.add-card { padding:23px; }
.section-label { display:block; font-size:.94rem; font-weight:700; margin-bottom:11px; }
.add-form { display:flex; gap:10px; }
.text-input { background:#fff; border:1px solid #d5e0eb; border-radius:11px; height:51px; padding:0 15px; width:100%; min-width:0; color:var(--ink); }
.text-input::placeholder { color:#91a0ae; }
.primary { border:0; border-radius:11px; padding:0 19px; height:51px; white-space:nowrap; background:var(--blue); color:#fff; font-weight:700; display:flex; align-items:center; justify-content:center; gap:7px; }
.primary:hover { background:var(--blue-dark); }
.primary.full { width:100%; margin-top:14px; }
.hint { margin:10px 0 0; color:var(--muted); font-size:.85rem; }
.stats { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:17px 0 27px; }
.stat { background:#e7f1fc; border-radius:15px; padding:15px 19px; }
.stat strong { font-size:1.65rem; line-height:1.2; font-weight:780; letter-spacing:-.035em; display:block; font-variant-numeric:tabular-nums; }
.stat span { font-size:.86rem; color:#53708e; }
.list-toolbar { display:flex; justify-content:space-between; align-items:center; gap:14px; margin-bottom:13px; }
h2 { font-size:1.17rem; font-weight:750; margin:0; letter-spacing:-.025em; }
.sort-wrap { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:.86rem; }
select { background:#fff; border:1px solid #dbe5ef; padding:10px 12px; border-radius:10px; color:var(--ink); max-width:225px; }
.products { overflow:hidden; }
.product { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:9px; padding:14px 16px; min-height:78px; }
.product + .product { border-top:1px solid var(--line); }
.product.is-empty { background:var(--soft-red); }
.product.is-empty + .product { border-top-color:var(--soft-red-line); }
.product-main { display:flex; align-items:center; min-width:0; }
.product-name { font-size:1rem; font-weight:650; overflow-wrap:anywhere; line-height:1.35; }
.row-actions { display:flex; align-items:center; gap:3px; flex:none; }
.icon-btn { flex:none; width:40px; height:46px; background:transparent; border:0; border-radius:10px; color:#8499ae; display:grid; place-items:center; padding:0; }
.icon-btn svg { width:19px; height:19px; }
.icon-btn:hover { background:#edf5ff; color:var(--blue); }
.icon-btn.delete:hover { background:#fff0f2; color:#c04a5c; }
.counter { display:flex; align-items:center; gap:6px; flex:none; }
.qty { min-width:26px; text-align:center; font-weight:750; font-size:1.25rem; font-variant-numeric:tabular-nums; }
.product.is-empty .qty { color:var(--soft-red-text); }
.step { display:grid; place-items:center; width:46px; height:46px; border-radius:12px; background:#eff4f9; border:1px solid #e4ecf4; color:#244461; font-size:1.9rem; font-weight:500; line-height:1; }
.step:hover { background:#ddebf9; }
.step.plus { color:var(--blue); background:#e8f1ff; border-color:#dbeaff; }
.step.plus:hover { background:#d5e7ff; }
.empty { padding:43px 18px; text-align:center; }
.empty-icon { height:68px; width:68px; display:grid; place-items:center; background:#eef5ff; color:#4d8ce5; border-radius:23px; margin:0 auto 16px; }
.empty strong { display:block; font-size:1.07rem; }
.empty p { color:var(--muted); margin:6px 0 0; font-size:.95rem; }
.sync-message { color:#58758e; font-size:.82rem; margin:13px 0 0; }
.sync-message::before { content:'●'; font-size:.65rem; color:#2f9763; margin-right:7px; vertical-align:2px; }
.sync-message.offline::before { color:#c24b4b; }
.extras { margin:26px 0 0; color:var(--muted); font-size:.88rem; }
.extras summary { cursor:pointer; width:max-content; }
.extras-content { border-top:1px solid var(--line); margin-top:13px; padding-top:4px; }
.extras h3 { color:var(--ink); font-size:.97rem; margin:19px 0 10px; }
.backups { display:flex; align-items:center; flex-wrap:wrap; gap:9px; }
.secondary { background:#fff; padding:10px 13px; border:1px solid #dce5ee; border-radius:10px; color:#304962; font-size:.88rem; font-weight:600; }
.secondary:hover { background:#f8fbff; }
.change-form { max-width:410px; display:grid; gap:9px; }
.change-form label { font-size:.84rem; }
.change-form .secondary { justify-self:start; margin-top:3px; }
.login-card { max-width:470px; padding:25px; margin:30px auto; }
.login-card h2 { font-size:1.3rem; }
.login-card .help { font-size:.94rem; color:var(--muted); margin:8px 0 24px; }
.login-card .text-input { margin-bottom:0; }
.error { color:var(--danger); font-size:.9rem; }
.center-card { padding:25px; color:var(--muted); text-align:center; }
.toast { position:fixed; z-index:20; bottom:calc(19px + env(safe-area-inset-bottom)); left:50%; transform:translate(-50%,150%); background:#20364c; color:#fff; border-radius:12px; padding:12px 16px; box-shadow:0 12px 35px #1e334b40; max-width:calc(100% - 24px); min-width:180px; text-align:center; transition:transform .2s ease; font-size:.9rem; pointer-events:none; visibility:hidden; }
.toast.show { transform:translate(-50%,0); visibility:visible; }
@media (max-width:540px) {
  .wrap{padding:24px 15px 60px;}
  .top{gap:11px;margin-bottom:24px;}
  .mark{width:47px;height:47px;border-radius:15px;}
  .logout{font-size:.72rem;}
  .add-card{padding:17px;}
  .add-form{gap:8px;}
  .text-input{padding:0 11px;}
  .primary{padding:0 12px;}
  .stats{gap:9px;margin:13px 0 25px;}
  .stat{padding:13px 14px;}
  .list-toolbar{align-items:flex-start;}
  .sort-wrap{flex-direction:column;align-items:flex-end;gap:5px;}
  .sort-wrap label{font-size:.78rem;}
  select{max-width:195px;font-size:.84rem;padding:8px 7px;}
  .product{padding:12px 10px;gap:5px;min-height:70px;}
  .product-name{font-size:.91rem;line-height:1.3;}
  .counter{gap:3px;}
  .step{width:40px;height:44px;font-size:1.9rem;}
  .qty{min-width:22px;font-size:1.1rem;}
  .row-actions{gap:0;}
  .icon-btn{width:33px;height:44px;}
  .icon-btn svg{width:18px;height:18px;}
}
@media (max-width:360px) {
  .product{padding:10px 7px;gap:3px;}
  .product-name{font-size:.84rem;}
  .step{width:37px;height:43px;}
  .qty{min-width:20px;}
  .icon-btn{width:31px;height:43px;}
}
