/* DOAC Apps Portal, in the look shared with the other DOAC tools: the DOAC box logo, DOAC red #FF3333, Inter.
   Served signed out, so it never names a tool. White text never sits on --red: at 14px that pair is 3.6:1, under
   WCAG AA, so surfaces carrying white text use --red-ink. */
:root { color-scheme:dark; --bg:#070707; --panel:#111; --panel-2:#181818; --text:#f5f5f5; --muted:#8f8f8f;
        --rule:#222; --rule-2:#2c2c2c; --red:#ff3333; --red-ink:#e62222; --yellow:#ffc954; --green:#8af19e; --r:16px; }
* { box-sizing:border-box; }
html, body { margin:0; background:var(--bg); color:var(--text); font:15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
             -webkit-font-smoothing:antialiased; }
body::before { content:""; position:fixed; inset:0; pointer-events:none; z-index:0; opacity:.05;
               background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
a { color:var(--text); }
::selection { background:var(--red-ink); color:#fff; }
:focus-visible { outline:2px solid var(--red); outline-offset:2px; border-radius:6px; }

h1 { font-size:28px; font-weight:700; letter-spacing:-.02em; line-height:1.1; margin:22px 0 8px; }
.lede { color:#bdbdbd; margin:0 auto 6px; font-size:15px; }
.hint { color:var(--muted); font-size:13px; }

.btn { display:inline-block; background:var(--red-ink); color:#fff; border:1px solid var(--red-ink); border-radius:999px; padding:11px 20px;
       font:700 14px Inter, system-ui, sans-serif; cursor:pointer; text-decoration:none; letter-spacing:.01em;
       box-shadow:0 6px 22px rgba(255,51,51,.24); transition:transform .12s, box-shadow .12s; }
.btn:hover { transform:translateY(-1px); box-shadow:0 10px 28px rgba(255,51,51,.34); }
.btn.quiet { background:transparent; border-color:var(--rule-2); color:var(--text); box-shadow:none; }
.btn.quiet:hover { border-color:var(--muted); }
input { font:inherit; font-size:14px; color:var(--text); background:var(--panel-2); border:1px solid var(--rule-2); border-radius:12px;
        padding:10px 12px; max-width:100%; }
input:focus { outline:none; border-color:var(--red); }

/* signed out and messages: one centred card */
.login { position:relative; z-index:1; max-width:460px; margin:14vh auto 0; padding:44px 36px 36px; text-align:center;
         background:radial-gradient(500px 220px at 50% 0%, rgba(255,51,51,.25), transparent 70%), var(--panel);
         border:1px solid var(--rule); border-radius:22px; box-shadow:0 30px 90px rgba(0,0,0,.6); }
.login .logo { height:58px; }
.login .go { margin:26px 0 0; }
.login form.dev { margin-top:26px; padding-top:18px; border-top:1px solid var(--rule); }
.login form.dev input { width:100%; margin:0 0 8px; }

/* signed in: a sidebar and a main panel */
.shell { position:relative; z-index:1; display:grid; grid-template-columns:260px minmax(0,1fr); gap:10px; padding:10px; min-height:100vh; }
.panel { background:var(--panel); border:1px solid var(--rule); border-radius:var(--r); }
.side { display:flex; flex-direction:column; position:sticky; top:10px; height:calc(100vh - 20px); }
.side .nav { padding:18px 18px 20px; flex:1; }
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; margin-bottom:18px; }
.brand img { height:30px; display:block; }
.tag { background:var(--red-ink); color:#fff; font-weight:800; font-size:13px; letter-spacing:.06em; padding:4px 8px; border-radius:6px; }
.side nav a { display:block; padding:9px 10px; border-radius:10px; font-weight:600; text-decoration:none; color:#cfcfcf; }
.side nav a:hover, .side nav a.on { background:var(--panel-2); color:#fff; }
main.main { position:relative; padding:24px clamp(18px, 3vw, 40px) 80px; border:1px solid var(--rule); border-radius:var(--r); min-width:0;
            background:radial-gradient(1200px 340px at 0% 0%, rgba(255,51,51,.22), transparent 60%), var(--bg); }
main.main h1 { font-size:clamp(30px, 3.4vw, 44px); letter-spacing:-.03em; line-height:1.05; margin:8px 0 22px; }
.topbar { display:flex; justify-content:flex-end; align-items:center; gap:12px; margin-bottom:10px; font-size:12px; color:var(--muted); }
.pill { display:inline-flex; align-items:center; gap:8px; background:rgba(17,17,17,.8); border:1px solid var(--rule-2); border-radius:999px;
        padding:4px 12px 4px 4px; color:var(--text); }
.avatar { width:22px; height:22px; border-radius:50%; background:var(--red-ink); color:#fff; display:grid; place-items:center; font-size:11px; font-weight:800; }
form.inline { display:inline; }
button.link { background:none; border:0; color:var(--muted); font:inherit; cursor:pointer; padding:0; }
button.link:hover { color:#fff; }

/* tool cards: the name's link covers the whole card; the short link sits above it so it can be selected */
.tools { list-style:none; margin:0; padding:0; display:grid; gap:12px; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); }
.tool { position:relative; display:flex; flex-direction:column; gap:8px; background:var(--panel); border:1px solid var(--rule);
        border-radius:var(--r); padding:18px 20px; transition:transform .12s, border-color .12s, background .12s; }
.tool:has(h3 a):hover { transform:translateY(-1px); border-color:var(--rule-2); background:var(--panel-2); }
.tool:has(h3 a:focus-visible) { border-color:var(--red); }
.tool .head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.tool h3 { margin:0; font-size:18px; font-weight:700; letter-spacing:-.01em; }
.tool h3 a { text-decoration:none; }
.tool h3 a::after { content:""; position:absolute; inset:0; border-radius:inherit; }
.tool .desc { margin:0; color:#bdbdbd; font-size:14px; }
.tool .meta { margin:auto 0 0; padding-top:6px; display:flex; flex-wrap:wrap; gap:4px 14px; color:var(--muted); font-size:12px; }
.tool .short { position:relative; z-index:1; user-select:all; cursor:text; }
.badge { flex:none; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; border:1px solid currentColor;
         border-radius:999px; padding:2px 9px; }
.badge.live { color:var(--green); } .badge.wip { color:var(--yellow); } .badge.planned { color:var(--muted); }
.state::before { content:""; display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:6px; background:currentColor; }
.state.up { color:var(--green); } .state.down { color:var(--red); } .state.wait { color:var(--muted); }

/* a tool inside the hub: a slim bar over a frame that fills the rest of the window */
body.app { height:100vh; display:flex; flex-direction:column; }
.appbar { position:relative; z-index:2; flex:none; display:flex; align-items:center; gap:14px; padding:8px 14px;
          background:var(--panel); border-bottom:1px solid var(--rule); font-size:13px; }
.appbar a { text-decoration:none; color:var(--muted); }
.appbar a:hover { color:#fff; }
.appbar .name { font-weight:700; color:var(--text); font-size:14px; }
.appbar .newtab { margin-left:auto; }
.menu { position:relative; }
.menu summary { list-style:none; cursor:pointer; display:inline-flex; align-items:center; gap:8px; background:rgba(17,17,17,.8);
                border:1px solid var(--rule-2); border-radius:999px; padding:3px 12px 3px 3px; }
.menu summary::-webkit-details-marker { display:none; }
.menu .drop { position:absolute; right:0; top:calc(100% + 6px); min-width:220px; padding:12px 14px; background:var(--panel-2);
              border:1px solid var(--rule-2); border-radius:12px; box-shadow:0 12px 40px rgba(0,0,0,.5); }
.menu .drop p { margin:0 0 8px; color:var(--muted); overflow-wrap:anywhere; }
.stage { position:relative; z-index:1; flex:1; }
.frame { position:absolute; inset:0; width:100%; height:100%; border:0; background:var(--bg); }

/* the loading screen while a tool starts up: over the whole dashboard, or over the frame on a tool's page */
.splash { position:fixed; inset:0; z-index:10; display:flex; flex-direction:column; align-items:center; justify-content:center;
          gap:6px; padding:24px; text-align:center; background:var(--bg); }
.splash[hidden], .splash [hidden] { display:none; }
.stage .splash { position:absolute; }
.splash img { height:46px; margin-bottom:12px; }
.splash p { margin:0; }
.splash-name { font-size:22px; font-weight:700; letter-spacing:-.02em; }
.splash-wait { display:inline-flex; align-items:center; gap:10px; color:var(--muted); }
.splash-slow { max-width:360px; color:#bdbdbd; }
.splash-slow a { color:var(--text); font-weight:600; }
.spinner { width:16px; height:16px; border:2px solid var(--rule-2); border-top-color:var(--red); border-radius:50%;
           animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

@media (max-width:520px) { .login { margin:6vh 16px 0; padding:36px 22px 28px; } }
@media (max-width:900px) { .shell { grid-template-columns:1fr; } .side { position:static; height:auto; } main.main { padding:18px 16px 60px; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation:none; display:none; } }
