:root {
  color-scheme: dark;
  --background: #151718;
  --surface: #1d2021;
  --selected: #292c2d;
  --border: #373b3b;
  --text: #f9f4eb;
  --muted: #b5b7b5;
  --accent: #f2ab5f;
  --accent-ink: #182313;
  --success: #c0d6b9;
  --error: #ffd3c6;
  font-family: "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); }

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 750;
  letter-spacing: -.032em;
  line-height: 1.1;
}

h2 {
  font-size: 1rem;
  font-weight: 700;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: #121414;
}

.header-inner, .library-layout {
  width: min(calc(100% - 3rem), 73rem);
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
  gap: 1rem;
}

.wordmark {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 850;
  line-height: .92;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.library-layout { padding: 2.75rem 0; }

.intro-block { margin-bottom: 1.65rem; }

.intro {
  margin-top: .65rem;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}

.library-sidebar {
  display: grid;
  gap: 1rem;
}

.panel, .auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .8rem;
  box-shadow: 0 8px 24px #0002;
}

.file-list, .pilot-status { padding: .8rem; }

.file-list h2, .pilot-status h2 {
  padding: .15rem .35rem .5rem;
  color: var(--muted);
  font-size: .92rem;
}

.file-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 2.75rem;
  padding: .45rem .55rem;
  border-radius: .45rem;
  background: var(--selected);
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
}

.file-row:hover { background: #323636; }

.file-icon {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.65rem;
  border: 1px solid #bc864c;
  border-radius: .27rem;
  color: var(--accent);
  font-size: .65rem;
  font-weight: 750;
}

.panel-heading, .preview-actions, .session-controls {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.panel-heading {
  justify-content: space-between;
  flex-wrap: wrap;
}

.small-link {
  margin-inline-end: .35rem;
  font-size: .8rem;
}

.status-list {
  list-style: none;
  padding: .15rem .35rem;
  margin: 0;
  font-size: .9rem;
}

.status-list li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .4rem 0;
}

.status-list li + li { border-top: 1px solid var(--border); }
.status-opened { color: var(--success); }
.status-waiting, .session-name { color: var(--muted); }

.preview .panel-heading {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.preview-page {
  max-height: clamp(26rem, 68vh, 55rem);
  overflow: auto;
  padding: clamp(.5rem, 2vw, 1.25rem);
  border-radius: 0 0 .75rem .75rem;
  background: #292b2c;
}

.preview-page img {
  display: block;
  width: min(100%, 38rem);
  height: auto;
  margin: auto;
  box-shadow: 0 4px 18px #0005;
}

button, select, input { font: inherit; }

.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: .35rem .75rem;
  border: 1px solid var(--border);
  border-radius: .45rem;
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
}

.primary {
  min-height: 2.7rem;
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}

.primary:hover { background: #ffc17e; }
.dashboard-link { margin-top: .85rem; }
.callback-url { overflow-wrap: anywhere; }

.secondary {
  background: transparent;
  color: var(--text);
  font-size: .9rem;
}

.secondary:hover { background: var(--selected); }

.auth-layout {
  display: grid;
  justify-items: center;
  padding: clamp(1.5rem, 8vh, 5rem) 1rem 2rem;
}

.auth-card {
  width: min(100%, 28rem);
  padding: clamp(1.2rem, 5vw, 2rem);
}

.auth-card h1 { font-size: clamp(1.7rem, 5vw, 2.1rem); }
.auth-card .intro { margin-bottom: 1.4rem; }

.auth-form {
  display: grid;
  gap: .35rem;
}

.auth-form label {
  font-size: .92rem;
  font-weight: 650;
}

.auth-form select, .auth-form input:not([type="hidden"]) {
  width: 100%;
  min-height: 2.7rem;
  padding: .45rem .6rem;
  margin-bottom: .65rem;
  border: 1px solid #5c6261;
  border-radius: .4rem;
  background: var(--background);
  color: var(--text);
}

.auth-form input[aria-describedby] { margin-bottom: 0; }

.field-help {
  margin-bottom: .65rem;
  color: var(--muted);
  font-size: .85rem;
}

.auth-footer {
  margin-top: 1.05rem;
  color: var(--muted);
  font-size: .92rem;
}

.error, .notice {
  margin-bottom: .9rem;
  border-radius: .45rem;
  padding: .65rem .75rem;
  font-size: .92rem;
}

.error {
  background: #3b2722;
  color: var(--error);
}

.notice {
  background: #27322a;
  color: var(--success);
}

@media (max-width: 44rem) {
  .header-inner, .library-layout { width: calc(100% - 2rem); }
  .library-layout { padding-top: 2rem; }
  .workspace { grid-template-columns: 1fr; }
  .library-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-page { max-height: max(25rem, 63vh); }
}

@media (max-width: 24rem) {
  .library-sidebar { grid-template-columns: 1fr; }
}

.policy-layout {
  width: min(calc(100% - 2rem), 45rem);
  margin-inline: auto;
  padding-block: clamp(2rem, 7vw, 4.5rem) 4rem;
}

.policy-document {
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.policy-effective {
  margin-top: .65rem;
  color: var(--muted);
}

.policy-document header + p { margin-top: 1.25rem; }
.policy-document section { margin-top: 1.85rem; }

.policy-document h2 {
  margin-bottom: .5rem;
  font-size: 1.2rem;
  line-height: 1.35;
}

.policy-document p + p,
.policy-document li + li { margin-top: .8rem; }

.policy-document ul {
  margin-block: 0;
  padding-inline-start: 1.25rem;
}
