:root {
  color-scheme: light;
  --paper: #f3f5ef;
  --white: #fff;
  --ink: #1d2925;
  --muted: #78827c;
  --line: #dce2da;
  --green: #245c47;
  --green-dark: #194533;
  --green-pale: #e6eee6;
  --coral: #a64e3c;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1.4px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 24px; font-weight: 700; }
.brand-mark { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; color: var(--white); background: var(--green); font-family: var(--serif); font-size: 17px; font-weight: 400; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 4px; font-size: 13px; font-weight: 600; transition: background .16s ease, border-color .16s ease; }
.button-primary { color: var(--white); background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-quiet { color: var(--ink); background: transparent; border-color: var(--line); }
.button-quiet:hover { background: var(--white); border-color: #b7c3b8; }

.login-page { min-height: 100vh; }
.login-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(340px, .92fr) 1.08fr; }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 42px clamp(32px, 6vw, 88px) 34px; color: #f6f7f1; background-color: var(--green); background-image: linear-gradient(128deg, transparent 0 69%, rgba(255,255,255,.045) 69% 69.15%, transparent 69.15%), linear-gradient(35deg, transparent 0 78%, rgba(255,255,255,.07) 78% 78.12%, transparent 78.12%); }
.login-intro .wordmark { align-self: flex-start; }
.login-intro .brand-mark { color: var(--green); background: #e5eee4; }
.intro-copy { max-width: 460px; padding-bottom: 5vh; animation: arrive .55s ease both; }
.login-intro .eyebrow { color: #b4cfb9; }
.intro-copy h1 { margin: 22px 0 20px; font-family: var(--serif); font-size: clamp(42px, 5vw, 68px); font-weight: 400; line-height: 1.03; }
.intro-copy h1 em { color: #c4d9bd; font-weight: 400; }
.intro-note { max-width: 330px; margin: 0; color: #d3e0d4; font-size: 14px; line-height: 1.8; }
.intro-foot, .page-foot { margin: 0; font-size: 9px; font-weight: 700; letter-spacing: 1.15px; }
.intro-foot { color: #b4cfb9; }
.login-form-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 28px 30px; }
.login-form { width: min(100%, 370px); animation: arrive .55s .08s ease both; }
.login-form h2 { margin: 11px 0 7px; font-family: var(--serif); font-size: 33px; font-weight: 400; }
.form-intro { margin: 0 0 34px; color: var(--muted); line-height: 1.6; }
.login-form label, .relation-form label { display: block; margin: 18px 0 8px; font-size: 12px; font-weight: 650; }
.login-form input, .relation-form input, .relation-form textarea { width: 100%; height: 44px; padding: 0 12px; color: var(--ink); background: var(--white); border: 1px solid #cfd7ce; border-radius: 3px; outline: none; }
.relation-form textarea { height: auto; min-height: 100px; padding: 10px 12px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5; }
.login-form input:focus, .relation-form input:focus, .relation-form textarea:focus, .search-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(36, 92, 71, .1); }
.login-submit { width: 100%; margin-top: 23px; }
.login-submit span { margin-left: auto; font-size: 17px; }
.login-security { margin: 18px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.page-foot { margin-top: 72px; color: #89938c; }
.page-foot span { padding: 0 5px; color: var(--green); }
.form-error { margin: 14px 0 0; color: #a33e32; font-size: 12px; line-height: 1.5; }

.dashboard-page { min-height: 100vh; }
.topbar { display: flex; height: 72px; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 6vw, 88px); background: var(--white); border-bottom: 1px solid var(--line); }
.topbar .wordmark { font-size: 22px; }
.topbar-right { display: flex; align-items: center; gap: 23px; }
.workspace-label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.dashboard-main { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 62px 0 60px; animation: arrive .45s ease both; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 47px; }
.page-heading h1 { margin: 9px 0 5px; font-family: var(--serif); font-size: 43px; font-weight: 400; }
.heading-caption { margin: 0; color: var(--muted); }
.page-heading > .button { margin-bottom: 4px; }
.page-heading > .button span { font-size: 18px; font-weight: 400; }
.relation-section { border-top: 1px solid var(--line); }
.list-heading { display: flex; min-height: 84px; align-items: center; justify-content: space-between; gap: 20px; }
.list-heading > div:first-child { display: flex; align-items: baseline; gap: 13px; }
.list-heading h2 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 400; }
.result-count { color: var(--muted); font-size: 11px; }
.filters { display: flex; gap: 9px; }
.search-field { display: flex; width: 205px; height: 37px; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 3px; }
.search-field > span:first-child { font-size: 20px; line-height: 1; }
.search-field input { width: 100%; min-width: 0; padding: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 12px; }
.search-field input::placeholder { color: #929b94; }
.table-scroll { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 4px; }
table { width: 100%; min-width: 1200px; border-collapse: collapse; text-align: left; }
thead { background: #edf1eb; }
th { height: 42px; color: #66736b; font-size: 9px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
td, th { padding: 0 17px; }
td { height: 56px; border-top: 1px solid #e8ece6; font-size: 12px; }
.domain-cell { color: var(--ink); font-weight: 600; }
.public-key-cell { min-width: 220px; max-width: 260px; }
.public-key-cell code { display: block; max-height: 56px; overflow: auto; color: #53665b; font-size: 10px; white-space: pre; }
.jwt-cell { min-width: 330px; white-space: nowrap; }
.jwt-value { display: inline-block; width: 250px; overflow-x: auto; vertical-align: middle; color: #53665b; font-size: 10px; }
.jwt-copy { margin-left: 8px; }
.date-cell { color: var(--muted); white-space: nowrap; }
.row-actions { width: 145px; white-space: nowrap; text-align: right; }
.text-button { padding: 6px 5px; color: var(--green); background: none; border: 0; font-size: 11px; font-weight: 650; }
.text-button:hover { text-decoration: underline; }
.text-button-danger { margin-left: 9px; color: var(--coral); }
.table-message { margin: 0 0 12px; padding: 11px 14px; color: #8d3e32; background: #faece8; border-radius: 3px; font-size: 12px; }
.empty-state { padding: 66px 20px 70px; text-align: center; }
.empty-mark { display: grid; width: 39px; height: 39px; place-items: center; margin: 0 auto 15px; color: var(--green); background: var(--green-pale); border-radius: 50%; font-size: 20px; }
.empty-state h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 21px; font-weight: 400; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding-top: 15px; color: var(--muted); font-size: 11px; }
.pagination > div { display: flex; gap: 7px; }
.page-button { min-width: 37px; min-height: 34px; padding: 0; font-size: 15px; }
.relation-dialog { width: min(480px, calc(100% - 32px)); padding: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 22px 80px rgba(25, 49, 37, .22); }
.relation-dialog::backdrop { background: rgba(24, 37, 31, .48); backdrop-filter: blur(2px); }
.relation-form { padding: 27px 30px 25px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 26px; }
.dialog-heading h2 { margin: 8px 0 0; font-family: var(--serif); font-size: 27px; font-weight: 400; }
.icon-button { width: 34px; height: 34px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 3px; font-size: 22px; line-height: 1; }
.icon-button:hover { color: var(--ink); background: var(--white); }
.relation-form label { margin-top: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 27px; }

@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: 310px; padding: 25px 26px 22px; }
  .intro-copy { padding: 41px 0 24px; }
  .intro-copy h1 { margin: 14px 0 12px; font-size: 43px; }
  .intro-note { max-width: 400px; font-size: 12px; }
  .intro-foot { font-size: 8px; }
  .login-form-side { padding: 44px 25px 26px; }
  .login-form { max-width: 410px; }
  .page-foot { margin-top: 48px; }
  .dashboard-main { width: calc(100% - 40px); padding-top: 39px; }
  .topbar { height: 64px; padding: 0 20px; }
  .workspace-label { display: none; }
  .page-heading { align-items: flex-start; margin-bottom: 32px; }
  .page-heading h1 { font-size: 37px; }
  .heading-caption { max-width: 250px; font-size: 12px; line-height: 1.5; }
  .page-heading > .button { min-height: 37px; padding: 0 10px; font-size: 11px; white-space: nowrap; }
  .list-heading { align-items: flex-start; flex-direction: column; padding: 20px 0 14px; }
  .filters { width: 100%; }
  .search-field { flex: 1; width: auto; }
}
@media (max-width: 420px) {
  .topbar-right { gap: 0; }
  .dashboard-main { width: calc(100% - 28px); }
  .page-heading { gap: 12px; }
  .page-heading h1 { font-size: 33px; }
  .heading-caption { max-width: 195px; font-size: 11px; }
  .page-heading > .button { gap: 5px; padding: 0 8px; font-size: 10px; }
  .filters { flex-direction: column; }
  .search-field { flex: initial; width: 100%; }
  .relation-form { padding: 23px 20px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}