img{max-width:100%}[hidden]{display:none!important}

:root{
  --coral:#E26761; --coral-deep:#C4483F; --coral-soft:#FBE9E7;
  --ink:#1E2230; --ink-2:#4A4F5E; --muted:#7A7E8A;
  --paper:#FAF6F3; --surface:#FFFFFF; --surface-2:#F3ECE9; --line:#E9DEDA;
  --amber:#D99A12; --amber-bg:#FFF3D1; --amber-ink:#6B4A00;
  --orange:#E5641F; --orange-bg:#FFE4D3; --orange-ink:#7A2E00;
  --red:#B8202A; --red-bg:#FFDCDC; --red-ink:#6E0A12;
  --green:#2E8B57; --green-bg:#DDF3E5; --green-ink:#0F4A2A;
  --shadow:0 10px 30px -18px rgba(30,34,48,.35);
  --radius:14px;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --coral:#E8736C; --coral-deep:#D2554D; --coral-soft:#3A2624;
    --ink:#F2EEEC; --ink-2:#C9C4C1; --muted:#9A959B;
    --paper:#16171B; --surface:#212227; --surface-2:#2A2B31; --line:#33343B;
    --amber:#E3B043; --amber-bg:#3A2F10; --amber-ink:#FFE3A1;
    --orange:#F08048; --orange-bg:#3F2414; --orange-ink:#FFD1B8;
    --red:#E0505A; --red-bg:#43181C; --red-ink:#FFC6C9;
    --green:#4FB07A; --green-bg:#173324; --green-ink:#BDEACF;
    --shadow:0 10px 30px -18px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"]{
  --coral:#E8736C; --coral-deep:#D2554D; --coral-soft:#3A2624;
  --ink:#F2EEEC; --ink-2:#C9C4C1; --muted:#9A959B;
  --paper:#16171B; --surface:#212227; --surface-2:#2A2B31; --line:#33343B;
  --amber:#E3B043; --amber-bg:#3A2F10; --amber-ink:#FFE3A1;
  --orange:#F08048; --orange-bg:#3F2414; --orange-ink:#FFD1B8;
  --red:#E0505A; --red-bg:#43181C; --red-ink:#FFC6C9;
  --green:#4FB07A; --green-bg:#173324; --green-ink:#BDEACF;
  --shadow:0 10px 30px -18px rgba(0,0,0,.8);
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--paper);color:var(--ink);font-family:"Source Sans 3","Segoe UI",system-ui,sans-serif;font-size:17px;line-height:1.4;-webkit-text-size-adjust:100%}
body{min-height:100vh;min-height:100dvh}
button,input,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none;padding:0;margin:0;-webkit-tap-highlight-color:transparent}
:focus-visible{outline:3px solid var(--coral);outline-offset:2px}
h1,h2,h3{margin:0;font-weight:400}
.display{font-family:"Bebas Neue","Oswald","Arial Narrow",sans-serif;letter-spacing:.03em}
.app{max-width:560px;margin:0 auto;min-height:100dvh;display:flex;flex-direction:column}
.screen{display:none;flex:1;flex-direction:column}
.screen.active{display:flex}

/* Top band */
.band{background:linear-gradient(160deg,var(--coral) 0%,var(--coral-deep) 100%);color:#fff;padding:18px 20px 22px;position:relative}
.band .row{display:flex;align-items:center;gap:14px}
.band .title{font-size:30px;line-height:1;letter-spacing:.05em;white-space:nowrap}
.band .sub{opacity:.85;font-size:15px;margin-top:3px}
.band .logo{height:44px;width:auto;display:block}
.iconbtn{width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.18);color:#fff;display:inline-flex;align-items:center;justify-content:center;flex:none}
.iconbtn svg{width:22px;height:22px}
.chips{display:flex;gap:8px;margin-top:16px;flex-wrap:wrap}
.chip{background:rgba(255,255,255,.16);border-radius:10px;padding:8px 12px;font-size:14px;display:flex;align-items:center;gap:6px;min-width:0}
.chip span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chip svg{width:16px;height:16px;flex:none;opacity:.9}

.content{padding:18px 16px 110px;display:flex;flex-direction:column;gap:22px;flex:1}
.section{display:flex;flex-direction:column;gap:10px}
.label{font-family:"Bebas Neue",sans-serif;font-size:19px;letter-spacing:.08em;color:var(--ink-2);display:flex;align-items:center;gap:8px}
.label small{font-family:"Source Sans 3",sans-serif;letter-spacing:0;font-size:14px;color:var(--muted);text-transform:none}
.field{width:100%;background:var(--surface);border:1.5px solid var(--line);border-radius:12px;padding:13px 14px;font-size:17px}
.field::placeholder{color:var(--muted)}
.field:focus{border-color:var(--coral);outline:none}
textarea.field{resize:none;min-height:96px}
.hint{font-size:13px;color:var(--muted);text-align:right}

/* Location list */
.loclist{display:flex;flex-direction:column;gap:8px}
.loc{display:flex;align-items:center;gap:12px;background:var(--surface);border:1.5px solid var(--line);border-radius:12px;padding:12px 14px;text-align:left;width:100%}
.loc .name{flex:1;font-weight:600}
.loc .meta{font-size:13px;color:var(--muted)}
.loc .dot{width:10px;height:10px;border-radius:50%;background:var(--line)}
.loc.selected{border-color:var(--coral);background:var(--coral-soft)}
.loc.selected .check{display:flex}
.loc .check{display:none;width:26px;height:26px;border-radius:50%;background:var(--coral);color:#fff;align-items:center;justify-content:center;flex:none}
.loc .check svg{width:14px;height:14px}

/* Grid pickers */
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.grid.two{grid-template-columns:repeat(2,1fr)}
.pick{background:var(--surface);border:1.5px solid var(--line);border-radius:12px;padding:12px 8px;display:flex;flex-direction:column;align-items:center;gap:6px;font-weight:600;font-size:15px;min-height:76px;justify-content:center;text-align:center;line-height:1.15}
.pick .ico{width:28px;height:28px;color:var(--ink-2)}
.pick .ico svg{width:100%;height:100%}
.pick.selected{border-color:var(--coral);background:var(--coral-soft);color:var(--ink)}
.pick.selected .ico{color:var(--coral)}
.pick.u-1.selected{background:var(--amber-bg);border-color:var(--amber);color:var(--amber-ink)}
.pick.u-2.selected{background:var(--orange-bg);border-color:var(--orange);color:var(--orange-ink)}
.pick.u-3.selected{background:var(--red-bg);border-color:var(--red);color:var(--red-ink)}
.pick.u-1.selected .ico{color:var(--amber)} .pick.u-2.selected .ico{color:var(--orange)} .pick.u-3.selected .ico{color:var(--red)}
.pick small{display:block;font-weight:400;font-size:12px;color:var(--muted)}

/* Photos */
.photos{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.ph{position:relative;aspect-ratio:1;border-radius:10px;overflow:hidden;background:var(--surface-2)}
.ph img{width:100%;height:100%;object-fit:cover;display:block}
.ph .rm{position:absolute;top:4px;right:4px;width:26px;height:26px;border-radius:50%;background:rgba(20,20,20,.7);color:#fff;display:flex;align-items:center;justify-content:center}
.ph .rm svg{width:14px;height:14px}
.addph{aspect-ratio:1;border:2px dashed var(--line);border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:var(--ink-2);font-size:12px;font-weight:600;background:var(--surface)}
.addph svg{width:24px;height:24px}
.addph.big{aspect-ratio:auto;grid-column:1/-1;padding:26px;font-size:15px;gap:8px}
.addph.big svg{width:34px;height:34px;color:var(--coral)}
.addph.busy{opacity:.5;pointer-events:none}

/* Quick chips */
.quick{display:flex;flex-wrap:wrap;gap:6px}
.q{background:var(--surface);border:1.5px solid var(--line);border-radius:999px;padding:6px 12px;font-size:14px;color:var(--ink-2)}
.q.on{border-color:var(--coral);color:var(--coral);background:var(--coral-soft)}

/* Summary strip */
.summary{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 16px;display:flex;align-items:center;gap:14px;margin-top:-30px;position:relative}
.summary .count{font-family:"Bebas Neue",sans-serif;font-size:30px;line-height:1}
.summary .what{font-size:14px;color:var(--muted);margin-top:-2px}
.summary .sev{margin-left:auto;display:flex;gap:10px;font-variant-numeric:tabular-nums;font-weight:600}
.sev i{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:5px;vertical-align:1px}
.sev .s1 i{background:var(--amber)} .sev .s2 i{background:var(--orange)} .sev .s3 i{background:var(--red)}

/* Entry cards */
.areahead{display:flex;align-items:baseline;gap:8px;margin-top:4px}
.areahead .n{font-size:13px;color:var(--muted)}
.entry{display:flex;background:var(--surface);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);text-align:left;width:100%}
.entry .stripe{width:6px;flex:none}
.entry.u-1 .stripe{background:var(--amber)} .entry.u-2 .stripe{background:var(--orange)} .entry.u-3 .stripe{background:var(--red)}
.entry .body{flex:1;padding:12px 12px 12px 14px;display:flex;flex-direction:column;gap:8px;min-width:0}
.entry .top{display:flex;align-items:center;gap:8px}
.badge{font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:3px 9px;border-radius:999px}
.badge.u-1{background:var(--amber-bg);color:var(--amber-ink)} .badge.u-2{background:var(--orange-bg);color:var(--orange-ink)} .badge.u-3{background:var(--red-bg);color:var(--red-ink)}
.entry .desc{font-size:16px;white-space:pre-wrap;word-break:break-word}
.entry .desc.empty{color:var(--muted);font-style:italic}
.entry .thumbs{display:flex;gap:6px}
.entry .thumbs img{width:64px;height:64px;object-fit:cover;border-radius:8px;background:var(--surface-2)}
.entry .edit{margin-left:auto;color:var(--muted);font-size:13px;display:flex;align-items:center;gap:4px}
.entry .edit svg{width:14px;height:14px}
.empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:40px 20px;text-align:center;color:var(--muted)}
.empty .display{font-size:24px;color:var(--ink-2)}
.empty svg{width:48px;height:48px;color:var(--line)}

/* Bottom bar */
.bar{position:fixed;left:0;right:0;bottom:0;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:color-mix(in srgb,var(--paper) 88%,transparent);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid var(--line);z-index:5}
.bar .inner{max-width:560px;margin:0 auto;display:flex;gap:10px}
.btn{flex:1;border-radius:14px;padding:15px 16px;font-weight:700;font-size:17px;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:52px}
.btn svg{width:20px;height:20px}
.btn.primary{background:var(--coral);color:#fff}
.btn.primary:active{background:var(--coral-deep)}
.btn.primary:disabled{opacity:.45}
.btn.ghost{background:var(--surface);border:1.5px solid var(--line);color:var(--ink)}
.btn.danger{background:var(--red-bg);color:var(--red-ink)}
.btn.small{padding:10px 14px;min-height:42px;font-size:15px;flex:none}
.btn.wide{width:100%}

/* History */
.filters{display:flex;gap:6px;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
.filters::-webkit-scrollbar{display:none}
.filters .q{white-space:nowrap;flex:none}
.hist{display:flex;background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:12px 14px;gap:12px;align-items:center;text-align:left;width:100%}
.hist .date{font-family:"Bebas Neue",sans-serif;font-size:22px;line-height:1;width:54px;text-align:center;color:var(--coral)}
.hist .date small{display:block;font-family:"Source Sans 3",sans-serif;font-size:12px;color:var(--muted);letter-spacing:0}
.hist .info{flex:1;min-width:0}
.hist .info b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hist .info span{font-size:14px;color:var(--muted)}
.hist .sev{display:flex;gap:8px;font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}
.hist .ok{color:var(--green-ink);background:var(--green-bg);font-size:12px;font-weight:700;padding:3px 8px;border-radius:999px}

/* Detail */
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;font-size:16px}
.kv dt{color:var(--muted)} .kv dd{margin:0;font-weight:600}
.gallery{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.gallery img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:10px;background:var(--surface-2)}

/* Toast, sheet, overlay */
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(96px + env(safe-area-inset-bottom));background:var(--ink);color:var(--paper);padding:10px 16px;border-radius:999px;font-size:15px;z-index:20;opacity:0;transition:opacity .2s;pointer-events:none;max-width:90vw;text-align:center}
.toast.show{opacity:1}
.sheet-bg{position:fixed;inset:0;background:rgba(20,18,24,.45);z-index:10;display:none;align-items:flex-end;justify-content:center}
.sheet-bg.open{display:flex}
.sheet{background:var(--surface);width:100%;max-width:560px;border-radius:20px 20px 0 0;padding:20px 20px calc(20px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px}
.sheet h2{font-size:26px}
.sheet p{margin:0;color:var(--ink-2)}
.progress{height:6px;background:var(--surface-2);border-radius:3px;overflow:hidden}
.progress i{display:block;height:100%;background:var(--coral);width:0;transition:width .3s}
.status{font-size:14px;color:var(--muted)}
.done{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;padding:30px 10px 10px}
.done .ring{width:84px;height:84px;border-radius:50%;background:var(--green-bg);color:var(--green);display:flex;align-items:center;justify-content:center}
.done .ring svg{width:44px;height:44px}
.done h2{font-size:32px}
.note{font-size:14px;color:var(--muted);text-align:center}
.link{color:var(--coral);font-weight:600;text-decoration:none}
.badge-store{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:5px;justify-content:center;margin-top:6px}
.badge-store i{width:8px;height:8px;border-radius:50%;background:var(--muted);display:inline-block}
.badge-store.cloud i{background:var(--green)}
/* Overview */
.ov{display:flex;flex-direction:column;background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 16px;gap:10px;text-align:left;width:100%}
.ov .head{display:flex;align-items:center;gap:10px}
.ov .light{width:12px;height:12px;border-radius:50%;flex:none;box-shadow:0 0 0 3px color-mix(in srgb,currentColor 18%,transparent);color:var(--line);background:currentColor}
.ov .light.g{color:var(--green)} .ov .light.a{color:var(--amber)} .ov .light.r{color:var(--red)}
.ov .name{font-weight:700;font-size:18px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ov .last{font-size:13px;color:var(--muted);white-space:nowrap}
.ov .last.warn{color:var(--red);font-weight:600}
.ov .row2{display:flex;align-items:flex-end;gap:12px}
.ov .pills{display:flex;gap:6px;flex-wrap:wrap;flex:1}
.pill{font-size:13px;font-weight:700;padding:3px 9px;border-radius:999px;font-variant-numeric:tabular-nums}
.pill.u-1{background:var(--amber-bg);color:var(--amber-ink)} .pill.u-2{background:var(--orange-bg);color:var(--orange-ink)} .pill.u-3{background:var(--red-bg);color:var(--red-ink)}
.pill.ok{background:var(--green-bg);color:var(--green-ink)} .pill.none{background:var(--surface-2);color:var(--muted);font-weight:600}
.spark{display:flex;align-items:flex-end;gap:3px;height:28px}
.spark i{display:block;width:9px;border-radius:2px 2px 0 0;background:var(--line);min-height:3px}
.spark i.last{background:var(--coral)}
.spark-lbl{font-size:11px;color:var(--muted);text-align:right;margin-top:2px}
.kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:-30px;position:relative}
.kpi{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:12px 12px 10px;text-align:center}
.kpi .n{font-family:"Bebas Neue",sans-serif;font-size:30px;line-height:1}
.kpi .n.r{color:var(--red)} .kpi .n.a{color:var(--amber)}
.kpi .t{font-size:12px;color:var(--muted);margin-top:2px}

/* Issues */
.carry{display:flex;align-items:center;gap:12px;background:var(--surface);border:1.5px solid var(--red);border-radius:var(--radius);padding:12px 14px;text-align:left;width:100%}
.carry.mild{border-color:var(--amber)}
.carry .n{font-family:"Bebas Neue",sans-serif;font-size:30px;line-height:1;color:var(--red);width:40px;text-align:center}
.carry.mild .n{color:var(--amber)}
.carry .t{flex:1;min-width:0} .carry .t b{display:block} .carry .t span{font-size:13px;color:var(--muted)}
.carry svg{width:20px;height:20px;color:var(--muted);flex:none}
.issue{display:flex;background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.issue .stripe{width:6px;flex:none}
.issue.u-1 .stripe{background:var(--amber)} .issue.u-2 .stripe{background:var(--orange)} .issue.u-3 .stripe{background:var(--red)}
.issue.resolved .stripe{background:var(--green)}
.issue .body{flex:1;padding:12px 12px 12px 14px;display:flex;flex-direction:column;gap:8px;min-width:0}
.issue .top{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.issue .when{font-size:13px;color:var(--muted);margin-left:auto}
.issue .when.over{color:var(--red);font-weight:700}
.issue .desc{font-size:16px;white-space:pre-wrap;word-break:break-word}
.issue .foot{display:flex;align-items:center;gap:10px}
.issue .foot img{width:52px;height:52px;object-fit:cover;border-radius:8px;background:var(--surface-2)}
.issue .foot .meta{font-size:13px;color:var(--muted);flex:1}
.issue .act{background:var(--green-bg);color:var(--green-ink);font-weight:700;font-size:14px;padding:9px 14px;border-radius:10px;display:inline-flex;align-items:center;gap:6px;flex:none}
.issue .act svg{width:16px;height:16px}
.issue .act.re{background:var(--surface-2);color:var(--ink-2)}
.issue.resolved{opacity:.8}
.toggle{background:none;color:var(--coral);font-weight:600;font-size:15px;text-align:left;padding:4px 0}
/* Login & users */
.login{flex:1;display:flex;flex-direction:column;justify-content:center;padding:28px 24px 40px;gap:18px;max-width:420px;margin:0 auto;width:100%}
.login .logo{height:64px;width:auto;align-self:center;margin-bottom:6px}
.login h1{font-size:34px;text-align:center}
.login .err{background:var(--red-bg);color:var(--red-ink);padding:10px 12px;border-radius:10px;font-size:15px}
.user{display:flex;align-items:center;gap:12px;background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:12px 14px}
.user .info{flex:1;min-width:0} .user .info b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} .user .info span{font-size:13px;color:var(--muted)}
.user.off{opacity:.55}
.user .btn.small{padding:8px 12px;min-height:36px;font-size:14px}
.menu{display:flex;flex-direction:column;gap:8px}
.menu .btn{justify-content:flex-start}
.whoami{font-size:14px;color:var(--muted);text-align:center}
@media (prefers-reduced-motion: reduce){*{transition:none!important}}
