:root {
  color-scheme: light;
  --bg: #f6f1e7;
  --bg-panel: rgba(255, 251, 245, 0.86);
  --ink: #13252b;
  --muted: #5c6a6f;
  --accent: #0f7a7a;
  --accent-soft: rgba(15, 122, 122, 0.12);
  --copper: #915c2d;
  --copper-soft: rgba(145, 92, 45, 0.12);
  --edge: rgba(19, 37, 43, 0.12);
  --shadow: 0 20px 60px rgba(19, 37, 43, 0.08);
  --heading-font: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --body-font: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body-font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 122, 122, 0.18), transparent 32%),
    radial-gradient(circle at right center, rgba(145, 92, 45, 0.16), transparent 28%),
    linear-gradient(180deg, #f8f4ec 0%, #efe8dc 100%);
}

.page-shell {
  width: min(1280px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.hero,
.thread-panel,
.context-card {
  backdrop-filter: blur(10px);
}

.hero > div,
.thread-panel,
.context-card {
  border: 1px solid var(--edge);
  border-radius: 24px;
  background: var(--bg-panel);
  box-shadow: var(--shadow);
}

.hero > div:first-child {
  padding: 2rem;
}

.hero-card {
  padding: 1.5rem;
  background:
    linear-gradient(135deg, rgba(15, 122, 122, 0.14), transparent),
    linear-gradient(315deg, rgba(145, 92, 45, 0.12), transparent),
    var(--bg-panel);
}

.eyebrow,
.card-label {
  margin: 0 0 0.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--heading-font);
  font-weight: 600;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.15rem;
}

.hero-copy,
.hero-note,
#access-posture-copy {
  color: var(--muted);
  line-height: 1.6;
}

.hero-copy {
  max-width: 48rem;
  margin: 0.9rem 0 0;
  font-size: 1.05rem;
}

.hero-state {
  margin: 0;
  font-size: 1.65rem;
  font-family: var(--heading-font);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.95fr);
  gap: 1.5rem;
}

.thread-panel {
  padding: 1.5rem;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.pill,
.mode-chip {
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  border: 1px solid transparent;
  font-size: 0.88rem;
}

.pill-live,
.mode-chip.is-live {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(15, 122, 122, 0.18);
}

.pill-muted,
.mode-chip.is-planned {
  background: rgba(19, 37, 43, 0.06);
  color: var(--muted);
  border-color: rgba(19, 37, 43, 0.08);
}

.thread-log {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 420px;
  max-height: 620px;
  overflow: auto;
  padding: 0.75rem 0.1rem 0.75rem 0;
}

.auth-gate {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--edge);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(145, 92, 45, 0.08), rgba(15, 122, 122, 0.06));
}

.auth-form {
  display: grid;
  gap: 0.6rem;
  align-content: start;
}

.message {
  border: 1px solid var(--edge);
  border-radius: 18px;
  padding: 1rem 1rem 0.9rem;
  background: rgba(255, 255, 255, 0.74);
}

.message.system {
  background: linear-gradient(135deg, rgba(15, 122, 122, 0.1), rgba(255, 255, 255, 0.74));
}

.message.user {
  background: linear-gradient(135deg, rgba(145, 92, 45, 0.1), rgba(255, 255, 255, 0.74));
}

.message-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.message-copy {
  margin: 0;
  line-height: 1.65;
}

.composer {
  border-top: 1px solid var(--edge);
  padding-top: 1rem;
}

.composer-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 130px;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(19, 37, 43, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
}

input[type="password"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(19, 37, 43, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
}

input[type="file"],
select {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(19, 37, 43, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
}

textarea:focus {
  outline: 2px solid rgba(15, 122, 122, 0.2);
  border-color: rgba(15, 122, 122, 0.3);
}

input[type="password"]:focus,
input[type="file"]:focus,
select:focus {
  outline: 2px solid rgba(15, 122, 122, 0.2);
  border-color: rgba(15, 122, 122, 0.3);
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.8rem;
}

.auth-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.attachment-form {
  margin-top: 1rem;
  border-top: 1px solid var(--edge);
  padding-top: 1rem;
}

.attachment-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.attachment-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-top: 0.8rem;
}

.mode-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.send-button {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  background: linear-gradient(135deg, var(--accent), #145a6a);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.send-button:disabled,
.mode-chip:disabled,
textarea:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.context-panel {
  display: grid;
  gap: 1rem;
}

.context-card {
  padding: 1.1rem 1.15rem;
}

.context-list {
  list-style: none;
  padding: 0;
  margin: 0.7rem 0 0;
  display: grid;
  gap: 0.55rem;
}

.context-list li {
  border-bottom: 1px solid rgba(19, 37, 43, 0.08);
  padding-bottom: 0.5rem;
  line-height: 1.5;
}

.context-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.context-key {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .auth-gate {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .composer-actions,
  .attachment-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .thread-meta {
    justify-content: flex-start;
  }

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