/* lifted straight from the portfolio so the two feel like the same place.
   if you change a color there, change it here too. yes, I know. */
:root {
  color-scheme: dark;
  font-family: ui-monospace, 'Cascadia Code', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  background: #211a29;
  color: #c4bacd;
  font-synthesis: none;
  --bg: #211a29;
  --raised: #2d2437;
  --sunk: #1b1522;
  --muted: #a79aae;
  --bright: #f2e9e4;
  --line: #51415e;
  --pink: #e58bb5;
  --yellow: #d4b57b;
  --blue: #73b5df;
  --cyan: #55c2bc;
  --violet: #aaa2e5;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.6; background: var(--bg); }
.page { width: min(100% - 48px, 1320px); margin: 0 auto; padding: 24px 0 24px; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 4px; overflow-wrap: anywhere; }
a:hover { color: var(--bright); }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--pink); outline-offset: 4px; }
::selection { color: var(--bg); background: var(--yellow); }
.pink { color: var(--pink); }
.yellow { color: var(--yellow); }
.blue { color: var(--blue); }
.cyan { color: var(--cyan); }
.violet { color: var(--violet); }
.muted { color: var(--muted); }
.bright { color: var(--bright); }
strong { font-weight: 500; }
h1, h2, h3 { color: var(--bright); font-weight: 500; }
h1 { font-size: 46px; line-height: 1.15; letter-spacing: -0.055em; margin: 0 0 10px; }
h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.4; letter-spacing: -0.04em; }
h3 { margin: 0 0 6px; font-size: 14px; }
p { margin: 0 0 12px; }
section + section { margin-top: 32px; }

.site-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; }
.wordmark { font-size: 24px; line-height: 1.3; text-decoration: none; letter-spacing: -0.04em; }
.tagline { margin: 0; font-size: 13px; color: var(--muted); font-style: italic; }
.nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; align-items: baseline; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--bright); }
.nav a[aria-current='page'] { color: var(--bright); text-decoration: underline; text-decoration-color: var(--pink); }
.nav button { all: unset; cursor: pointer; color: var(--muted); }
.nav button:hover { color: var(--pink); }
main { margin-top: 32px; }
.intro-note { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

.stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 26px; font-size: 12px; }
.stats > div { display: flex; flex-direction: column-reverse; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; color: var(--bright); font-size: 22px; font-variant-numeric: tabular-nums; }

label { display: block; font-size: 12px; color: var(--bright); margin-bottom: 6px; }
.hint { color: var(--muted); font-weight: 400; }
input, textarea, button, select { font: inherit; border-radius: 3px; }
input, textarea, select { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); background: var(--raised); color: var(--bright); font-size: 13px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--cyan); outline-offset: 2px; }
input[type='date'] { color-scheme: dark; }
textarea { display: block; resize: vertical; min-height: 70px; }
button { background: transparent; color: var(--cyan); padding: 8px 14px; border: 1px solid var(--cyan); cursor: pointer; font-size: 13px; }
button:hover { background: var(--raised); color: var(--bright); }
button:disabled { cursor: wait; opacity: 0.6; }
button.link { border: 0; padding: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
button.link:hover { color: var(--bright); background: none; }
button.link.danger:hover { color: var(--pink); }

summary { cursor: pointer; color: var(--yellow); width: fit-content; }
summary:hover { color: var(--bright); }
/* keys page: form always on the left, list on the right. same split + divider as the portfolio */
.keys-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 40px; align-items: start; }
.keys-layout > section + section { margin-top: 0; }
.create-panel { position: sticky; top: 24px; }
.create-panel .form { margin-top: 0; }
.create-panel .fresh-key { margin: 20px 0 0; }
.create-panel .fresh-key > code { font-size: 16px; }
.list-panel { padding-left: 32px; border-left: 1px solid var(--line); align-self: stretch; }
/* key + cfg line are long and unbreakable, let them wrap instead of clipping in the sidebar */
.create-panel .fresh-key pre { white-space: pre-wrap; word-break: break-all; }
.form { margin-top: 16px; max-width: 760px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field { min-width: 0; margin-bottom: 14px; }
.feedback { margin: 10px 0 0; font-size: 12px; }
.feedback:empty { display: none; }

.fresh-key { margin: 0 0 28px; padding: 14px 16px; border: 1px dashed var(--violet); border-radius: 3px; max-width: 760px; }
.fresh-key[hidden] { display: none; }
.fresh-key p { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.fresh-key > code { display: block; color: var(--bright); font-size: 20px; letter-spacing: 0.02em; margin-bottom: 10px; overflow-wrap: anywhere; }
.fresh-key pre { margin: 6px 0 0; }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input { max-width: 320px; }
.toolbar select { width: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 400; color: var(--muted); font-size: 12px; padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px 11px 0; border-bottom: 1px solid #3a2f45; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.key { all: unset; cursor: copy; color: var(--bright); white-space: nowrap; }
.key:hover { color: var(--yellow); }
.key:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
.actions { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.status::before { content: '* '; }
.status.active { color: var(--cyan); }
.status.unbound { color: var(--violet); }
.status.revoked { color: var(--pink); }
.status.expired { color: var(--yellow); }
.empty { color: var(--muted); padding: 24px 0; }
.num { font-variant-numeric: tabular-nums; }

/* code page */
.tabs { display: flex; gap: 22px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; padding: 0 0 8px; color: var(--muted); background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0; }
.tabs button:hover { color: var(--bright); background: none; }
.tabs button[aria-selected='true'] { color: var(--bright); border-bottom-color: var(--pink); }
.snippet { margin-bottom: 26px; }
.snippet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.snippet-head h3 { margin: 0; }
.snippet-head .file { color: var(--muted); font-size: 12px; }
pre { margin: 0; padding: 14px 16px; background: var(--sunk); border: 1px solid #3a2f45; border-radius: 3px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; tab-size: 4; }
pre code { color: var(--bright); font-family: inherit; }
.tok-c { color: #7d6f8a; font-style: italic; }
.tok-s { color: var(--yellow); }
.tok-k { color: var(--pink); }
.tok-n { color: var(--violet); }
.tok-f { color: var(--cyan); }
.code-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.code-aside { padding-left: 28px; border-left: 1px solid var(--line); font-size: 13px; }
.code-aside dl { margin: 0; }
:where(.code-aside) dt { color: var(--bright); margin-top: 10px; }
.code-aside dd { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(100%, 360px); }
.login h1 { font-size: 40px; }
.login .wordmark { display: inline-block; margin-bottom: 26px; font-size: 20px; }
.login button { margin-top: 4px; }

.site-footer { margin-top: 40px; display: flex; justify-content: space-between; gap: 20px; font-size: 12px; }
.site-footer p { margin: 0; }

.toast { position: fixed; bottom: 18px; right: 18px; background: var(--raised); color: var(--bright); border: 1px solid var(--line); padding: 8px 14px; border-radius: 3px; font-size: 12px; opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 999px) {
  .code-layout { grid-template-columns: 1fr; gap: 28px; }
  .code-aside { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
}

/* table turns into cards on phones. horizontal scrolling a license table on a
   phone at 2am to revoke a leaked key is not the vibe. */
@media (max-width: 760px) {
  .page { width: calc(100% - 32px); padding-top: 20px; }
  .site-header { flex-direction: column; gap: 6px; }
  .nav { margin-left: 0; }
  h1 { font-size: 38px; }
  .fields { grid-template-columns: 1fr; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; }
  thead { display: none; }
  table, tbody, tr, td { display: block; }
  tr { padding: 12px 0; border-bottom: 1px solid #3a2f45; }
  td { border: 0; padding: 3px 0; }
  td[data-label]::before { content: attr(data-label) ' '; color: var(--muted); font-size: 11px; }
  .actions { margin-top: 6px; }
  .site-footer { flex-direction: column; gap: 6px; }
}
/* CSP blocks inline style attrs, so the one-off spacing lives here */
.spaced { margin-top: 22px; }
.spaced-sm { margin-top: 10px; }

/* table needs ~900px to breathe. below that the sidebar steals too much, so stack */
@media (max-width: 1199px) {
  .keys-layout { grid-template-columns: 1fr; gap: 28px; }
  .create-panel { position: static; max-width: 560px; }
  .list-panel { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 22px; }
}
