:root{
--bg:#ffffff; --card:#f3f4f6; --card2:#e9ebef; --ink:#121212; --muted:#6b7280; --line:#e5e7eb;
--y:#ffc72c; --y2:#ffb800; --ydark:#7a5b00;
--ok:#15803d; --okbg:#dcfce7; --warn:#b45309; --warnbg:#fef3c7; --bad:#b91c1c; --badbg:#fee2e2;
--r:22px; --nav:84px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:"Montserrat","Kantumruy Pro",system-ui,-apple-system,"Segoe UI",sans-serif;font-size:16px;line-height:1.45}
:lang(km),.km{font-family:"Kantumruy Pro","Montserrat",sans-serif}
button,input,select,textarea{font:inherit;color:inherit}
a{color:inherit}
.boot{display:grid;place-items:center;height:100vh}
.page{max-width:640px;margin:0 auto;padding:max(14px,env(safe-area-inset-top)) 18px calc(var(--nav) + 36px + env(safe-area-inset-bottom))}
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:6px 0 22px}
.logo{display:flex;align-items:center;gap:8px;font-weight:600;font-size:24px;letter-spacing:-.3px}
.logo b{font-weight:700}
.logo-cam{width:34px;height:30px;display:inline-block;background:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 30'%3E%3Crect x='1' y='7' width='32' height='22' rx='6' fill='%23121212'/%3E%3Crect x='10' y='2' width='14' height='8' rx='3' fill='%23121212'/%3E%3Ccircle cx='17' cy='18' r='7' fill='%23fff'/%3E%3Ccircle cx='17' cy='18' r='4' fill='%23121212'/%3E%3C/svg%3E")}
.boot .logo-cam{width:68px;height:60px}
.burger{width:44px;height:44px;border:0;background:none;display:grid;gap:6px;align-content:center;cursor:pointer;padding:0 6px}
.burger i{display:block;height:2.5px;border-radius:2px;background:var(--y2)}
.burger i:nth-child(2){background:var(--ink)}
.pill{display:inline-flex;align-items:center;gap:6px;font-weight:600;font-size:14px}
h1{font-size:22px;margin:0 0 14px;font-weight:700;letter-spacing:-.2px}
h2{font-size:20px;margin:28px 0 14px;font-weight:700;display:flex;justify-content:space-between;align-items:center}
h2 a{font-size:15px;font-weight:600;color:var(--muted);text-decoration:none}
h3{font-size:15px;margin:16px 0 10px;color:var(--muted);font-weight:600}
.muted{color:var(--muted)} .small{font-size:13px} .center{text-align:center}
.hidden{display:none!important}
/* cards like photoAiD */
.dcard{display:flex;align-items:center;gap:18px;background:var(--card);border:0;border-radius:var(--r);padding:16px 18px;width:100%;text-align:left;cursor:pointer;margin-bottom:14px;text-decoration:none;color:inherit}
.dcard:active{transform:scale(.99)}
.dcard .art{width:86px;height:64px;flex:none;display:grid;place-items:center}
.dcard .art svg{max-width:100%;max-height:100%}
.dcard .tx{min-width:0;flex:1}
.dcard .tx b{display:block;font-size:18px;font-weight:600;line-height:1.25}
.dcard .tx span{display:block;color:var(--muted);font-size:14px;margin-top:2px}
.dcard .chev{font-size:26px;color:var(--ink);flex:none}
.chips{display:flex;gap:10px;overflow-x:auto;padding:2px 0 6px;margin:0 -18px 6px;padding-left:18px;padding-right:18px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{border:0;background:var(--card);border-radius:14px;padding:12px 18px;white-space:nowrap;cursor:pointer;font-size:16px;color:#374151}
.chip.on{background:var(--ink);color:#fff}
.tiles{display:flex;gap:14px;overflow-x:auto;margin:0 -18px;padding:2px 18px 6px;scrollbar-width:none}
.tiles::-webkit-scrollbar{display:none}
.tile{flex:none;width:168px;background:var(--card);border-radius:var(--r);padding:16px 12px 14px;text-align:center;border:0;cursor:pointer;text-decoration:none;color:inherit}
.tile .art{height:110px;display:grid;place-items:center;margin-bottom:10px}
.tile .art img{max-width:100%;max-height:110px;border-radius:8px;object-fit:cover}
.tile b{display:block;font-weight:600;font-size:15px;line-height:1.3}
.tile small{display:block;margin-top:4px}
/* members */
.people{display:flex;gap:14px;overflow-x:auto;margin:0 -18px;padding:2px 18px 6px;scrollbar-width:none}
.people::-webkit-scrollbar{display:none}
.person{flex:none;border:0;background:none;cursor:pointer;text-align:center;width:78px;padding:0}
.av{width:66px;height:66px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:24px;color:#fff;margin:0 auto 6px;position:relative}
.av.sm{width:42px;height:42px;font-size:16px;margin:0}
.av.lg{width:88px;height:88px;font-size:32px}
.av .n{position:absolute;right:-4px;top:-4px;background:var(--y);color:#111;font-size:12px;min-width:22px;height:22px;border-radius:11px;display:grid;place-items:center;border:2px solid #fff;padding:0 4px}
.person span{font-size:13px;font-weight:600;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.person.on .av{box-shadow:0 0 0 3px #fff,0 0 0 6px var(--y)}
/* alert banner */
.alert{display:flex;gap:12px;align-items:center;border-radius:18px;padding:14px 16px;margin-bottom:12px;text-decoration:none;color:inherit;border:0;width:100%;text-align:left;cursor:pointer}
.alert.bad{background:var(--badbg);color:var(--bad)}.alert.warn{background:var(--warnbg);color:var(--warn)}.alert.ok{background:var(--okbg);color:var(--ok)}
.alert b{display:block}.alert .e{font-size:26px}
/* doc rows */
.row{display:flex;align-items:center;gap:14px;background:var(--card);border-radius:20px;padding:12px;margin-bottom:12px;border:0;width:100%;text-align:left;cursor:pointer}
.row .th{width:84px;height:60px;border-radius:12px;background:#fff;flex:none;display:grid;place-items:center;overflow:hidden}
.row .th img{width:100%;height:100%;object-fit:cover}
.row .th svg{width:70px;height:50px}
.row .t{min-width:0;flex:1}
.row .t b{display:block;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .t span{display:block;font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.exp{display:inline-block;font-size:12px;font-weight:600;border-radius:8px;padding:2px 8px;margin-top:4px}
.exp.bad{background:var(--badbg);color:var(--bad)}.exp.warn{background:var(--warnbg);color:var(--warn)}.exp.ok{background:var(--okbg);color:var(--ok)}
/* forms */
label.f{display:block;margin-bottom:12px}
label.f>span{display:block;font-size:13px;color:var(--muted);margin-bottom:5px;font-weight:500}
.in{width:100%;padding:13px 14px;border:1.5px solid var(--line);border-radius:14px;background:#fff;font-size:16px;min-height:50px}
.in:focus{outline:0;border-color:var(--y2);box-shadow:0 0 0 3px rgba(255,199,44,.35)}
.in.ai{background:#fffbea;border-color:#fde68a}
.in.err{border-color:var(--bad);background:var(--badbg)}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.grid2>*{min-width:0}
.in[type=date]{min-width:0;-webkit-appearance:none}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:18px;padding:15px 20px;background:var(--y);color:#111;font-weight:700;font-size:16px;cursor:pointer;width:100%;min-height:56px}
.btn:active{background:var(--y2)}
.btn.dark{background:var(--ink);color:#fff}
.btn.ghost{background:var(--card);color:var(--ink);font-weight:600}
.btn.danger{background:var(--badbg);color:var(--bad);font-weight:600}
.btn:disabled{opacity:.5}
.btns{display:grid;gap:10px;margin-top:16px}
.panel{background:var(--card);border-radius:var(--r);padding:16px 14px 6px;margin-bottom:14px}
.panel>h3{margin:0 0 12px;color:var(--ink)}
.panel .in{border-color:#fff}
.badge{display:flex;gap:8px;align-items:center;border-radius:14px;padding:10px 14px;font-size:14px;font-weight:500;margin-bottom:12px}
.badge.ok{background:var(--okbg);color:var(--ok)}.badge.warn{background:var(--warnbg);color:var(--warn)}.badge.bad{background:var(--badbg);color:var(--bad)}
/* photo slots */
.slots{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px}
.slot{background:var(--card);border-radius:20px;padding:12px;display:flex;flex-direction:column;gap:8px;min-height:160px;position:relative}
.slot .lb{font-weight:600;font-size:14px}
.slot .lb small{display:block;color:var(--muted);font-weight:500;font-size:12px}
.slot img{width:100%;height:100px;object-fit:cover;border-radius:12px;background:#fff}
.slot .pk{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:auto}
.slot .pk label{background:#fff;border-radius:12px;padding:10px 4px;text-align:center;font-size:12px;cursor:pointer;font-weight:600}
.slot .pk label:first-child{background:var(--y)}
.slot .pk label b{display:block;font-size:20px}
.slot .x{position:absolute;top:8px;right:8px;width:30px;height:30px;border-radius:50%;border:0;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.2);cursor:pointer}
.slot .st{font-size:12px;font-weight:600}.st.ok{color:var(--ok)}.st.warn{color:var(--warn)}
.slot.add{align-items:center;justify-content:center;text-align:center;background:#fff;border:2px dashed var(--line);cursor:pointer;color:var(--muted)}
.spin{display:inline-block;width:12px;height:12px;border:2px solid var(--line);border-top-color:var(--ink);border-radius:50%;animation:sp .8s linear infinite;vertical-align:-1px;margin-right:4px}
@keyframes sp{to{transform:rotate(360deg)}}
/* doc view */
.gallery{display:grid;gap:12px;margin-bottom:14px}
.gallery img{width:100%;border-radius:18px;background:var(--card);display:block}
.kv{background:var(--card);border-radius:var(--r);padding:4px 16px;margin-bottom:14px}
.kv div{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}
.kv div:last-child{border-bottom:0}
.kv span{color:var(--muted);font-size:14px}.kv b{text-align:right;font-weight:600;word-break:break-word}
.copy{border:0;background:#fff;border-radius:10px;padding:4px 8px;font-size:12px;cursor:pointer;margin-left:6px}
.back{border:0;background:var(--card);width:44px;height:44px;border-radius:14px;font-size:22px;cursor:pointer}
.hdr{display:flex;align-items:center;gap:12px;margin:6px 0 18px}
.hdr h1{margin:0;flex:1;min-width:0}
.extra-row{display:grid;grid-template-columns:1fr 1.4fr 36px;gap:8px;margin-bottom:8px}
.extra-row .in{min-height:44px;padding:10px 12px}
.extra-row button{border:0;background:#fff;border-radius:12px;cursor:pointer}
/* bottom nav */
nav.bn{position:fixed;left:0;right:0;bottom:0;background:#fff;border-top:1px solid var(--line);display:flex;justify-content:space-around;align-items:flex-end;padding:10px 6px calc(12px + env(safe-area-inset-bottom));z-index:20}
nav.bn a{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;font-size:13px;color:#4b5563;text-decoration:none;max-width:110px;font-weight:500}
nav.bn a svg{width:28px;height:28px}
nav.bn a.on{color:var(--ink);font-weight:700}
nav.bn a.on svg{color:var(--y2)}
nav.bn a.cam .circ{width:66px;height:66px;border-radius:50%;background:var(--y);color:#111;display:grid;place-items:center;margin-top:-34px;box-shadow:0 6px 18px rgba(255,184,0,.45)}
nav.bn a.cam svg{width:30px;height:30px;color:#111}
.toast{position:fixed;left:50%;bottom:calc(var(--nav) + 30px);transform:translateX(-50%);background:var(--ink);color:#fff;padding:12px 18px;border-radius:14px;z-index:60;max-width:90%;text-align:center}
.empty{text-align:center;padding:34px 12px;color:var(--muted);background:var(--card);border-radius:var(--r)}
.colors{display:flex;gap:10px;flex-wrap:wrap}
.colors button{width:36px;height:36px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1px var(--line);cursor:pointer}
.colors button.on{box-shadow:0 0 0 3px var(--ink)}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.92);z-index:80;display:grid;place-items:center;padding:12px}
.lightbox img{max-width:100%;max-height:100%;border-radius:8px}
@media (max-width:360px){.grid2{grid-template-columns:1fr}.tile{width:150px}}
