:root {
  color-scheme: light dark;
  --bg: #f3f6fb;
  --card: rgba(255, 255, 255, 0.86);
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --accent: #0a84ff;
  --accent-dark: #005fcc;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(10, 132, 255, 0.18), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(52, 199, 89, 0.14), transparent 28rem),
    var(--bg);
  color: var(--text);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  max-width: 780px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 6px;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  letter-spacing: -0.03em;
}

.lead, .hint {
  color: var(--muted);
  line-height: 1.55;
}

.card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.access-card {
  max-width: 520px;
  padding: 26px;
}

label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
}

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button-link:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.8);
}

.full-width,
#login-button {
  width: 100%;
}

.link-button {
  width: 100%;
  min-height: 38px;
  margin-top: 6px;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
}

.link-button:hover {
  background: rgba(10, 132, 255, 0.08);
}

#setup-button {
  margin-top: 10px;
}

.setup-fields {
  margin-top: 4px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 18px;
}

.workspace-header, .detail-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.document-list, .document-detail {
  padding: 22px;
}

.document-row {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--text);
  text-align: left;
}

.document-row:hover, .document-row.active {
  background: rgba(10, 132, 255, 0.12);
}

.document-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: rgba(10, 132, 255, 0.14);
}

.document-meta {
  min-width: 0;
}

.document-meta strong, .document-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-meta span, .document-status {
  color: var(--muted);
  font-size: 0.9rem;
}

iframe {
  width: 100%;
  min-height: 680px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.message {
  margin-top: 18px;
  border-radius: 22px;
  padding: 18px 20px;
  background: rgba(255, 59, 48, 0.12);
  color: #b42318;
  font-weight: 700;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 24px, 620px);
    padding: 28px 0;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace-header, .detail-toolbar {
    flex-direction: column;
  }

  .ghost {
    width: 100%;
  }

  iframe {
    min-height: 560px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #05070b;
    --card: rgba(28, 28, 30, 0.82);
    --text: #f8fafc;
    --muted: #a1a1aa;
    --line: rgba(255, 255, 255, 0.1);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  }

  input, .ghost, .document-row {
    background: rgba(255, 255, 255, 0.06);
  }
}
