/* Axlund design language: components. Load after tokens.css and base.css.
   Each block is one component; the README says when to use it. */

/* ---------- App bar: logo, then breadcrumbs ---------- */
.topbar {
  height: var(--app-bar); flex: none;
  display: flex; align-items: center; gap: 6px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-size: var(--text-mini);
}
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none; font-weight: var(--weight-semibold);
  padding: 4px 6px; margin-left: -6px; border-radius: var(--radius);
}
.logo:hover { background: var(--hover); }
.logo svg { width: 16px; height: 16px; color: var(--ink); }
.crumb-sep { width: 12px; height: 12px; color: var(--ink-faint); }
.crumb { color: var(--ink-muted); }
.crumb.current { color: var(--ink); font-weight: var(--weight-medium); }

/* ---------- Website bar: logo, sections, sign in, one action ---------- */
.sitebar {
  height: var(--site-bar);
  display: flex; align-items: center; gap: 4px;
  max-width: var(--page-wide); margin: 0 auto; padding: 0 var(--gutter);
  font-size: var(--text-mini);
}
.sitebar .logo { margin-right: 20px; font-size: var(--text-regular); }
.sitebar .logo svg { width: 20px; height: 20px; }
.sitebar-link {
  color: var(--ink-muted); text-decoration: none;
  height: var(--control); padding: 0 10px; display: inline-flex; align-items: center;
  border-radius: var(--radius);
}
.sitebar-link:hover { color: var(--ink); }
.sitebar-end { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  height: var(--control); padding: 0 12px; border-radius: var(--radius);
  font-weight: var(--weight-medium); font-size: var(--text-mini);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--fast) var(--ease-out), color var(--fast) var(--ease-out), border-color var(--fast) var(--ease-out);
}
.btn svg { width: 14px; height: 14px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: var(--panel); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-tiny); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); }
.btn-invert { background: var(--invert); border-color: var(--invert); color: var(--on-invert); box-shadow: var(--shadow-tiny); }
.btn-invert:hover:not(:disabled) { background: var(--invert-hover); border-color: var(--invert-hover); }
.btn-ghost { background: transparent; color: var(--ink-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.btn-sm { height: var(--control-sm); padding: 0 10px; font-size: var(--text-micro); }
.btn-lg { height: var(--control-lg); padding: 0 20px; font-size: 16px; }
/* Website buttons are pills, the main one .btn-invert; app buttons are not. */
.btn-pill { border-radius: var(--radius-full); }

.link-btn {
  border: 0; background: none; padding: 2px 6px; margin: -2px -6px;
  color: var(--ink-muted); font-weight: var(--weight-medium); font-size: var(--text-micro);
  cursor: pointer; border-radius: var(--radius-xs);
}
.link-btn:hover { background: var(--hover); color: var(--ink); }

/* ---------- Fields ---------- */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fields.one { grid-template-columns: 1fr; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: var(--text-micro); font-weight: var(--weight-medium); color: var(--ink-muted);
}
.input {
  display: flex; align-items: center;
  height: 34px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel);
  transition: border-color var(--fast) var(--ease-out), box-shadow var(--fast) var(--ease-out);
}
.input:hover { border-color: var(--line-heavy); }
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.input.invalid { border-color: var(--red); }
.input .affix { color: var(--ink-faint); }
.input input {
  flex: 1; min-width: 0; height: 100%; padding: 0 4px;
  border: 0; outline: 0; background: transparent;
}
.input input:focus-visible { box-shadow: none; }
.input input::placeholder { color: var(--ink-faint); }

.check-row { display: flex; gap: 10px; align-items: center; color: var(--ink-2); font-size: var(--text-mini); cursor: pointer; }
.check-row input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }

/* ---------- Choices: chips for long lists, an option list for short ones ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: var(--control-sm); padding: 0 10px 0 8px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel); color: var(--ink-2);
  font-size: var(--text-mini); font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background var(--fast) var(--ease-out), color var(--fast) var(--ease-out);
}
.chip:hover { background: var(--hover); color: var(--ink); }
.chip .box {
  width: 14px; height: 14px; flex: none; border-radius: var(--radius-xs);
  border: 1px solid var(--line-heavy); background: var(--panel);
  display: grid; place-items: center; color: var(--on-accent);
}
.chip .box svg { width: 11px; height: 11px; }
.chip[aria-pressed="true"] { background: var(--raised); color: var(--ink); }
.chip[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); }
.chip.exclude[aria-pressed="true"] { color: var(--red); }
.chip.exclude[aria-pressed="true"] .box { background: var(--red); border-color: var(--red); }
.chip:disabled { color: var(--ink-faint); background: transparent; border-style: dashed; cursor: not-allowed; }
.chip:disabled .box { opacity: 0.5; }
.chip .chip-label { flex: 1; text-align: left; }

.options {
  display: flex; flex-direction: column; max-width: 420px; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--panel); box-shadow: var(--shadow-low);
}
.chip.option {
  width: 100%; height: 34px; padding: 0 8px 0 10px; gap: 10px;
  border: 0; background: transparent; font-size: var(--text-small);
}
.chip.option:hover, .chip.option[aria-pressed="true"]:hover { background: var(--hover); }
.chip.option[aria-pressed="true"] { background: transparent; }

/* The last row of an option list: type something not on the list. Add shows
   once there is text. */
.option-other {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 4px 0 10px; border-radius: var(--radius);
}
.option-other:hover, .option-other:focus-within { background: var(--hover); }
.option-other .box {
  width: 14px; height: 14px; flex: none; border-radius: var(--radius-xs);
  border: 1px dashed var(--line-heavy);
}
.option-other input {
  flex: 1; min-width: 0; height: 100%; padding: 0;
  border: 0; outline: 0; background: transparent; font-size: var(--text-small);
}
.option-other input:focus-visible { box-shadow: none; }
.option-other input::placeholder { color: var(--ink-faint); }
.option-other input:placeholder-shown + .btn { visibility: hidden; }
.option-other.on .box {
  display: grid; place-items: center;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
}
.option-other.on .box svg { width: 11px; height: 11px; }

/* ---------- Segmented control: two or three exclusive choices ---------- */
.seg {
  display: inline-flex; gap: 2px; padding: 2px; flex: none;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised);
}
.seg button {
  height: 24px; padding: 0 10px; border: 0; border-radius: var(--radius-xs);
  background: transparent; color: var(--ink-muted);
  font-size: var(--text-micro); font-weight: var(--weight-medium); cursor: pointer;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-low); }

/* ---------- List card: hairline rows in one rounded box ---------- */
.list-card {
  margin: 0; padding: 0; list-style: none;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel);
}
.list-card > * { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.list-card > :last-child { border-bottom: 0; }

/* ---------- Properties: label and value rows, as in a detail sidebar ---------- */
.props-rows { display: flex; flex-direction: column; }
.prop {
  display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 8px; align-items: start;
  width: 100%; padding: 6px 8px; border: 0; border-radius: var(--radius);
  background: transparent; text-align: left; font-size: var(--text-mini); cursor: pointer;
}
.prop:hover:not(:disabled) { background: var(--hover); }
.prop:disabled { cursor: default; }
.prop.active { background: var(--raised); }
.prop-name { display: flex; align-items: center; gap: 8px; color: var(--ink-muted); white-space: nowrap; }
.prop-value { color: var(--ink); word-break: break-word; }
.prop-value.empty { color: var(--ink-faint); }

/* ---------- Status glyph: to do, in progress, done ---------- */
.st { width: 12px; height: 12px; border-radius: 50%; flex: none; position: relative; }
.st-todo { border: 1.5px dashed var(--ink-faint); }
.st-current {
  border: 1.5px solid var(--amber); padding: 1.5px;
  background: conic-gradient(var(--amber) 0 50%, transparent 50% 100%) content-box;
}
.st-done { background: var(--accent); }
.st-done::after {
  content: ""; position: absolute; left: 3.5px; top: 2px; width: 3px; height: 5.5px;
  border: solid var(--on-accent); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}

/* ---------- Fit light: green, yellow, red ---------- */
.light { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-mini); color: var(--ink-2); }
.light::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); }
.light-green::before { background: var(--green); }
.light-yellow::before { background: var(--amber); }
.light-red::before { background: var(--red); }

/* ---------- Progress: count and a 2px bar ---------- */
.progress { display: flex; align-items: center; gap: 12px; }
.progress-label { font-size: var(--text-micro); font-weight: var(--weight-medium); color: var(--ink); white-space: nowrap; }
.progress-label span { color: var(--ink-faint); }
.progress-bar { flex: 1; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--accent); transition: width var(--slow) var(--ease-out-quart); }

/* ---------- Inline error: what went wrong and how to fix it ---------- */
.error {
  display: flex; gap: 8px; align-items: flex-start;
  color: var(--red); font-size: var(--text-mini); font-weight: var(--weight-medium);
}
.error:empty { display: none; }
.error svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }

/* ---------- Website headline: statement, then a quieter second clause ---------- */
.display {
  font-size: var(--title-7); line-height: 1.1; font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-title); color: var(--ink);
}
.display .quiet { color: var(--ink-muted); }
.lede { font-size: var(--text-regular); line-height: 1.6; letter-spacing: -0.011em; color: var(--ink-muted); max-width: 560px; }

@media (max-width: 600px) {
  .fields { grid-template-columns: 1fr; }
  .display { font-size: var(--title-5); }
}
