/* Dashboard styles. Layered on landing.css: it consumes the site's paper-and-ink
   tokens, fonts, header, and footer, so the logged-in area reads as part of the
   same site rather than a separate SaaS app. Only dashboard-specific tokens and
   components live here. Class names and ids are unchanged so dashboard.js keeps
   working. */

:root {
  --field-bg: #fffdf8;
  --error: #8a241f;
  --ok: #3f6b50;
  --display: Impact, Haettenschweiler, "Arial Narrow Bold", var(--ui);
}

[hidden] {
  display: none !important;
}

/* Textured paper canvas, the same treatment as the tour and help pages. */
body {
  background:
    var(--paper-fibre),
    radial-gradient(circle at 80% 2%, rgba(255, 250, 241, 0.45), transparent 18rem),
    linear-gradient(180deg, rgba(255, 250, 241, 0.2), transparent 460px),
    var(--room);
  background-size: var(--paper-fibre-size), auto, auto, auto;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--ui);
  margin: 0;
  min-height: 100vh;
}

/* Logout sits in the header action slot; normalise the button. */
.site-header .nav-action {
  border: 0;
  cursor: pointer;
  font-family: var(--ui);
}

.dashboard-shell {
  display: grid;
  gap: clamp(22px, 3vw, 34px);
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(30px, 5vw, 60px) clamp(20px, 6vw, 96px) clamp(52px, 7vw, 96px);
  width: 100%;
}

/* Hero: paper and Impact, matching the guide/help heroes. No dark SaaS panel. */
.dashboard-hero {
  border-bottom: 1px solid var(--line-dark);
  display: grid;
  gap: 12px;
  padding-bottom: clamp(20px, 3vw, 32px);
}

.chapter-label {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0;
  text-transform: uppercase;
}

.dashboard-hero h1 {
  font-family: var(--display);
  font-size: clamp(52px, 8vw, 92px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.9;
  margin: 0;
  text-transform: uppercase;
}

.hero-copy {
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.4;
  margin: 4px 0 0;
  max-width: 620px;
}

/* Summary strip: hard-lined paper cells, mono labels, serif values. */
.summary-strip {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-strip article {
  background: rgba(255, 250, 241, 0.5);
  border: 1px solid var(--line-dark);
  border-top: 3px solid var(--accent);
  min-width: 0;
  padding: 18px 20px 20px;
}

.summary-strip span {
  color: var(--muted);
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.summary-strip strong {
  color: var(--ink);
  display: block;
  font-family: var(--serif);
  font-size: clamp(18px, 1.7vw, 23px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

/* Panels: flat paper with a single hard border, no heavy drop shadow. */
.dashboard-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(240px, 0.8fr) minmax(300px, 1fr);
}

.panel {
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid var(--line-dark);
  display: grid;
  gap: 14px;
  padding: clamp(22px, 3vw, 32px);
}

.action-panel {
  background: rgba(245, 234, 215, 0.7);
}

.wide-panel {
  grid-column: 1 / -1;
}

.panel-heading {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
  margin-bottom: 4px;
  padding-bottom: 16px;
}

.panel-heading h2 {
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

.action-stack {
  align-items: stretch;
  display: grid;
  gap: 12px;
}

/* Buttons: red fill primary, hard-bordered secondary, uppercase like the site. */
.primary-action,
.secondary-action,
.submit-button,
.secondary-button {
  align-items: center;
  border: 1px solid var(--accent-deep);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  letter-spacing: 0.14em;
  min-height: 46px;
  padding: 0 20px;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-action,
.submit-button {
  background: var(--accent);
  color: #fff5e7;
}

.primary-action:hover,
.submit-button:hover,
.primary-action:focus-visible,
.submit-button:focus-visible {
  background: var(--accent-deep);
}

.secondary-action,
.secondary-button {
  background: rgba(255, 250, 241, 0.6);
  border-color: var(--line-dark);
  color: var(--accent);
}

.secondary-action:hover,
.secondary-button:hover,
.secondary-action:focus-visible,
.secondary-button:focus-visible {
  background: var(--paper-aged);
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* Form fields. */
label {
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: var(--field-bg);
  border: 1px solid var(--line-dark);
  border-radius: 0;
  color: var(--ink);
  min-height: 46px;
  padding: 11px 12px;
  width: 100%;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--accent);
  outline: 3px solid var(--accent-soft);
  outline-offset: 1px;
}

textarea {
  font-family: var(--serif);
  line-height: 1.5;
  min-height: 120px;
  resize: vertical;
}

.field-grid {
  display: grid;
  gap: 12px;
}

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

.checkbox-line {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0;
  text-transform: none;
}

.checkbox-line input {
  min-height: 0;
  width: auto;
}

/* Email preference toggles. */
.preference-toggle {
  align-items: flex-start;
  background: rgba(245, 234, 215, 0.55);
  border: 1px solid var(--line-dark);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 15px;
}

.preference-toggle input {
  margin-top: 4px;
  min-height: 0;
  width: auto;
}

.preference-toggle strong,
.preference-toggle em {
  display: block;
}

.preference-toggle strong {
  font-size: 15px;
}

.preference-toggle em {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 14px;
  font-style: normal;
  line-height: 1.45;
  margin-top: 4px;
}

.password-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

/* Password strength meter. */
.strength-meter {
  background: var(--paper-aged);
  border: 1px solid var(--line);
  height: 8px;
  overflow: hidden;
}

.strength-meter span {
  background: var(--muted);
  display: block;
  height: 100%;
  transition: width 160ms ease, background 160ms ease;
  width: 0;
}

.strength-meter span.is-weak {
  background: var(--accent);
  width: 34%;
}

.strength-meter span.is-good {
  background: #b7791f;
  width: 68%;
}

.strength-meter span.is-strong {
  background: var(--ok);
  width: 100%;
}

.field-hint,
.form-status,
.dashboard-status {
  color: var(--muted);
  font-family: var(--serif);
  line-height: 1.45;
  margin: 0;
}

.field-hint,
.form-status {
  font-size: 13px;
}

.form-status,
.dashboard-status {
  min-height: 22px;
}

.is-error {
  color: var(--error);
  font-weight: 700;
}

.is-success {
  color: var(--ok);
  font-weight: 700;
}

/* Submitted issue notes. */
.submitted-list {
  display: grid;
  gap: 12px;
}

.submitted-note {
  background: rgba(245, 234, 215, 0.5);
  border: 1px solid var(--line-dark);
  display: grid;
  gap: 8px 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 15px;
}

.submitted-note strong,
.submitted-note span {
  display: block;
}

.submitted-note strong {
  font-size: 15px;
}

.submitted-note span,
.submitted-note p,
.empty-note {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.45;
}

.submitted-note mark {
  align-self: start;
  background: transparent;
  border: 1px solid var(--line-dark);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 5px 9px;
  text-transform: uppercase;
}

.submitted-note p {
  grid-column: 1 / -1;
  margin: 0;
}

.empty-note {
  margin: 0;
}

@media (max-width: 860px) {
  .dashboard-layout,
  .summary-strip,
  .two-column {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .password-tools,
  .primary-action,
  .secondary-action,
  .submit-button,
  .secondary-button {
    width: 100%;
  }

  .submitted-note {
    grid-template-columns: 1fr;
  }
}
