:root {
  color-scheme: dark;
  --bg: #0b1210;
  --surface: #121d19;
  --surface-2: #192722;
  --ink: #f4f1e8;
  --muted: #9caaa2;
  --line: #dce9e01f;
  --green: #8ed1a6;
  --gold: #e7b85c;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) 66px;
  color: var(--ink);
  background: radial-gradient(circle at 85% 0, #e7b85c12, transparent 24rem), var(--bg);
  font: 16px/1.45 Inter, system-ui, sans-serif;
}

button, input, textarea { font: inherit; }
a { color: inherit; }
.skip-link { position: absolute; top: -5rem; }
.skip-link:focus { top: .5rem; left: .5rem; z-index: 20; }

header, main, .tabbar {
  width: min(calc(100% - 1.5rem), 680px);
  margin-inline: auto;
}

header { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; font-size: .9rem; }
.brand b {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #183b2d;
  color: var(--green);
}
.portal-link {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--muted);
  text-decoration: none;
  font-size: 1.6rem;
}

main { min-height: 0; }
.view { height: 100%; min-height: 0; }
.view[hidden] { display: none; }

form {
  height: 100%;
  min-height: 0;
  display: grid;
  align-content: center;
  gap: clamp(.7rem, 2vh, 1.15rem);
  padding: .35rem 0 .7rem;
}

.intro {
  max-width: 34rem;
  margin: 0 auto;
  color: var(--muted);
  text-align: center;
  font: 600 clamp(.95rem, 3vw, 1.12rem)/1.4 Georgia, serif;
}

.card, .guide-card {
  display: grid;
  gap: .75rem;
  padding: clamp(1rem, 3vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #121d19e8;
  box-shadow: 0 16px 45px #00000024;
}

label {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  font: 700 clamp(1.2rem, 4.5vw, 1.7rem)/1.12 Georgia, serif;
}

label span {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1b3028;
  color: var(--green);
  font: 800 .78rem/1 Inter, system-ui, sans-serif;
}

textarea, input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: .85rem 1rem;
  background: #080e0c;
  color: var(--ink);
  caret-color: var(--gold);
}
textarea { min-height: clamp(78px, 12vh, 110px); resize: none; }
textarea::placeholder, input::placeholder { color: #7f8d85; opacity: 1; }
textarea:focus, input:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.primary {
  min-height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .65rem;
  border: 0;
  border-radius: 15px;
  padding: .8rem 1.2rem;
  background: var(--gold);
  color: #251b08;
  font-weight: 850;
  cursor: pointer;
}
.primary span { font-size: 1.3rem; }
.status { min-height: 1.2rem; margin: -.35rem 0 0; color: var(--muted); text-align: center; font-size: .78rem; }
.status.warn { color: #ffe0a4; }

.history-view, .guide-view { overflow-y: auto; padding: 1rem 0 1.5rem; }
.view-heading { margin-bottom: 1.2rem; }
.view-heading h1 { margin: 0 0 .35rem; font: 700 clamp(2rem, 8vw, 3.5rem)/1 Georgia, serif; }
.view-heading p:last-child { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 0 .45rem; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.steps { display: grid; gap: .65rem; }
.steps article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}
.steps h3 { margin: 0 0 .2rem; font-size: 1rem; }
.steps article p, .empty { margin: 0; color: var(--muted); font-size: .82rem; }
.steps button, .examples button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .55rem .8rem;
  background: #1b3028;
  color: #b9e7ca;
}
.steps .done { opacity: .68; }
.steps .done h3 { text-decoration: line-through; }

.guide-view { display: grid; align-content: start; gap: .85rem; }
.guide-card h2 { margin: 0; font: 700 1.35rem/1.15 Georgia, serif; }
.guide-card p { margin: 0; color: var(--muted); }
.guide-card a { color: var(--green); font-weight: 700; }
.examples { display: flex; flex-wrap: wrap; gap: .5rem; }

.tabbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: #0b1210f2;
}
.tabbar button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .74rem;
  cursor: pointer;
}
.tabbar button > span { display: block; margin-bottom: .1rem; font-size: 1.15rem; }
.tabbar button[aria-selected="true"] { color: var(--green); }
.tabbar b {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: .15rem;
  border-radius: 999px;
  background: #1b3028;
  font-size: .65rem;
}

@media (max-height: 680px) {
  form { align-content: start; overflow-y: auto; }
  .card { padding: .85rem; }
  textarea { min-height: 68px; }
}
