:root {
  --bg: #0e0f12;
  --panel: #17191e;
  --panel-2: #1b1e24;
  --line: #2a2e36;
  --ink: #e9eaed;
  --ink-dim: #9498a2;
  --accent: #5b7cfa;
  --accent-dim: #34406b;
  --danger: #5a2f33;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(91,124,250,.08), transparent 34%),
    var(--bg);
  font-family: var(--font);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  padding: 12px;
  pointer-events: none;
}

.top-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 14px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(14,15,18,.8);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
  cursor: pointer;
  pointer-events: auto;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}

.top-button:hover,
.top-button:focus-visible {
  background: rgba(27,30,36,.95);
  border-color: rgba(91,124,250,.65);
  outline: none;
  transform: translateY(-1px);
}

.top-button svg {
  width: 14px;
  height: 14px;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 88px 20px 32px;
}

.workspace-card,
.fallback-card {
  width: min(680px, 100%);
  padding: 34px;
  background: rgba(23,25,30,.94);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.32);
}

.workspace-card {
  text-align: center;
}

.workspace-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(91,124,250,.1);
  border: 1px solid rgba(91,124,250,.22);
  border-radius: 12px;
}

.workspace-icon svg {
  width: 26px;
  height: 26px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workspace-card h1 {
  margin-top: 7px;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.08;
}

.workspace-copy,
.fallback-card p {
  max-width: 560px;
  margin: 13px auto 0;
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.6;
}

.workspace-actions {
  min-height: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}

.primary-button {
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #6a88fb;
  border-color: #6a88fb;
  outline: none;
  transform: translateY(-1px);
}

.secondary-button {
  color: var(--ink);
  background: var(--accent-dim);
  border: 1px solid rgba(91,124,250,.25);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  background: rgba(91,124,250,.28);
  border-color: rgba(91,124,250,.5);
  outline: none;
}

.status-line {
  min-height: 20px;
  margin-top: 14px;
  color: var(--ink-dim);
  font-size: 12px;
}

.fallback-card {
  margin-top: 18px;
  text-align: left;
}

.fallback-card h2 {
  font-size: 16px;
}

.quick-links {
  position: fixed;
  top: 58px;
  right: 12px;
  z-index: 40;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,.45);
}

.quick-links[hidden],
.panel-backdrop[hidden] {
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  font-size: 15px;
}

.panel-header p {
  margin-top: 4px;
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1.45;
}

.close-button {
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus-visible {
  color: var(--ink);
  border-color: rgba(91,124,250,.55);
  outline: none;
}

.link-list {
  padding: 6px 0;
}

.link-card {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.link-card:last-child {
  border-bottom: 0;
}

.link-card h3 {
  font-size: 14px;
}

.link-card p {
  margin-top: 4px;
  color: var(--ink-dim);
  font-size: 12.5px;
  line-height: 1.45;
}

.link-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.link-value {
  min-width: 0;
  flex: 1;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.copy-button {
  min-width: 72px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--accent-dim);
  border: 1px solid rgba(91,124,250,.18);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.copy-button:hover,
.copy-button:focus-visible,
.copy-button[data-state="done"] {
  background: var(--accent);
  border-color: var(--accent);
  outline: none;
}

.copy-button[data-state="failed"] {
  background: var(--danger);
  border-color: var(--danger);
}

.loading,
.panel-loading {
  color: var(--ink-dim);
  font-size: 13px;
}

.panel-loading {
  padding: 18px;
}

.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0,0,0,.32);
}

@media (max-width: 600px) {
  .page-shell {
    padding: 78px 12px 20px;
  }

  .workspace-card,
  .fallback-card {
    padding: 26px 20px;
  }

  .workspace-actions {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .quick-links {
    top: 60px;
    right: 8px;
    width: calc(100vw - 16px);
  }
}
