/* styles.css — SMLZ. Hand-written, one file, no framework and no build step.
   The page must work from a folder with no network, so nothing here is
   generated at run time and nothing is fetched. */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90rem 34rem at 50% -10rem, var(--bg-glow) 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--primary); text-underline-offset: 2px; }
svg { display: block; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

:where(button, select, a, [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ------------------------------------------------------------------ header */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}

.bar .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: var(--primary-ink);
  background: linear-gradient(150deg, #8f7bff, var(--primary) 55%, #4c35c8);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent);
}

.brand .name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand .name span { color: var(--primary); }

.bar nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  padding: 9px 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 30%, transparent);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn svg { width: 17px; height: 17px; }

@media (max-width: 640px) {
  .bar nav .label { display: none; }
  .bar nav .btn { padding: 9px 12px; }
}

/* -------------------------------------------------------------------- hero */

.hero {
  padding: 46px 0 0;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--pill);
  padding: 5px 13px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--primary);
}

.eyebrow i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.hero h1 {
  margin-top: 16px;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--primary), #a48dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead {
  margin: 12px auto 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 15px;
}

/* --------------------------------------------------------------- the panel */

.panel { margin: 22px 0 0; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 10px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: var(--pill);
  padding: 9px 18px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.tab svg { width: 16px; height: 16px; }
.tab[aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-ink);
}

/* dropzone */

.drop {
  position: relative;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 26px 20px 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.drop:hover,
.drop.is-over {
  border-color: var(--primary);
  background: var(--surface-2);
}

.drop .glyph {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 14px;
  background: var(--soft);
  color: var(--primary);
}
.drop .glyph svg { width: 22px; height: 22px; }

.drop h2 { margin-top: 12px; font-size: 19px; font-weight: 800; }
.drop .sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.drop .sub b { color: var(--primary); text-decoration: underline; }

.options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field select {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.field select:focus-visible { outline-offset: 3px; }

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.badges span {
  border-radius: 6px;
  background: var(--code-bg);
  padding: 5px 8px;
}

/* workspace */

.workspace {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.workspace > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.workspace > header h2 { font-size: 15px; font-weight: 800; }
.workspace > header h2 span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.hint { margin-top: 2px; font-size: 12px; color: var(--muted); }

.link-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.link-btn:hover { background: var(--soft); }

.rows {
  max-height: 260px;
  overflow-y: auto;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }

.row .tag {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 30px;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.row .tag.zip { background: var(--warn-soft); color: var(--warn); }
.row .tag.gz,
.row .tag.tar { background: var(--soft); color: var(--soft-ink); }

.row .what { min-width: 0; flex: 1; }
.row .what b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .what small {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .what small.warn { color: var(--warn); }

.row .num {
  flex: none;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.row .drop-file {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.row .drop-file:hover { background: var(--danger-soft); color: var(--danger); }
.row .drop-file svg { width: 15px; height: 15px; }

/* footer of the workspace */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.total .k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.total .v { font-size: 17px; font-weight: 800; }

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

/* stats + report */

.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.stats .k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stats .v { font-size: 17px; font-weight: 800; }
.stats .v.good { color: var(--success); }

.meter { flex: 1; min-width: 150px; }
.meter .line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.meter .track {
  height: 7px;
  border-radius: var(--pill);
  background: var(--code-bg);
  overflow: hidden;
}
.meter .fill {
  height: 100%;
  width: 0;
  border-radius: var(--pill);
  background: var(--primary);
  transition: width 0.35s ease;
}

.report {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.report h3 { font-size: 13px; font-weight: 800; }
.report p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.report dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
}
.report dt { color: var(--muted); }
.report dd { margin: 0; overflow-wrap: anywhere; }

.progress { padding: 0 16px 15px; }
.progress .track {
  height: 7px;
  border-radius: var(--pill);
  background: var(--code-bg);
  overflow: hidden;
}
.progress .fill {
  height: 100%;
  width: 0;
  border-radius: var(--pill);
  background: var(--primary);
  transition: width 0.25s ease;
}
.progress p {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--muted);
  min-height: 1.2em;
}

.message {
  margin-top: 12px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--danger);
}
.message a { color: inherit; }

/* ------------------------------------------------------------------- cards */

.cards {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 20px;
}
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

.card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.card .ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--soft);
  color: var(--primary);
}
.card .ico svg { width: 16px; height: 16px; }
.card h3 { font-size: 13.5px; font-weight: 800; }
.card p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------------ tables */

.section { margin-top: 34px; }
.section > h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section > p.lead {
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 62ch;
}

.sheet {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.sheet table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 13px;
}
.sheet th,
.sheet td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.sheet thead th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
}
.sheet tbody tr:last-child td { border-bottom: 0; }
.sheet td:first-child { font-weight: 700; white-space: nowrap; }
.sheet .yes { color: var(--success); font-weight: 700; }
.sheet .no { color: var(--muted); }
.sheet code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 1px 5px;
}

/* A four-column table cannot be honest at 390px. Below 700px each row becomes
   its own little card, and the column names move in front of the values. */
@media (max-width: 700px) {
  .sheet table,
  .sheet tbody,
  .sheet tr,
  .sheet td {
    display: block;
    width: auto;
    min-width: 0;
  }
  .sheet thead { display: none; }
  .sheet tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .sheet tbody tr:last-child { border-bottom: 0; }
  .sheet td { border: 0; padding: 2px 0; display: flex; gap: 10px; }
  .sheet td:first-child { white-space: normal; font-size: 14px; display: block; }
  .sheet td::before {
    flex: none;
    width: 58px;
    padding-top: 2px;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .sheet td:nth-child(2)::before { content: "Pack"; }
  .sheet td:nth-child(3)::before { content: "Unpack"; }
  .sheet td:nth-child(4)::before { content: "Notes"; }
}

/* roadmap chips */

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chips span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 5px 9px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.chips span.soon { color: var(--muted); text-decoration: line-through; }

/* ------------------------------------------------------------------ footer */

footer {
  margin-top: 44px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  padding: 22px 0 30px;
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--muted);
}
footer nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 14px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--primary); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------- workspace: controls */

.headbtns { display: flex; gap: 2px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.field.grow { flex: 1; min-width: 160px; }
.field input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
}
.field input[type="search"]::placeholder { color: var(--muted); font-weight: 500; }

.count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.progressline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.progressline p { flex: 1; }

/* the checkbox in an entry row */
.row .pick {
  flex: none;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.row.muted .what b { color: var(--muted); font-weight: 600; }

.row .note {
  flex: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.empty {
  padding: 18px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.field input[type="password"] {
  width: 12ch;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.row .note.ok { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.row .note.bad { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.estimate {
  padding: 0 16px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
/* rename + reorder, in a compress row */
.row .what b[role="button"] { cursor: text; border-bottom: 1px dashed transparent; }
.row .what b[role="button"]:hover { border-bottom-color: var(--line-strong); }

.row .rename {
  width: 100%;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 6px;
}

.row .order { display: inline-flex; gap: 2px; flex: none; }
.row .nudge {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.row .nudge:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.row .nudge:disabled { opacity: 0.35; cursor: default; }
.langpick select {
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 10px;
  cursor: pointer;
}
.langpick select:hover { color: var(--primary); border-color: var(--primary); }
/* the line under an error that says what to do next */
.nextstep { display: block; margin-top: 3px; font-weight: 500; color: var(--muted); }
/* entry preview */
.preview { border-top: 1px solid var(--line); background: var(--surface-2); }
.preview > header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.preview > header b { display: block; font-size: 13px; overflow-wrap: anywhere; }
.preview > header small { display: block; margin-top: 1px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.preview pre {
  margin: 0; padding: 12px 16px; max-height: 260px; overflow: auto;
  font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap;
  overflow-wrap: anywhere; color: var(--text);
}
.preview img {
  display: block; margin: 12px 16px; max-width: calc(100% - 32px); max-height: 260px;
  border-radius: 8px; background:
    repeating-conic-gradient(var(--code-bg) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}

/* ------------------------------------------------- forced colours (Windows
   High Contrast and friends). Author colours are replaced by the reader's own
   palette, so anything that relied on a background for its shape needs a border,
   and anything that is a button should keep the system's button colours. */
@media (forced-colors: active) {
  .drop,
  .card,
  .workspace,
  .sheet,
  .field,
  .btn,
  .tab,
  .icon-btn,
  .row .tag,
  .row .note,
  .filters,
  .preview,
  .badges span {
    border: 1px solid CanvasText;
  }

  .btn-primary,
  .tab[aria-pressed="true"] {
    background: Highlight;
    color: HighlightText;
    border: 1px solid Highlight;
  }

  .meter .fill,
  .progress .fill,
  .eyebrow i,
  .brand .mark {
    background: Highlight;
    forced-color-adjust: none;
  }

  .row .pick { forced-color-adjust: none; }

  :where(button, select, a, [tabindex]):focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }

  .nextstep, .row .what small { color: CanvasText; }
}

/* more entries than the list will draw */
.rowsmore {
  margin: 0; padding: 10px 16px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
}

/* ---------------------------------------------------------------- print
   A printed page is a list, not an interface: the chrome goes, the rows stay,
   and a row is not split across two sheets. */
@media print {
  .bar, .hero, .drop, .cards, .now, .roadmap, .foot, .fleetnav,
  .tabs, .headbtns, .actions, .progress, .stats, .preview { display: none !important; }

  body { background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
  .panel { border: 0; box-shadow: none; }
  .workspace { border: 0; }
  .workspace > header { border-bottom: 1px solid #000; }
  .row { break-inside: avoid; page-break-inside: avoid; border-color: #999; }
  .row .tag, .row .note { border: 1px solid #666; color: #000; }
  .filters { display: none !important; }
  @page { margin: 14mm; }
}
