:root {
  color-scheme: dark;
  --accent: #2cbeff;
  --accent-subtle: rgb(44 190 255 / 15%);
  --accent-line: rgb(44 190 255 / 25%);
  --sidebar: #0a0a0a;
  --background: #121212;
  --surface: #1e1e1e;
  --surface-muted: #1a1a1a;
  --border: rgb(255 255 255 / 15%);
  --border-quiet: rgb(255 255 255 / 9%);
  --text: #fff;
  --subtle: rgb(255 255 255 / 85%);
  --muted: rgb(255 255 255 / 60%);
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text);
  background: var(--sidebar);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
code { font-family: var(--mono); overflow-wrap: anywhere; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 10;
  left: 1rem;
  top: 1rem;
  background: var(--accent);
  color: var(--sidebar);
  padding: .65rem 1rem;
  border-radius: .4rem;
}

.gateway {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: radial-gradient(ellipse 760px 560px at 30% 30%, rgb(44 190 255 / 9%), transparent 75%), var(--sidebar);
}

.brand { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; min-width: 0; }
.brand strong { display: block; color: var(--text); font-size: .875rem; letter-spacing: -.01em; line-height: 1.25; }
.brand small { display: block; margin-top: .2rem; font-size: .61rem; font-weight: 600; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--accent-line);
  border-radius: .55rem;
  background: var(--accent-subtle);
  color: var(--accent);
}

.gateway-brand { padding: 1.125rem 1.75rem; }
.gateway-main { display: grid; place-items: center; padding: 1rem 1rem 3.5rem; }
.gateway-card {
  width: min(100%, 27rem);
  border: 1px solid var(--accent-line);
  border-radius: .875rem;
  background: #101010;
  box-shadow: 0 1.5rem 4rem #0008, 0 0 3rem rgb(44 190 255 / 6%);
}
.gateway-card-head {
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border-quiet);
  font: .72rem var(--mono);
}
.gateway-card-head .icon { color: var(--accent); }
.gateway-card-body { padding: clamp(1.25rem, 6vw, 2rem); }
.gateway-card-body h1 { font-size: 1.5rem; letter-spacing: -.025em; }
.gateway-card-body p { margin-top: .6rem; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.gateway-card-body .button { margin-top: 1.25rem; width: 100%; }
.gateway-card-body .primary { box-shadow: 0 .35rem 1rem rgb(44 190 255 / 16%); }
.gateway-card-body [role="alert"] { color: #ffb6b4; }

.console { display: grid; grid-template-columns: 13.75rem minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--border); }
.sidebar .brand { min-height: 3.75rem; border-bottom: 1px solid var(--border-quiet); }
.sidebar nav { padding: .75rem .5rem; display: grid; gap: .25rem; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem .8rem;
  border-radius: .4rem;
  color: var(--muted);
  font-size: .875rem;
  white-space: nowrap;
}
.sidebar nav a:hover { background: rgb(255 255 255 / 5%); color: var(--text); }
.sidebar nav a[aria-current] { background: var(--accent-subtle); color: var(--accent); font-weight: 600; }
.suite-link-icon { width: 1rem; text-align: center; flex: none; }

.icon { position: relative; display: inline-block; width: 1rem; height: 1rem; flex: none; }
.icon-update::before {
  content: ''; position: absolute; left: .03rem; top: .19rem; width: .94rem; height: .84rem;
  border: 1.5px solid currentColor; border-radius: 50%; border-right-color: transparent; transform: rotate(-28deg);
}
.icon-update::after {
  content: ''; position: absolute; top: .08rem; right: .02rem; width: .35rem; height: .35rem;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0;
}
.icon-box::before {
  content: ''; position: absolute; inset: .15rem .1rem .08rem; border: 1.5px solid currentColor; border-radius: .18rem;
}
.icon-box::after {
  content: ''; position: absolute; left: .14rem; right: .14rem; top: .4rem; border-top: 1.5px solid currentColor;
}
.icon-code::before {
  content: ''; position: absolute; top: .34rem; left: .06rem; width: .42rem; height: .42rem;
  border: solid currentColor; border-width: 0 0 1.5px 1.5px; transform: rotate(45deg);
}
.icon-code::after {
  content: ''; position: absolute; top: .34rem; right: .06rem; width: .42rem; height: .42rem;
  border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg);
}
.icon-shield::before {
  content: ''; position: absolute; inset: .05rem .13rem; border: 1.5px solid currentColor;
  border-radius: .16rem .16rem .4rem .4rem;
}
.icon-shield::after {
  content: ''; position: absolute; left: .33rem; top: .28rem; width: .24rem; height: .39rem;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(40deg);
}

.workspace { min-width: 0; background: linear-gradient(146deg, var(--background) 60%, #141414); }
.topbar {
  min-height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .5rem clamp(.95rem, 2.5vw, 1.85rem);
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
}
.topbar-title { display: flex; align-items: center; gap: .625rem; font-size: .95rem; font-weight: 650; }
.topbar-title::before { content: ''; width: .23rem; height: 1.1rem; border-radius: .5rem; background: var(--accent); }
.account { display: flex; align-items: center; gap: .65rem; min-width: 0; font-size: .8rem; }
.staff-name { color: var(--subtle); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.avatar {
  display: grid; place-items: center; flex: none; border: 1px solid var(--accent-line); border-radius: 50%;
  width: 1.8rem; height: 1.8rem; background: var(--accent-subtle); color: var(--accent); font-size: .7rem; font-weight: 650;
}

.content { max-width: 85rem; padding: clamp(1rem, 3vw, 2.15rem); margin: 0 auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: clamp(1.5rem, 4vw, 1.95rem); line-height: 1.18; letter-spacing: -.035em; }
.page-header p, .panel-header p { margin-top: .35rem; color: var(--muted); font-size: .875rem; line-height: 1.45; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.2rem;
  padding: .48rem .78rem;
  border: 1px solid var(--border);
  border-radius: .4rem;
  background: rgb(255 255 255 / 4%);
  color: var(--subtle);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.button:hover:not(:disabled) { border-color: var(--accent-line); color: var(--accent); background: var(--accent-subtle); }
.button.primary { border-color: transparent; background: var(--accent); color: #07151c; }
.button.primary:hover:not(:disabled) { background: #76d6ff; color: #07151c; }
.button.danger { color: #ffb6b4; border-color: #693b3b; background: #311d1d; }
.button.danger:hover:not(:disabled) { color: #ffd5d4; border-color: #ac5555; background: #462525; }
.button.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.button.small { min-height: 1.875rem; padding: .3rem .55rem; font-size: .75rem; }

.catalog-layout { display: grid; grid-template-columns: minmax(12rem, 15.25rem) minmax(0, 1fr); align-items: start; gap: 1rem; }
.panel-stack { display: grid; gap: 1rem; }
.panel { min-width: 0; border: 1px solid var(--border-quiet); border-radius: .7rem; background: var(--surface-muted); overflow: hidden; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; padding: .95rem 1rem;
  border-bottom: 1px solid var(--border-quiet);
}
.panel-header h2 { font-size: 1.05rem; font-weight: 650; line-height: 1.3; }
.panel-header .package-name { margin: 0 0 .25rem; color: var(--accent); font: .75rem var(--mono); overflow-wrap: anywhere; }
.count { border: 1px solid var(--border); border-radius: .8rem; padding: .13rem .45rem; color: var(--muted); font-size: .72rem; }
.directory-list { display: grid; gap: .3rem; }
.directory-list:not(:empty) { padding: .45rem; }
.directory-list button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem .7rem;
  text-align: left; border: 1px solid transparent; border-radius: .4rem; background: transparent; color: var(--subtle);
}
.directory-list button:hover, .directory-list button[aria-pressed="true"] {
  background: rgb(44 190 255 / 9%); border-color: var(--accent-line); color: var(--accent);
}
.directory-name { display: block; font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.directory-meta, .meta { display: block; margin-top: .2rem; color: var(--muted); font-size: .74rem; line-height: 1.45; overflow-wrap: anywhere; }
.empty { padding: 1.05rem 1rem; color: var(--muted); font-size: .86rem; line-height: 1.55; }

.table-wrap { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .85rem; }
th, td { padding: .72rem .85rem; border-bottom: 1px solid var(--border-quiet); }
th { background: rgb(255 255 255 / 2%); color: var(--muted); font-size: .65rem; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgb(255 255 255 / 2%); }
td:first-child { overflow-wrap: anywhere; }
td:last-child { text-align: right; }
td time { white-space: nowrap; color: var(--subtle); }
.table-link { padding: 0; border: 0; background: transparent; color: var(--accent); text-align: left; font-weight: 650; overflow-wrap: anywhere; }
.table-link:hover { text-decoration: underline; }
.badge {
  display: inline-flex; gap: .25rem; align-items: center; max-width: 100%; padding: .2rem .43rem;
  border: 1px solid var(--border); border-radius: .8rem; color: var(--muted); background: rgb(255 255 255 / 4%);
  font-size: .68rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
}
.badge.published { color: #6ee7b7; background: rgb(16 185 129 / 15%); border-color: rgb(16 185 129 / 30%); }
.badge.staged { color: #fcd34d; background: rgb(245 158 11 / 12%); border-color: rgb(245 158 11 / 25%); }
.badge.public { color: var(--accent); background: var(--accent-subtle); border-color: var(--accent-line); }

.banner { margin-bottom: .9rem; padding: .65rem .8rem; border: 1px solid; border-radius: .45rem; font-size: .84rem; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.banner.error { color: #ffb6b4; border-color: #693b3b; background: #311d1d; }
.banner.success { color: #a7f3d0; border-color: #285245; background: #152920; }
.banner.info { color: #90ddff; border-color: var(--accent-line); background: #112229; }
.banner:empty { display: none; }
.bulk-panel { margin-bottom: 1rem; }
.bulk-panel .panel-header { border-bottom: none; }
.commands { border-top: 1px solid var(--border-quiet); font-size: .78rem; color: var(--muted); }
.commands summary { padding: .65rem 1rem; cursor: pointer; }
.commands > div { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .35rem 1rem; }
.commands > div:last-child { padding-bottom: .75rem; }
.commands code { color: var(--subtle); }
.record {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem 1rem;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border-quiet);
}
.record:last-child { border-bottom: 0; }
.record-main { min-width: 0; }
.record-title { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: .85rem; font-weight: 650; }
.record-title code { color: var(--accent); }
.record-actions { justify-content: flex-end; min-width: 0; }
.record-actions > p { flex-basis: 100%; text-align: right; }

dialog {
  width: min(33.75rem, calc(100% - 1.5rem));
  max-height: min(90dvh, 50rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1rem 3.5rem #0009;
}
dialog::backdrop { background: #000a; }
.dialog-header { padding: 1rem 1.15rem; border-bottom: 1px solid var(--border-quiet); }
.dialog-header h2 { margin: 0; font-size: 1.12rem; }
.dialog-header p { margin-top: .4rem; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.dialog-body { padding: 1rem 1.15rem; font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
.dialog-footer { justify-content: flex-end; padding: .75rem 1.15rem; border-top: 1px solid var(--border-quiet); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: .3rem; color: var(--subtle); font-size: .75rem; font-weight: 600; }
.field label span, .field-hint { color: var(--muted); font-weight: 400; }
.field-hint { margin-top: .25rem; font-size: .72rem; }
.field input, .field textarea {
  width: 100%; min-width: 0; padding: .52rem .6rem; border: 1px solid var(--border);
  border-radius: .4rem; background: var(--surface-muted); color: var(--text);
}
.field textarea { min-height: 4.5rem; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.fields .banner { margin-bottom: 0; }
.details { display: grid; gap: .7rem; }
.details dt { color: var(--muted); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .045em; }
.details dd { margin-top: .1rem; white-space: pre-wrap; }

@media (max-width: 850px) {
  .console { grid-template-columns: 11.25rem minmax(0, 1fr); }
  .catalog-layout { grid-template-columns: minmax(9.5rem, 11.5rem) minmax(0, 1fr); gap: .75rem; }
}

@media (max-width: 680px) {
  .console { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .brand { min-height: 3.1rem; padding: .6rem 1rem; }
  .sidebar nav { display: flex; flex-wrap: wrap; padding: .4rem .65rem; }
  .sidebar nav a { padding: .48rem .55rem; font-size: .8rem; }
  .topbar { min-height: 2.75rem; padding: .35rem .8rem; }
  .topbar-title { font-size: .8rem; }
  .avatar { display: none; }
  .catalog-layout { grid-template-columns: minmax(0, 1fr); }
  .directory-list { grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr)); }
  .record-actions { justify-content: flex-start; }
  .record-actions > p { text-align: left; }
}
