/* GGS Flow, hosted variant. No fonts or files from elsewhere: the content security
   policy only allows what this server serves itself. */
:root {
  --ink: #16181d; --ink-2: #4a5160; --ink-3: #7b8394;
  --paper: #f4f5f7; --card: #ffffff; --line: #e2e5ea; --line-2: #eef0f3;
  --side: #14161b; --side-2: #1f232b; --side-ink: #c9ced8;
  --red: #cf142b; --red-dark: #a80f22; --red-soft: #fdecee;
  --green: #12805c; --green-soft: #e4f5ee; --amber: #9a5b00; --amber-soft: #fff3dc; --grey-soft: #eceef2;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
p { margin: 0 0 12px; line-height: 1.5; }
a { color: var(--red-dark); }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.muted { color: var(--ink-3); }
.boot { margin: 20vh auto; text-align: center; color: var(--ink-3); font-size: 20px; letter-spacing: .04em; }

/* ---- frame */
.frame { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 14px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 12px; color: #fff; font-weight: 650; font-size: 17px; letter-spacing: .01em; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--red); display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; }
.where { margin: 0 4px 8px; padding: 7px 10px; border-radius: 8px; background: var(--side-2); font-size: 13px; }
.where b { display: block; color: #fff; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #3a404c transparent; }
.nav .items { display: flex; flex-direction: column; gap: 1px; }
.nav .items[hidden] { display: none; }
.nav button { all: unset; cursor: pointer; padding: 6px 12px; border-radius: 7px; font-size: 14px; line-height: 20px; display: flex; justify-content: space-between; align-items: center; }
.nav button.group { margin-top: 6px; padding: 4px 10px 3px; font-size: 11px; line-height: 16px; letter-spacing: .09em; text-transform: uppercase; color: #8a92a3; }
.nav button.group:hover { background: none; color: #fff; }
.nav .fold { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-bottom: 3px; }
.nav button.group[aria-expanded="false"] .fold { transform: rotate(-45deg); margin-bottom: 0; }
.nav button:hover { background: var(--side-2); color: #fff; }
.nav button:focus-visible { outline: 2px solid #fff; }
.nav button.on { background: var(--red); color: #fff; font-weight: 600; }
.nav .count { background: #fff; color: var(--red-dark); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.me { border-top: 1px solid #2a2f39; margin-top: 8px; padding: 10px 8px 0; font-size: 13px; }
.me b { color: #fff; display: block; font-weight: 600; }
.me .row { display: flex; gap: 12px; margin-top: 5px; }
.me button { all: unset; cursor: pointer; color: var(--side-ink); text-decoration: underline; font-size: 13px; }
.me button:hover { color: #fff; }
.main { padding: 32px 40px 64px; max-width: 1180px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { color: var(--ink-2); margin: 0; max-width: 70ch; }
.main > .banner { flex: none; margin: 12px 16px 0; }
.main:not(.view-workflows) > .banner { margin: 0 0 18px; }
.banner { background: var(--amber-soft); color: var(--amber); border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; font-size: 14px; }

/* ---- parts */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 18px 22px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.tile .label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.tile .value { font-size: 30px; font-weight: 650; margin: 6px 0 2px; letter-spacing: -.02em; }
.tile .note { font-size: 13px; color: var(--ink-2); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; padding: 12px 22px; border-bottom: 1px solid var(--line); background: #fafbfc; }
td { padding: 13px 22px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
.empty { padding: 28px 22px; color: var(--ink-3); text-align: center; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: var(--grey-soft); color: var(--ink-2); margin: 1px 4px 1px 0; }
.pill.good { background: var(--green-soft); color: var(--green); }
.pill.wait { background: var(--amber-soft); color: var(--amber); }
.pill.bad { background: var(--red-soft); color: var(--red-dark); }
button.btn, a.btn { font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 8px; padding: 9px 16px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; display: inline-block; }
.btn:hover { border-color: #c5cad3; background: #fafbfc; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.danger { color: var(--red-dark); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.btn + .btn { margin-left: 8px; }
label.field { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label.field .hint { display: block; font-weight: 400; color: var(--ink-3); margin-top: 3px; }
input[type=text], input[type=password], input[type=email], select, textarea { font: inherit; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #cfd4dc; border-radius: 8px; background: #fff; color: var(--ink); }
textarea { min-height: 150px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
textarea.short { min-height: 60px; font: inherit; }
[hidden] { display: none !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 10px; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--red); }
.check small { display: block; color: var(--ink-3); }
.copy { display: flex; gap: 8px; align-items: center; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 4px 0 14px; word-break: break-all; }
.copy span { flex: 1; }
.steps { margin: 0 0 12px; padding-left: 20px; line-height: 1.7; color: var(--ink-2); }

input[type=number], input[type=datetime-local], input[type=file] { font: inherit; width: 100%; margin-top: 5px; padding: 8px 11px; border: 1px solid #cfd4dc; border-radius: 8px; background: #fff; color: var(--ink); }
.card.flush { overflow-x: auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.secret { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 26px; letter-spacing: .18em; text-align: center; background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 6px 0 14px; user-select: all; }
.logo-box { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo-box .preview { width: 220px; height: 110px; border: 1px dashed #cfd4dc; border-radius: 10px; display: grid; place-items: center; background: #fafbfc; color: var(--ink-3); font-size: 13px; }
.logo-box .preview img { max-width: 200px; max-height: 96px; }
.small-text { font-size: 13px; color: var(--ink-2); }
td .err { color: var(--red-dark); font-size: 13px; }
pre.cmd { background: var(--side); color: #e6e9ef; border-radius: 8px; padding: 12px 14px; font-size: 12.5px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 4px 0 14px; }

/* ---- sign in */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, #2a2f39 0, var(--side) 60%); }
.gate .box { width: 100%; max-width: 400px; background: var(--card); border-radius: 14px; padding: 34px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.gate .brand { color: var(--ink); padding: 0 0 18px; }
.gate h1 { font-size: 21px; }
.gate .or { text-align: center; color: var(--ink-3); font-size: 12px; margin: 16px 0; text-transform: uppercase; letter-spacing: .1em; }
.gate .btn { width: 100%; text-align: center; padding: 11px 16px; }
.error { background: var(--red-soft); color: var(--red-dark); border-radius: 8px; padding: 9px 12px; font-size: 14px; margin-bottom: 14px; }
body.plain { display: grid; place-items: center; }
.notice { max-width: 460px; background: var(--card); border-radius: 14px; padding: 32px; box-shadow: var(--shadow); margin: 24px; }

/* ---- dialog and toasts */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 24px 80px rgba(0,0,0,.35); color: var(--ink); }
dialog::backdrop { background: rgba(15,17,22,.55); }
dialog { max-height: calc(100vh - 32px); overflow: auto; }
dialog form { padding: 26px 28px; }
dialog .foot { display: flex; justify-content: flex-end; margin-top: 20px; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.toast { background: var(--side); color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; max-width: 420px; }
.toast.bad { background: var(--red-dark); }

@media (max-width: 820px) {
  .frame { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav button.group { display: none; }
  .nav .items, .nav .items[hidden] { display: contents !important; }
  .main { padding: 22px 16px 48px; }
  .grid2 { grid-template-columns: 1fr; }
  th, td { padding: 10px 12px; }
}
.card.flush h2.pad { padding: 16px 20px 4px; margin: 0; }
.card.flush > p.pad { padding: 0 22px; margin: 6px 0 12px; }
.card.flush > .upload { padding: 16px 22px 18px; border-top: 1px solid var(--line, #e5e7eb); background: #fafbfc; }
.upload h3 { margin: 0 0 10px; font-size: 14px; }
.upload-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.upload-row input[type=file] { flex: 1 1 320px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line, #d7dbe0); border-radius: 8px; background: #fff; }
.upload progress { width: 100%; margin-top: 10px; }
.upload .small-text { margin: 10px 0 0; }
