:root {
  --bg: #f5efe6;
  --bg-strong: #f0e2cd;
  --panel: rgba(255, 252, 246, 0.92);
  --panel-strong: #fff8f0;
  --text: #2c241d;
  --muted: #6d5d50;
  --line: rgba(82, 58, 37, 0.12);
  --brand: #d86f45;
  --brand-dark: #a74a28;
  --accent: #2f7b6d;
  --danger: #b83f35;
  --shadow: 0 18px 60px rgba(75, 50, 30, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(216, 111, 69, 0.22), transparent 34%),
    radial-gradient(circle at right, rgba(47, 123, 109, 0.16), transparent 28%),
    linear-gradient(180deg, #f7f1e8 0%, var(--bg) 100%);
  min-height: 100vh;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.tab {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

button:hover,
.tab:hover {
  transform: translateY(-1px);
}

input,
select,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text);
}

textarea {
  resize: vertical;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.auth-shell,
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-card,
.panel,
.hero {
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(100%, 480px);
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 248, 240, 0.98), rgba(240, 226, 205, 0.96));
  border: 1px solid var(--line);
}

.error-page {
  display: grid;
  min-height: 100vh;
}

.error-card {
  text-align: center;
}

.hero {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.4fr 1fr;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 248, 240, 0.96), rgba(240, 226, 205, 0.96));
}

.hero-side {
  display: grid;
  gap: 14px;
}

.session-card,
.metric {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
}

.hero-metrics {
  display: grid;
  gap: 12px;
}

.metric strong {
  display: block;
  font-size: 1.8rem;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-dark);
  font-size: 0.8rem;
}

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

.lede {
  margin-top: 12px;
  color: var(--muted);
  max-width: 60ch;
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  overflow-x: auto;
}

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

.tab.active {
  background: var(--text);
  color: white;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 20px;
}

.panel.accent {
  background:
    linear-gradient(135deg, rgba(47, 123, 109, 0.08), rgba(255, 248, 240, 0.96)),
    var(--panel-strong);
}

.panel-head,
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.panel-head {
  margin-bottom: 16px;
}

.stack {
  display: grid;
  gap: 12px;
}

.cards {
  margin-top: 16px;
}

.card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.compact-card {
  padding: 14px 16px;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta,
.prose {
  color: var(--muted);
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-strong);
  width: fit-content;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

.chip input,
.checkbox-line input {
  width: auto;
  margin: 0;
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.history-day {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.history-event {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.danger {
  background: var(--danger);
}

.muted-button {
  background: rgba(44, 36, 29, 0.08);
  color: var(--text);
}

.wide {
  width: 100%;
}

.config-block {
  white-space: pre-wrap;
  background: #241f1a;
  color: #fff2d8;
  border-radius: 18px;
  padding: 16px;
  overflow: auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.text-link {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 12px 0;
}

.hidden {
  display: none !important;
}

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

  .card-head,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
