:root {
  color-scheme: light dark;
  --page: #f5f7f5;
  --surface: #ffffff;
  --ink: #17201e;
  --muted: #566461;
  --line: #d9e1dd;
  --teal: #286864;
  --teal-dark: #173f42;
  --soft-teal: #e4f0ed;
  --on-primary: #ffffff;
  --focus: #8b5716;
  --danger: #9b302b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #111816;
    --surface: #17211f;
    --ink: #eef5f1;
    --muted: #adc0bb;
    --line: #425650;
    --teal: #77c7bd;
    --teal-dark: #9adbd4;
    --soft-teal: #19312f;
    --on-primary: #101715;
    --focus: #e8b86c;
    --danger: #ffb5ab;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.62; }
a { color: var(--teal); text-underline-offset: .18em; }
a:hover { color: var(--teal-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex="-1"]:focus { outline: 3px solid var(--focus); outline-offset: 4px; }
.skip-link { position: absolute; top: 1rem; left: -9999px; z-index: 10; padding: .6rem 1rem; background: var(--surface); }
.skip-link:focus { left: 1rem; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 1rem clamp(1.25rem, 5vw, 4.5rem); border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-weight: 800; text-decoration: none; color: var(--ink); }
nav { display: flex; flex-wrap: wrap; gap: 1rem; }
nav a { padding-block: .35rem; }
main { margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 5vw, 4.5rem); }
.entry-layout { max-width: 52rem; min-height: 65vh; }
.owner-layout { max-width: 86rem; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 1rem; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.12; letter-spacing: -.025em; text-wrap: balance; }
h2 { margin-bottom: 1rem; font-size: 1.4rem; line-height: 1.3; }
p { max-width: 72ch; }
.intro { margin-bottom: 2rem; color: var(--muted); font-size: 1.12rem; }
section { margin-block: 2rem 3rem; }
.entry-layout section { padding-block: 1.5rem; border-block: 1px solid var(--line); }
.actions, .copy-row, .row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem; }
.actions { margin-block: 1.5rem; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .65rem 1rem; border: 1px solid var(--teal); border-radius: 8px; background: var(--surface); color: var(--teal); font: inherit; font-weight: 700; line-height: 1.3; cursor: pointer; text-decoration: none; text-align: center; }
button:hover, .button:hover { background: var(--soft-teal); color: var(--teal-dark); }
.primary { background: var(--teal); color: var(--on-primary); }
.primary:hover { background: var(--teal-dark); color: var(--on-primary); }
.quiet { padding-inline: .25rem; border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: .2em; }
.danger { color: var(--danger); }
button:disabled, input:disabled, select:disabled { opacity: .6; cursor: not-allowed; }
label { display: block; margin-bottom: .4rem; font-size: .95rem; font-weight: 700; }
input, select { width: 100%; min-width: 0; min-height: 44px; padding: .65rem .75rem; border: 1px solid var(--muted); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
input[type="number"] { max-width: 8rem; }
.help { margin-block: .5rem 1rem; color: var(--muted); font-size: .9rem; }
.message:empty { display: none; }
.message { padding-block: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.error { color: var(--danger); }
#owner-login { max-width: 30rem; }
#owner-login button { margin-top: .5rem; }
.issue-form { display: grid; grid-template-columns: minmax(13rem, 1.25fr) minmax(13rem, 1fr) minmax(8rem, .6fr); gap: 1rem 1.5rem; align-items: start; }
.issue-form .field:last-child { grid-column: 1 / -1; }
.result { padding: 1.5rem; background: var(--soft-teal); border-radius: 8px; }
.result h2 { margin-bottom: 1rem; }
.copy-row input { flex: 1 1 20rem; }
.result > .button { margin-top: .75rem; }
.invitation-list { padding-top: 2rem; border-top: 1px solid var(--line); }
.empty-state { padding-block: 1.5rem; color: var(--muted); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 1rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th:first-child, td:first-child { padding-left: 0; }
thead th { color: var(--muted); font-size: .85rem; }
tbody th { max-width: 16rem; }
td:last-child { width: 16rem; }
time { font-size: .9rem; }
.grant-status { font-size: .9rem; font-weight: 700; }
.grant-status.active { color: var(--teal); }
.grant-status.expired, .grant-status.revoked { color: var(--muted); }
.replace-form label { font-size: .85rem; }
.row-actions { flex-wrap: nowrap; gap: .5rem; align-items: stretch; }
.row-actions input { width: 4.75rem; flex: 0 0 4.75rem; }
.row-actions button { flex: 1; font-size: .85rem; padding-inline: .65rem; }
.revoke-form { margin-top: .4rem; }
.revoke-form button { font-size: .9rem; }
#owner-logout { margin-top: 2rem; }
footer { padding: 1.5rem clamp(1.25rem, 5vw, 4.5rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
footer p { margin-bottom: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .issue-form { grid-template-columns: 1fr; }
  .issue-form .field:last-child { grid-column: auto; }
  table, tbody, tr { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
  tbody th, tbody td, td:last-child { display: grid; grid-template-columns: minmax(6.5rem, .65fr) minmax(0, 1.35fr); gap: .5rem 1rem; width: 100%; max-width: none; border: 0; padding: .5rem 0; }
  tbody th::before, tbody td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; font-weight: 400; }
  td > form { grid-column: 2; }
  .row-actions { flex-wrap: wrap; }
  .row-actions button { flex: 1 1 6rem; }
  .result { padding: 1.25rem; }
}
@media (forced-colors: active) { button, .button, .result { border: 1px solid ButtonText; } }
