:root {
  --ink: #23281c;
  --muted: #6f6a57;
  --paper: #ede6d6;
  --panel: #f7f2e5;
  --line: #c9bd98;
  --accent: #8a6d1f;
  --accent-soft: #f0e2ba;
  --leaf: #526f56;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "IBM Plex Sans", sans-serif; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .32; background-image: repeating-radial-gradient(circle at 14% 18%, transparent 0, transparent 46px, #c9bd98 47px, transparent 48px), repeating-radial-gradient(circle at 86% 78%, transparent 0, transparent 62px, #c9bd98 63px, transparent 64px); }
main { min-height: 100dvh; position: relative; }
.welcome { min-height: 100dvh; display: flex; flex-direction: column; position: relative; z-index: 1; }
.welcome[hidden] { display: none; }
.landing-header { min-height: 70px; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--ink); }
.landing-brand { display: flex; align-items: center; gap: 13px; font: 600 17px "IBM Plex Mono", monospace; letter-spacing: 2px; }
.landing-brand strong, .hero h1 span { color: var(--accent); }
.landing-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--panel); transform: rotate(45deg); }
.landing-mark span { transform: rotate(-45deg); }
.status { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 500 11px "IBM Plex Mono", monospace; letter-spacing: 1.3px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
.landing-content { width: min(100%, 1120px); margin: 0 auto; padding: clamp(34px, 6vh, 64px) 24px 42px; }
.hero { text-align: center; }
.eyebrow { display: inline-block; margin-bottom: 15px; padding: 5px 11px; border: 1px solid #6b6142; color: var(--muted); font: 500 11px "IBM Plex Mono", monospace; letter-spacing: 2px; }
.hero h1 { margin: 0; color: var(--ink); font: 800 clamp(58px, 10vw, 106px)/.86 "Big Shoulders Stencil", sans-serif; letter-spacing: 3px; }
.tagline { max-width: 720px; margin: 19px auto 10px; font-size: clamp(18px, 2.1vw, 24px); font-weight: 600; line-height: 1.35; }
.intro { max-width: 660px; margin: 0 auto; color: var(--muted); font-size: 15px; line-height: 1.6; }
.welcome-composer { width: min(100%, 720px); margin: 32px auto 0; padding: 12px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 12px 30px #23281c14; }
.welcome-composer label { display: block; margin: 0 0 8px 4px; color: var(--accent); font: 600 10px "IBM Plex Mono", monospace; letter-spacing: 1.5px; }
.welcome-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.welcome-input-row textarea { min-height: 50px; padding: 12px; border: 1px solid var(--line); background: white; }
.welcome-input-row button { height: 50px; padding: 0 20px; border: 0; color: white; background: var(--accent); font: 600 12px "IBM Plex Mono", monospace; letter-spacing: 1px; cursor: pointer; }
.welcome-input-row button:hover { background: #71590f; }
.entry-label { display: flex; align-items: center; gap: 14px; margin: 46px 0 16px; color: var(--muted); font: 500 11px "IBM Plex Mono", monospace; letter-spacing: 1.7px; }
.entry-label::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.missions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.mission { min-height: 180px; padding: 20px 18px; display: flex; flex-direction: column; position: relative; border: 1px solid var(--line); color: var(--ink); background: var(--panel); text-align: left; font-family: inherit; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.mission::before, .mission::after { content: ""; width: 12px; height: 12px; position: absolute; border-color: #87794f; }
.mission::before { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.mission::after { right: -1px; bottom: -1px; border-right: 2px solid; border-bottom: 2px solid; }
.mission:hover, .mission:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 22px #23281c1f; outline: none; }
.callsign, .open { color: var(--accent); font: 600 10px "IBM Plex Mono", monospace; letter-spacing: 1.5px; }
.mission strong { margin: 12px 0 7px; font-size: 17px; line-height: 1.25; }
.mission small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.open { margin-top: auto; padding-top: 18px; color: #87794f; }
.open::after { content: "  ›"; font-size: 15px; }
.landing-footer { margin-top: auto; padding: 20px 24px; border-top: 2px solid var(--ink); color: var(--muted); text-align: center; font: 500 10px/1.5 "IBM Plex Mono", monospace; letter-spacing: 1px; }
.landing-footer span { width: 220px; height: 4px; display: block; margin: 0 auto 13px; background: repeating-linear-gradient(90deg, var(--accent) 0 18px, #526f56 18px 22px, var(--line) 22px 40px); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.chat { height: 100dvh; max-width: 920px; margin: auto; padding: 0 24px; display: grid; grid-template-rows: 72px auto minmax(0, 1fr) auto auto auto; }
.chat[hidden] { display: none; }
.chat > header { grid-row: 1; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 18px "IBM Plex Mono", monospace; letter-spacing: 1px; }
.mini-mark { display: grid; place-items: center; color: var(--paper); background: var(--ink); font-family: "Big Shoulders Stencil", sans-serif; }
.mini-mark { width: 30px; height: 30px; font-size: 19px; }
.icon-button { border: 0; color: var(--muted); background: transparent; font-size: 24px; cursor: pointer; }
.profile { grid-row: 2; padding: 12px 0 4px; border-bottom: 1px solid var(--line); }
.profile[hidden] { display: none; }
.profile-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.profile-items, .suggestions { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
.profile-item, .suggestions button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--panel); font: 500 13px "IBM Plex Sans"; cursor: pointer; }
.profile-item { padding: 5px 9px; }
.profile-item::after { content: " ×"; color: var(--muted); }
.messages { grid-row: 3; min-height: 0; padding: 34px 0; overflow-y: auto; }
.message { max-width: 72%; margin-bottom: 22px; padding: 15px 18px; border-radius: 6px; line-height: 1.55; white-space: pre-wrap; animation: arrive .3s ease both; }
.assistant { background: var(--panel); border: 1px solid var(--line); }
.user { margin-left: auto; color: white; background: var(--ink); }
.thinking { color: var(--muted); font-style: italic; }
.starting-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 28px; animation: arrive .35s ease both; }
.starting-group { min-width: 0; padding-top: 10px; border-top: 2px solid var(--ink); }
.starting-group:nth-child(2) { border-color: var(--accent); }
.starting-group:nth-child(3) { border-color: var(--leaf); }
.starting-group h2 { margin: 0 0 8px; color: var(--muted); font: 600 11px "IBM Plex Sans"; letter-spacing: 1px; text-transform: uppercase; }
.starting-group button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; text-decoration: none; font: 500 13px/1.35 "IBM Plex Sans"; cursor: pointer; }
.starting-group button { min-height: 48px; padding: 8px 4px; }
.starting-group button:hover { color: var(--accent); padding-left: 8px; }
.resource-list { width: min(100%, 620px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: -12px 0 24px; }
.resource-group { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.resource-group h3 { margin: 0 0 9px; font-size: 13px; line-height: 1.3; }
.resource-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.resource-actions a { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: #fffdf7; text-align: left; text-decoration: none; font: 600 11px/1.25 "IBM Plex Sans"; }
.resource-actions a:hover { border-color: var(--accent); color: var(--accent); }
.official-resources { grid-column: 1 / -1; }
.suggestions { grid-row: 4; padding: 0 0 10px; }
.suggestions:empty { display: none; }
.suggestions button { padding: 9px 12px; }
.suggestions button:hover, .profile-item:hover { border-color: var(--accent); }
.composer { grid-row: 5; display: grid; grid-template-columns: 1fr 48px; gap: 10px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 40px #36483d14; }
textarea { resize: none; border: 0; outline: 0; padding: 10px; color: var(--ink); background: transparent; font: 16px/1.45 "IBM Plex Sans"; }
.composer button { width: 44px; height: 44px; align-self: end; border: 0; border-radius: 4px; color: white; background: var(--accent); font-size: 23px; cursor: pointer; }
.composer button:disabled { opacity: .45; }
.disclaimer { grid-row: 6; margin: 10px 0 14px; color: var(--muted); text-align: center; font-size: 11px; }
@keyframes arrive { from { opacity: 0; transform: translateY(7px); } }
@media (max-width: 800px) { .missions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .starting-points { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .landing-header { min-height: 62px; padding: 13px 16px; }
  .landing-brand { font-size: 14px; }
  .status { font-size: 9px; }
  .landing-content { padding: 30px 16px 28px; }
  .hero h1 { font-size: 58px; }
  .tagline { font-size: 18px; }
  .intro { font-size: 14px; }
  .welcome-composer { margin-top: 24px; }
  .welcome-input-row { grid-template-columns: 1fr; }
  .welcome-input-row button { width: 100%; }
  .entry-label { margin-top: 36px; }
  .missions { grid-template-columns: 1fr; }
  .mission { min-height: 156px; }
  .chat { padding: 0 14px; }
  .message { max-width: 88%; }
  .resource-list { grid-template-columns: 1fr; }
  .official-resources { grid-column: auto; }
}

.message.assistant a {
  color: #075985;
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.message.assistant a:hover {
  color: #0c4a6e;
}