/* Bolt Action Lists — "field" brand layer on top of Pico (classless).
 * Loaded AFTER pico.classless.min.css so these win. Military palette: sand
 * surfaces, olive-drab header/primary, brass accent, field-coloured badges. */

:root,
:root:not([data-theme=dark]),
[data-theme=light] {
  /* Surfaces */
  --pico-background-color: #f4efe2;            /* sand */
  --pico-card-background-color: #fbf8ef;       /* cream card */
  --pico-card-sectioning-background-color: #f2ecdb;
  --pico-card-border-color: #ddd0b0;

  /* Text */
  --pico-color: #2b2b22;
  --pico-h1-color: #2b2b22;
  --pico-h2-color: #2b2b22;
  --pico-h3-color: #3a3a2c;
  --pico-muted-color: #6b6655;
  --pico-muted-border-color: #e3d9bf;
  --pico-border-color: #d8ccae;

  /* Primary = olive drab (buttons, links) */
  --pico-primary: #4b5320;
  --pico-primary-background: #4b5320;
  --pico-primary-hover: #b45309;               /* brass on hover */
  --pico-primary-hover-background: #3a4019;
  --pico-primary-focus: rgba(75, 83, 32, 0.3);
  --pico-primary-inverse: #ffffff;
  --pico-primary-underline: rgba(75, 83, 32, 0.45);

  /* Secondary = brass */
  --pico-secondary: #b45309;
  --pico-secondary-background: #b45309;
  --pico-secondary-hover: #92400e;
  --pico-secondary-hover-background: #92400e;
  --pico-secondary-focus: rgba(180, 83, 9, 0.3);
  --pico-secondary-inverse: #ffffff;

  --pico-border-radius: 0.4rem;
}

/* Tighten the reading column a touch (was 880px in the old inline style). */
body > main,
body > header,
body > footer { max-width: 60rem; }

/* ── Header: an olive command bar ───────────────────────────────────────── */
body > header {
  background: #4b5320;
  color: #f4efe2;
  border-radius: var(--pico-border-radius);
  padding: 0.6rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
}
body > header a { color: #f4efe2; text-decoration: none; }
body > header a:hover { color: #f0c486; }            /* brass-light */
body > header strong a {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body > header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; }
body > header nav a { margin: 0; }
body > header .muted { color: #cfc8b0; }
/* The inline log-out form sits flush in the bar. */
body > header form.inline { display: inline; margin: 0; }
body > header form.inline button {
  width: auto;
  padding: 0.25rem 0.7rem;
  background: transparent;
  border: 1px solid #cfc8b0;
  color: #f4efe2;
}
body > header form.inline button:hover {
  background: #b45309; border-color: #b45309; color: #fff;
}

/* ── Headings: a little stencilled character ────────────────────────────── */
h1 { letter-spacing: 0.02em; border-bottom: 3px solid #b45309; padding-bottom: 0.25rem; }
h2 { letter-spacing: 0.01em; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
/* `.btn` is used on plain <a> (no role=button) — give it the Pico button look. */
.btn,
a.btn {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
  border: 1px solid var(--pico-primary-background);
  border-radius: var(--pico-border-radius);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover,
a.btn:hover {
  background: var(--pico-primary-hover-background);
  border-color: var(--pico-primary-hover-background);
  color: #fff;
}
/* Destructive actions (delete note, remove override, …). */
.btn-danger,
a.btn-danger,
button.btn-danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}
.btn-danger:hover,
a.btn-danger:hover,
button.btn-danger:hover { background: #991b1b; border-color: #991b1b; }

/* Keep list-paste areas monospace (they hold army-list text). */
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ── Status badges / pills ──────────────────────────────────────────────── */
.status,
.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #e6e0cf;                 /* khaki default */
  color: #5b5640;
  line-height: 1.6;
}
.badge--ok      { background: #e6efd6; color: #3f5310; }   /* field green */
.badge--warn    { background: #f6e8c8; color: #8a5a00; }   /* amber */
.badge--err     { background: #f7dcd8; color: #8a1c10; }   /* red */
.badge--review  { background: #e6e0cf; color: #5b5640; }   /* khaki */
.badge--info    { background: #dbeafe; color: #1e40af; }   /* blue */

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flash {
  padding: 0.6rem 0.8rem;
  border-radius: var(--pico-border-radius);
  margin: 0.5rem 0;
  border-left: 4px solid transparent;
}
.flash.error   { background: #f7dcd8; color: #8a1c10; border-left-color: #b91c1c; }
.flash.success { background: #e6efd6; color: #3f5310; border-left-color: #4b5320; }
.flash.warning { background: #f6e8c8; color: #8a5a00; border-left-color: #b45309; }

.muted { color: var(--pico-muted-color); }
form.inline { display: inline; }

/* ── Onboarding tour (welcome modal) ────────────────────────────────────── */
#onboarding article { max-width: 32rem; }
#onboarding header { display: flex; align-items: center; gap: 0.5rem; }
#onboarding header strong { letter-spacing: 0.04em; text-transform: uppercase; }
#onboarding .onboard-close {
  margin-left: auto; order: 2; text-decoration: none;
  font-size: 1.4rem; line-height: 1; color: var(--pico-muted-color);
}
#onboarding .onboard-close:hover { color: #b45309; }
.onboard-step { display: none; min-height: 7rem; }
.onboard-step.active { display: block; }
#onboarding footer {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.onboard-dots { display: flex; gap: 0.4rem; }
.onboard-dots .dot {
  width: 0.6rem; height: 0.6rem; border-radius: 999px;
  background: #d8ccae; cursor: pointer;
}
.onboard-dots .dot.on { background: #4b5320; }   /* olive = current step */
.onboard-nav { display: flex; gap: 0.5rem; }
.onboard-nav button { width: auto; margin: 0; }

/* ── Mobile: tighten density on small screens ───────────────────────────────
 * Pico drives most spacing through CSS custom properties, so we de-chunk the
 * whole app by shrinking those vars inside a phone breakpoint, then trim the
 * few hard-coded brand values Pico's vars don't reach. Tap targets stay
 * comfortable — we cut the space *around* controls more than the controls. */
@media (max-width: 600px) {
  :root,
  :root:not([data-theme=dark]),
  [data-theme=light] {
    --pico-spacing: 0.75rem;                       /* master gap (was 1rem) */
    --pico-block-spacing-vertical: 0.75rem;        /* section/card padding */
    --pico-block-spacing-horizontal: 0.75rem;
    --pico-form-element-spacing-vertical: 0.55rem; /* input padding */
    --pico-form-element-spacing-horizontal: 0.7rem;
    --pico-typography-spacing-vertical: 0.75rem;   /* paragraph/heading rhythm */
    --pico-nav-element-spacing-vertical: 0.4rem;
    --pico-nav-element-spacing-horizontal: 0.5rem;
  }

  /* Pico's root font scales up at wider breakpoints; the body copy is fine on a
   * phone, but the branded headings are oversized for the column. */
  h1 { font-size: 1.6rem; padding-bottom: 0.2rem; border-bottom-width: 2px; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.1rem; }

  /* Comfortable side gutters, not the desktop reading gutter. */
  body > main { padding-left: 0.85rem; padding-right: 0.85rem; }

  /* The olive command bar: compact, less bottom gap. */
  body > header {
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    gap: 0.35rem 0.75rem;
  }
  body > header nav { gap: 0.2rem 0.75rem; }
  /* Long organiser email shouldn't push the bar wide. */
  body > header .muted {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Buttons: trim padding but keep a tappable height. */
  .btn,
  a.btn { padding: 0.45rem 0.75rem; }
  button,
  [role="button"],
  input[type="submit"],
  input[type="button"] { min-height: 2.5rem; }

  /* Wide tables overflow a phone; let them scroll instead of breaking layout. */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
