
:root{--brand:#e3231f;--primary:#4a7ba6;--primary-dark:#3c6589;--primary-soft:rgba(74,123,166,.16);--danger:#c0675f;--ink:#16181d;--line:#e7e7e9;--bg:#f2f4f8;--muted:#6b6f76;}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{margin:0;}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased;}
header{background:#fff;color:var(--ink);padding:14px 18px;position:sticky;top:0;z-index:5;border-bottom:1px solid var(--line);box-shadow:0 1px 4px rgba(15,23,42,.04);}
header .wrap{max-width:680px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;}
.brandform{margin:0;}
.brand{font-weight:800;letter-spacing:.06em;font-size:18px;color:var(--ink);background:none;border:0;padding:0;cursor:pointer;}
.brand b{color:var(--brand);}
.brand:hover,.brand:active,.brand:focus{background:none;color:var(--ink);}
.logout{color:var(--muted);font-size:13px;font-weight:600;text-decoration:none;border:1px solid #d7d9dd;background:#fff;padding:7px 12px;border-radius:9px;white-space:nowrap;}
.logout:hover{color:var(--ink);border-color:#b9bcc2;}
main{max-width:680px;margin:0 auto;padding:18px 14px 30px;}
footer{max-width:680px;margin:0 auto;padding:8px 14px 50px;color:#aab;font-size:12px;text-align:center;}
footer a{color:inherit;font-size:inherit;text-decoration:underline;}
footer a:hover{color:var(--primary);}
.card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px;box-shadow:0 1px 3px rgba(0,0,0,.05);}
.card.narrow{max-width:460px;margin:0 auto;}
h2{font-size:20px;margin:0 0 4px;}
.sub{color:var(--muted);font-size:14px;margin:0 0 18px;}
label{display:block;font-weight:700;margin:18px 0 4px;font-size:14px;}
.hint{color:var(--muted);font-size:12.5px;margin:0 0 8px;line-height:1.45;}
.req{color:var(--brand);font-weight:700;}
.opt{color:#9aa0a8;font-weight:400;font-size:12px;}
.cur{font-size:12.5px;color:#8a6d00;background:#fff7df;border:1px solid #f0e3b0;border-radius:8px;padding:8px 10px;margin:0 0 8px;overflow-wrap:anywhere;word-break:break-word;}
.cur span{font-weight:600;}
input[type=text],input[type=email],input[type=password],input[type=number],input[type=url],textarea{width:100%;padding:12px 13px;border:1px solid #cfd1d4;border-radius:12px;font-size:16px;outline:none;font-family:inherit;background:#fff;}
input:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-soft);}
textarea{resize:vertical;line-height:1.5;}
.urlfield{margin-top:8px;font-size:13px;}
input.file{width:100%;padding:12px;border:1.5px dashed #c7c9cc;border-radius:12px;background:#fafafa;font-size:14px;}
button{background:#e8f0f9;color:#3b74b8;border:1px solid #d4e3f3;border-radius:12px;padding:13px 22px;font-size:15px;font-weight:700;cursor:pointer;}
button:hover{background:#dce9f5;}
button:active{transform:translateY(1px);}
button.ghost{background:#f0f1f3;color:#4b5563;border-color:#e2e4e8;}
button.ghost:hover{background:#e6e8eb;}
button.danger{background:#fdecec;color:#c0392b;border-color:#f8d3d1;}
button.danger:hover{background:#fadfde;}
.actions{display:flex;gap:10px;margin-top:22px;flex-wrap:wrap;}
/* CSS-only saving overlay (no JS — CSP). Visible ONLY while the submit button
   is pressed (:active) or focused (:focus). Chrome/Edge/Firefox keep the
   button focused while the POST is in flight, so the overlay stays up until
   the redirect lands; Safari never focuses buttons on click, so there it only
   flashes during the press. NO transitions/delays here — an earlier latch
   (9999s transition-delay) stuck forever on older Safari; a live-state-only
   rule cannot stick, on any browser. */
.saving{position:fixed;inset:0;z-index:60;display:none;align-items:center;justify-content:center;background:rgba(242,244,248,.78);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);pointer-events:none;}
.actions button:active~.saving,.actions button:focus~.saving{display:flex;}
.savingcard{background:#fff;border:1px solid var(--line);border-radius:18px;padding:26px 30px;box-shadow:0 10px 30px rgba(15,23,42,.14);display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;max-width:320px;margin:0 16px;}
.savingcard b{font-size:16px;color:var(--ink);}
.savingcard .msg{color:var(--muted);font-size:13px;line-height:1.5;}
.spin{width:34px;height:34px;border-radius:50%;border:3px solid var(--primary-soft);border-top-color:var(--primary);animation:spin .8s linear infinite;margin-bottom:6px;}
@keyframes spin{to{transform:rotate(360deg)}}
.list{display:flex;flex-direction:column;gap:10px;}
.rowform,.backform,.addnew{margin:0;}
.rowbtn{width:100%;background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:14px;padding:16px;font-weight:600;font-size:15px;display:flex;justify-content:space-between;align-items:center;text-align:left;}
.rowbtn:hover,.rowbtn:active,.rowbtn:focus{border-color:var(--primary);background:#f4f8fb;color:var(--ink);}
a.rowbtn{text-decoration:none;box-sizing:border-box;font-size:15px;}
.rl{display:flex;align-items:center;gap:11px;min-width:0;flex:1;}
.rlt{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.rr{display:flex;align-items:center;gap:8px;flex:0 0 auto;margin-left:10px;}
.rr .arrow{margin-left:0;}
.when{color:#9aa0a8;font-size:11px;font-weight:400;white-space:nowrap;}
.mi{width:1.15em;height:1.15em;flex:0 0 auto;}
.toolbtn{width:100%;background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px;display:flex;align-items:center;gap:14px;color:var(--ink);font-weight:600;}
.ic2{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:35px;height:35px;border-radius:10px;}
.ic2 .mi{width:19px;height:19px;}
.mic{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:30px;height:30px;border-radius:9px;}
.mic .mi{width:16px;height:16px;}
/* faded TACT/Notion-style badges: soft tint bg + soft border + coloured icon */
.hb-blue{background:#e8f0f9;border:1px solid #d4e3f3;color:#3b74b8;}
.hb-violet{background:#f1ecfd;border:1px solid #e3d9fb;color:#7c4dd8;}
.hb-green{background:#e3f6ec;border:1px solid #cdecdc;color:#199d61;}
.hb-amber{background:#fdf3e0;border:1px solid #f8e5c0;color:#c07f10;}
.hb-red{background:#fdecec;border:1px solid #f8d3d1;color:#d64540;}
.hb-pink{background:#fdeaf0;border:1px solid #f9d2df;color:#e0447c;}
.hb-indigo{background:#eceafb;border:1px solid #dcd8f7;color:#5f5bd0;}
.hb-teal{background:#e2f4f8;border:1px solid #c9e9f0;color:#1f96b3;}
.hb-cyan{background:#e3f4fc;border:1px solid #cdeaf8;color:#2492c9;}
.hb-mint{background:#e0f7f5;border:1px solid #c6efec;color:#0da79e;}
.hb-orange{background:#fdefe2;border:1px solid #f9dfc4;color:#d97e14;}
.hb-brown{background:#f4ede4;border:1px solid #e9dcc9;color:#8d6b45;}
.hb-gray{background:#f0f1f3;border:1px solid #e2e4e8;color:#6b7280;}
.toolbtn:hover,.toolbtn:active,.toolbtn:focus{border-color:var(--primary);background:#f4f8fb;color:var(--ink);}
a.toolbtn{text-decoration:none;font-size:15px;box-sizing:border-box;}
.toolbtn .t{display:flex;flex-direction:column;text-align:left;flex:1;min-width:0;}
.toolbtn .t small{color:var(--muted);font-weight:400;font-size:12.5px;margin-top:2px;}
.toolbtn.disabled{opacity:.5;cursor:default;}
.arrow{color:var(--primary);font-size:22px;margin-left:10px;}
.items{display:flex;flex-direction:column;gap:10px;margin-bottom:18px;}
.item{display:flex;justify-content:space-between;align-items:center;gap:12px;border:1px solid var(--line);border-radius:14px;padding:13px 15px;}
.itemtext{display:flex;flex-direction:column;min-width:0;}
.itemtext strong{overflow:hidden;text-overflow:ellipsis;}
.itemtext span{color:var(--muted);font-size:13px;margin-top:2px;}
.itemact{display:flex;gap:8px;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;}
button.mini{padding:9px 14px;font-size:13px;background:#e8f0f9;color:#3b74b8;border:1px solid #d4e3f3;}
button.mini:hover{background:#dce9f5;}
button.mini.ghost{background:#f0f1f3;color:#4b5563;border-color:#e2e4e8;}
button.mini.ghost:hover{background:#e6e8eb;}
button.mini.mv{background:#f1ecfd;color:#7c4dd8;border-color:#e3d9fb;}
button.mini.mv:hover{background:#e9e1fb;}
button.mini.danger{background:#fdecec;color:#c0392b;border-color:#f8d3d1;}
button.mini.danger:hover{background:#fadfde;}
button.add{background:#fff;color:var(--primary);border:1.5px dashed var(--primary);width:100%;}
.viewpage{display:block;margin-top:14px;text-align:center;font-size:12.5px;font-weight:400;color:var(--muted);text-decoration:none;}
.viewpage:hover{color:var(--primary);text-decoration:underline;}
.linkback{background:#f1f2f4;color:var(--ink);padding:9px 15px;border-radius:10px;font-weight:600;font-size:14px;display:inline-block;margin-bottom:16px;}
.linkback:hover{background:#e6e7ea;}
/* dashboard */
.dash{display:flex;flex-direction:column;gap:12px;}
.dcard{background:#fff;border:1px solid #e4e8ee;border-radius:18px;padding:16px;box-shadow:0 1px 3px rgba(15,23,42,.06);}
.dhead{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:0 0 12px;}
.dhead h3{font-size:15.5px;font-weight:800;letter-spacing:-.01em;margin:0;}
.dtag{font-size:9.5px;font-weight:800;color:#98a2b3;text-transform:uppercase;letter-spacing:.1em;white-space:nowrap;}
.alist{border-top:1px solid #eef1f4;margin-top:2px;}
.arow{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid #f2f4f7;font-size:13px;font-weight:600;}
.arow:last-child{border-bottom:0;}
.arow .an{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.arow i{font-style:normal;color:var(--muted);font-weight:400;font-size:12px;white-space:nowrap;}
.note{color:var(--muted);font-size:13px;margin:4px 0 10px;line-height:1.5;}
.tiles{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;}
.tile2{background:#fff;border:1px solid #e4e8ee;border-radius:16px;padding:13px 14px;display:flex;flex-direction:column;gap:3px;min-width:0;box-shadow:0 1px 3px rgba(15,23,42,.06);}
.t2top{display:flex;justify-content:space-between;align-items:center;gap:8px;}
.t2top small{color:var(--muted);font-size:10.5px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.tile2 b{font-size:24px;line-height:1.15;letter-spacing:-.01em;}
.t2sub{font-size:11.5px;color:var(--muted);display:flex;align-items:center;gap:5px;}
.t2sub i{font-style:normal;}
.ibadge{width:30px;height:30px;border-radius:9px;display:flex;align-items:center;justify-content:center;flex:0 0 auto;}
.ibadge .mi{width:17px;height:17px;}
.ib-blue{background:#e6eef6;border:1px solid #d4e2ef;color:#3c6589;}
.ib-green{background:#e1f5ec;border:1px solid #c9ecdc;color:#0e8a5f;}
.ib-amber{background:#fdf1dd;border:1px solid #f7e3bd;color:#b97d0c;}
.ib-violet{background:#f1ecfd;border:1px solid #e4daf9;color:#7c4dd8;}
.ib-cyan{background:#e0f5fa;border:1px solid #c6ebf3;color:#0e7f9d;}
.delta{font-size:11.5px;font-weight:800;white-space:nowrap;}
.delta.up{color:#12995b;}
.delta.down{color:#d13530;}
.delta.flat{color:var(--muted);}
.spark{width:100%;height:22px;margin-top:2px;}
.spark polyline{stroke:var(--primary);}
.linechart{width:100%;height:auto;display:block;}
.gline{stroke:#eef1f4;stroke-width:1;}
.larea{fill:rgba(74,123,166,.13);}
.lline{stroke:var(--primary);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;}
.lpt{fill:#fff;stroke:var(--primary);stroke-width:1.6;}
.linechart .upd{fill:#f59e0b;}
.axis{fill:var(--muted);font-size:9px;font-family:inherit;}
.legend{color:var(--muted);font-size:11.5px;margin:2px 0 0;display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.sw{display:inline-block;width:14px;height:3px;border-radius:2px;background:#c9d9e8;}
.sw.line{background:var(--primary);}
.sw.dotleg{background:#f59e0b;border-radius:50%;width:8px;height:8px;}
.errdetail{color:#b0b4ba;font-size:10.5px;line-height:1.5;overflow-wrap:anywhere;margin:2px 0 0;}
.donutrow{display:flex;align-items:center;gap:18px;margin:2px 0 12px;}
.donut{width:108px;height:108px;flex:0 0 auto;}
.dhole{fill:none;stroke:#eef1f4;stroke-width:6.5;}
.dseg{fill:none;stroke-width:6.5;}
.dseg.sg{stroke:#5bc08a;}
.dseg.sy{stroke:#f0c25e;}
.dseg.sr{stroke:#e8877f;}
.dseg.s0{stroke:#7ba4cb;}.dseg.s1{stroke:#5cc99c;}.dseg.s2{stroke:#f2c063;}.dseg.s3{stroke:#ab90e8;}.dseg.s4{stroke:#66c8de;}.dseg.s5{stroke:#b6bfca;}
.cdot.s0{background:#7ba4cb;}.cdot.s1{background:#5cc99c;}.cdot.s2{background:#f2c063;}.cdot.s3{background:#ab90e8;}.cdot.s4{background:#66c8de;}.cdot.s5{background:#b6bfca;}
.dcenter{font-size:9.5px;font-weight:800;fill:var(--ink);font-family:inherit;}
.dcenter2{font-size:3.4px;fill:var(--muted);font-family:inherit;letter-spacing:.04em;}
.dlegend{min-width:0;}
.dlegend p{margin:5px 0;font-size:13px;display:flex;align-items:center;gap:8px;}
.dlegend b{font-size:14px;}
.kv{font-size:13.5px;margin:2px 0 8px;}
.kv b{font-size:15px;}
.kv small{color:var(--muted);font-weight:400;}
.kv.bad{color:#c41a16;font-weight:700;}
.kv.good2{color:#1c7a1c;font-weight:700;}
.brows{display:flex;flex-direction:column;gap:7px;margin:4px 0 6px;}
.brow{display:grid;grid-template-columns:minmax(90px,38%) 1fr 34px;align-items:center;gap:8px;font-size:12.5px;}
.brow .bt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.brow .bn{text-align:right;font-weight:700;color:var(--primary-dark);}
.hbar{width:100%;height:9px;}
.hbar .hbg{fill:#eef1f4;}
.hbar .hfill{fill:var(--primary);}
.hbar .hf0{fill:#7ba4cb;}.hbar .hf1{fill:#5cc99c;}.hbar .hf2{fill:#f2c063;}.hbar .hf3{fill:#ab90e8;}.hbar .hf4{fill:#66c8de;}.hbar .hf5{fill:#f096ba;}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px;}
.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);border-radius:999px;padding:5px 10px;font-size:12px;font-weight:600;background:#fff;white-space:nowrap;}
.chip i{font-style:normal;color:var(--muted);font-weight:400;font-size:11px;}
.cdot{display:inline-block;width:8px;height:8px;border-radius:50%;flex:0 0 auto;}
.cdot.g{background:#5bc08a;}
.cdot.y{background:#f0c25e;}
.cdot.r{background:#e8877f;}
.hchips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px;}
.hchip{display:inline-block;border-radius:999px;padding:5px 11px;font-size:12px;font-weight:600;background:#f1f3f5;color:var(--ink);white-space:nowrap;}
.hchip.warn{background:#fdf1e3;color:#9a5b00;}
.hchip.ok{background:#e7f6e7;color:#1c7a1c;}
.brokenlink{font-size:12px;color:#9a3b36;margin:2px 0;overflow-wrap:anywhere;}
.recent{margin-top:8px;border-top:1px dashed var(--line);padding-top:8px;}
/* public content feed */
.pub{max-width:680px;margin:0 auto;padding:22px 16px 44px;}
.pub h1{font-size:19px;margin:0 0 4px;}
.pubsub{color:var(--muted);font-size:12px;margin:0 0 16px;line-height:1.5;}
.pub h2{font-size:16px;margin:20px 0 4px;padding-top:14px;border-top:1px solid var(--line);}
.pub h3{font-size:11px;font-weight:800;color:#98a2b3;text-transform:uppercase;letter-spacing:.08em;margin:10px 0 4px;}
.ev{background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px 13px;margin:6px 0;}
.ev b{font-size:14px;display:block;overflow-wrap:anywhere;}
.ev p{margin:3px 0 0;font-size:12.5px;color:#3f434a;line-height:1.5;overflow-wrap:anywhere;}
.ev .evs{color:var(--muted);}
.ev .evk{color:var(--muted);}
.ev a{color:var(--primary);word-break:break-all;}
.evpage{color:#b0b4ba;font-size:11px;margin:4px 0 0;}
/* activity log */
.logtools{display:flex;gap:8px;align-items:center;margin:2px 0 8px;flex-wrap:wrap;}
.logsearch{margin:0;display:flex;gap:8px;flex:1;min-width:200px;}
.logsearch input{flex:1;padding:9px 12px;font-size:14px;border-radius:10px;}
.csvbtn{display:inline-block;background:#eceef0;color:var(--ink);font-size:13px;font-weight:700;padding:9px 14px;border-radius:10px;text-decoration:none;white-space:nowrap;}
.csvbtn:hover{background:#e2e4e7;}
.logcount{color:var(--muted);font-size:12px;margin:0 0 8px;}
.logbox{max-height:62vh;overflow-y:auto;border:1px solid var(--line);border-radius:12px;padding:6px 12px;background:#fafbfc;-webkit-overflow-scrolling:touch;}
.logline{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:10.5px;color:#5b6068;margin:0;padding:5px 0;border-bottom:1px solid #f0f1f3;line-height:1.5;overflow-wrap:anywhere;}
.logline:last-child{border-bottom:0;}
.logline .lt{color:#9aa0a8;}
.logline .la{font-weight:700;}
.la-add{color:#12995b;}
.la-edit{color:#3c6589;}
.la-del{color:#d13530;}
.la-move{color:#b97d0c;}
.la-other{color:#6b6f76;}
.logline .lc{color:#9aa0a8;}
.logline .lw{color:#8b5cf6;}
.rolebadge{display:inline-block;background:#f1ecfd;color:#7c4dd8;font-size:10.5px;font-weight:800;border-radius:999px;padding:2px 8px;vertical-align:2px;margin-left:4px;letter-spacing:.03em;}
.item.srow{flex-direction:row;align-items:center;padding:9px 13px;}
.item.srow form{margin:0;flex:0 0 auto;}
.item.srow .itemact{flex-wrap:nowrap;}
.pwchip{display:inline-block;background:#fdf1dd;color:#9a5b00;font-size:10.5px;font-weight:700;border-radius:999px;padding:2px 8px;vertical-align:2px;margin-left:4px;}
.staffh{font-size:15px;margin:22px 0 2px;}
label.chk{display:flex;align-items:center;gap:9px;font-weight:600;font-size:14px;margin:16px 0 4px;cursor:pointer;}
label.chk input{width:18px;height:18px;accent-color:var(--primary);}
.rhead{font-size:10px;font-weight:800;color:#98a2b3;text-transform:uppercase;letter-spacing:.09em;margin:10px 0 3px;}
.rline{font-size:12.5px;margin:4px 0;line-height:1.45;}
.rline small{color:var(--muted);}
.steps{margin:0 0 6px;padding:14px 16px 14px 34px;background:#f4f8fb;border:1px solid #d9e4ee;border-radius:12px;font-size:14px;color:var(--ink);display:flex;flex-direction:column;gap:8px;}
.steps li{line-height:1.5;}
.steps b{color:var(--primary-dark);}
.err{color:var(--danger);font-size:14px;margin:8px 0;}
.signin{margin-top:22px;width:100%;}
.banner{padding:13px 16px;border-radius:12px;margin-bottom:16px;font-weight:600;font-size:14px;}
.banner.good{background:#e7f6e7;color:#1c7a1c;border:1px solid #bfe6bf;}
.banner.bad{background:#fdecec;color:#c41a16;border:1px solid #f4c4c2;}
@media (max-width:480px){
.card{padding:18px;}
.item{flex-direction:column;align-items:stretch;}
.itemact{flex-wrap:nowrap;gap:6px;}
.itemact form{flex:1;margin:0;}
.itemact .mini{width:100%;padding:9px 4px;font-size:12.3px;white-space:nowrap;}
.item.srow .itemact form{flex:0 0 auto;}
.item.srow .itemact .mini{width:auto;padding:9px 12px;}
.actions button{flex:1;}
}
