/* TaskLift portal. Colours and type follow xentricit.com. */
:root {
  --ink: #0f1b2d;
  --ink-soft: #1c2c44;
  --paper: #f6f3ec;
  --paper-dim: #ece6d8;
  --card: #fffdf8;
  --brass: #b8860b;
  --brass-bright: #e0ad3f;
  --slate: #5a6a82;
  --line: #ddd5c4;
  --ok: #2f6f4f;
  --warn: #9a5b00;
  --bad: #a3322a;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--ink); text-decoration-color: var(--brass); text-underline-offset: 3px; }
a:hover { color: var(--brass); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.3rem; margin-top: 2rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.1rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .8rem 1.25rem; background: var(--ink); color: var(--paper);
  border-bottom: 3px solid var(--brass);
}
.brand { color: var(--paper); text-decoration: none; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.brand span { color: var(--brass-bright); }
.brand small { font-family: var(--sans); font-size: .75rem; font-weight: 500; margin-left: .5rem; color: #c9cfd9; }
.brand:hover { color: var(--paper); }
.who { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; font-size: .9rem; }
.who form { margin: 0; }
.email { color: #c9cfd9; }

main { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
footer { text-align: center; color: var(--slate); font-size: .8rem; padding: 1.5rem 1rem; }

.lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 46rem; }
.muted, .meta { color: var(--slate); }
.crumbs { font-size: .9rem; margin: 0 0 .75rem; }
.empty { color: var(--slate); font-style: italic; }
.flash { background: #fff4d6; border: 1px solid var(--brass-bright); border-radius: 8px; padding: .6rem .9rem; }
.error { background: #fbe9e7; border: 1px solid #e3b4ae; color: var(--bad); border-radius: 8px; padding: .6rem .9rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons */
button, .button {
  display: inline-block; font: inherit; font-weight: 600; font-size: .92rem; line-height: 1.2;
  padding: .55rem 1rem; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
button.primary, .button.primary { background: var(--ink); color: var(--paper); }
button.primary:hover, .button.primary:hover { background: var(--ink-soft); color: var(--paper); }
button.secondary, .button.secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
button.secondary:hover, .button.secondary:hover { background: var(--paper-dim); color: var(--ink); }
button.danger { background: var(--bad); color: #fff; }
button.small { padding: .3rem .7rem; font-size: .8rem; }
button.link { background: none; border: 0; padding: 0; color: #c9cfd9; text-decoration: underline; font-weight: 500; }
button:focus-visible, .button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--brass-bright); outline-offset: 2px;
}
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.actions form, form.action { display: flex; gap: .4rem; align-items: center; margin: 0; flex-wrap: wrap; }
select, input[type="password"], input[type="text"] {
  font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%;
}

/* login */
.login { max-width: 26rem; margin: 2rem auto; }
.stack { display: flex; flex-direction: column; gap: .6rem; }
.google-button { min-height: 44px; margin: 1.25rem 0; }
.dev-login { margin-top: 2rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.dev-login label { font-size: .85rem; color: var(--slate); font-weight: 600; }
.workspace h2 { margin-top: 0; border: 0; padding: 0; }
.workspace p { margin: .2rem 0; }

/* flow cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.flow-card, .item, .panel, .tile, .chart, .facts > div {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem;
}
.flow-card.running, .panel.running { border-color: var(--ok); box-shadow: inset 4px 0 0 var(--ok); }
.flow-card p { margin: .35rem 0; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .55rem; border-radius: 999px; background: var(--paper-dim); color: var(--ink-soft); }
.tag.waiting, .tag.needs_look { background: #fff0cc; color: var(--warn); }
.tag.confirmed, .tag.handled { background: #dcefe4; color: var(--ok); }
.tag.suggested { background: #e3ebf7; color: #284b80; }
.tag.declined, .tag.failed { background: #f8dcd8; color: var(--bad); }
.tag.ai { background: #ece3ff; color: #4b2a8c; }
.state { color: var(--ink-soft); font-size: .9rem; }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--ok); margin-right: .45rem; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

.panel { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.panel .actions { margin-top: 0; }

/* needs-you items */
.item { margin-bottom: .75rem; border-left: 4px solid var(--brass-bright); }
.item.needs_look { border-left-color: var(--warn); }
.item header p { margin: 0; }
.issues { margin: .5rem 0; padding-left: 1.2rem; color: var(--warn); font-weight: 600; font-size: .92rem; }
.note, .preview { background: var(--paper); border-radius: 8px; padding: .45rem .7rem; font-size: .92rem; }
.reader { font-size: .8rem; color: var(--slate); margin: .6rem 0 0; }

/* results */
.summary { font-size: 1.05rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin: 1rem 0; }
.tile-value { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.tile-label { color: var(--slate); font-size: .85rem; font-weight: 600; }
.tile-note { font-size: .8rem; color: var(--slate); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin: 1rem 0; }
.chart { margin: 0; }
.chart figcaption { font-weight: 700; font-size: .9rem; margin-bottom: .4rem; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--brass); }
.chart .bar:hover { fill: var(--brass-bright); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .bar-label { font-size: 12px; fill: var(--slate); font-family: var(--sans); }
.chart .bar-value { font-size: 12px; fill: var(--ink); font-weight: 700; font-family: var(--sans); }

.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: .92rem; }
caption { text-align: left; font-weight: 700; padding: 0 0 .4rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--paper-dim); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); }
tr:last-child td { border-bottom: 0; }
.notes { color: var(--slate); font-size: .9rem; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.facts h2 { margin-top: 0; font-size: 1.05rem; }
.facts ul { padding-left: 1.1rem; margin: 0; }

.draft blockquote { margin: .75rem 0; padding: .9rem 1rem; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: 8px; font-size: 1.05rem; }
.original pre { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .8rem; font-size: .85rem; }

@media (max-width: 600px) {
  h1 { font-size: 1.6rem; }
  .panel { flex-direction: column; align-items: flex-start; }
}
