/* Moneypal Human Synergy — shared styles. Mobile-first, keyboard-friendly. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1a1d23;
  --muted: #5b616e;
  --border: #d7dbe2;
  --accent: #0b5fff;
  --accent-ink: #ffffff;
  --ok: #1a7d3f;
  --ok-bg: #e6f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff3dc;
  --danger: #b3261e;
  --danger-bg: #fbe9e7;
  --focus: #0b5fff;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1d2026;
    --text: #eef0f3;
    --muted: #a8aeb8;
    --border: #343a44;
    --accent: #5b9bff;
    --accent-ink: #0b1220;
    --ok: #6fd896;
    --ok-bg: #0f2a1b;
    --warn: #ffcf7a;
    --warn-bg: #352403;
    --danger: #ff8a80;
    --danger-bg: #3a1613;
    --focus: #7db2ff;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 16px 16px 64px; }
header.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
header.app-header h1 { font-size: 1.05rem; margin: 0; }
header.app-header .tag { color: var(--muted); font-size: 0.85rem; }

h2 { font-size: 1.25rem; margin: 1.5em 0 0.5em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 0.4em; }
p.hint, .hint { color: var(--muted); font-size: 0.9rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0 0 16px; background: var(--surface); }
legend { padding: 0 6px; font-weight: 600; }
.field { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.95rem; }
label .req { color: var(--danger); }
.field .hint { margin: 2px 0 0; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; padding: 10px 12px; font-size: 1rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit;
}
textarea { min-height: 5em; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }

/* Visible, high-contrast focus ring everywhere, light and dark */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button, .btn {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 10px 16px; min-height: 44px;
}
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.link { border: none; background: none; padding: 4px; color: var(--accent); text-decoration: underline; min-height: auto; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.yesno { display: flex; gap: 18px; }
.yesno label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; }
.checkbox-row input { width: auto; margin-top: 4px; }
.checkbox-row label { font-weight: 400; }

table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
caption { text-align: left; font-weight: 600; margin-bottom: 6px; }
th, td { border: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; font-size: 0.92rem; }
th { background: color-mix(in srgb, var(--surface) 70%, var(--border)); }
td input, td select { min-width: 110px; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.neutral { background: color-mix(in srgb, var(--surface) 60%, var(--border)); color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.progress-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.progress-list li { padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 60%, var(--border)); font-size: 0.82rem; color: var(--muted); }
.progress-list li[aria-current="step"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

nav.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
nav.tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

table.pipeline tr:focus-within { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.pipeline-row-btn { width: 100%; text-align: left; border: none; background: none; min-height: auto; padding: 4px; color: inherit; font: inherit; text-decoration: underline; }

[aria-live] { min-height: 1.2em; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.msg.error { background: var(--danger-bg); color: var(--danger); }
.msg.success { background: var(--ok-bg); color: var(--ok); }
.msg.info { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--text); }

.skip-link {
  position: absolute; left: -999px; top: auto;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 16px; top: 8px; position: fixed; }

footer.app-footer { max-width: 860px; margin: 24px auto; padding: 0 16px; color: var(--muted); font-size: 0.85rem; }

.events { list-style: none; padding: 0; margin: 0; }
.events li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.events li:last-child { border-bottom: none; }
.events time { color: var(--muted); display: block; font-size: 0.8rem; }

.center-card { max-width: 440px; margin: 48px auto; }
