/* GeTa.Base interface kit: black and white, compact (12px text, tight spacing), pill-shaped actions,
   hairline borders, flat surfaces. Pillars may load this same file from /style.css. */

/* Colours, font and the frame (band + rail) come from /theme.css, loaded first. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs)/1.45 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

/* ---- page layout ------------------------------------------------------- */
.shell { min-height: 100vh; }
#app {
  width: 100%;
  max-width: 560px;
  margin: 48px auto;
  padding: 32px 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
#app.wide { max-width: 860px; }
.signed-in #app.full { max-width: none; padding: 20px 16px 40px; }
#app.full .ftree { max-height: none; height: calc(100vh - 210px); min-height: 360px; }
.signed-in #app {
  max-width: 1040px;
  margin: 0 auto;
  background: transparent;
  border: 0;
  padding: 18px 20px 60px;
}
.signed-in #app > section,
.signed-in #app > .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 4px 16px 10px;
  margin-top: 12px;
}

.icon { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* drop-down menus */
.menu { position: relative; margin: 0; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary .icon { width: 14px; height: 14px; stroke-width: 2.2; transition: transform .15s; }
.menu[open] > summary .icon { transform: rotate(180deg); }
.menu-list {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  display: grid; gap: 2px;
}
.menu.me .menu-list, .menu.phone-only .menu-list { left: auto; right: 0; }
.menu-list button { width: 100%; justify-content: flex-start; text-align: left; border-radius: 9px; padding: 9px 12px; }
.menu-list button.on { color: var(--accent); font-weight: 600; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 11px; }
.menu.me > summary { padding: 4px 8px 4px 4px; }
.block { display: block; }
.phone-only { display: none; }
code.cmd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; background: var(--line-soft); border-radius: 6px; padding: 2px 6px; word-break: break-all; }
ol.steps { padding-left: 22px; }
ol.steps li { margin: 6px 0; }

/* phone */
@media (max-width: 833px) {
  .wide-only { display: none !important; }
  .phone-only { display: block; }
  .signed-in #app { padding: 14px 12px 32px; }
  #app { margin: 16px auto; padding: 24px 20px; }
  .signed-in #app > section, .signed-in #app > .panel { padding: 4px 16px 12px; }
}

/* ---- type ------------------------------------------------------------------ */
h1 { font-size: 18px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 13px; line-height: 1.25; font-weight: 600; letter-spacing: 0; margin: 14px 0 6px; }
@media (max-width: 640px) { h1 { font-size: 16px; } }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small, .muted.small { font-size: 11px; line-height: 1.43; letter-spacing: -0.016em; }
.page-sub { color: var(--muted); margin-top: -2px; }
a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
code { font: 12px ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* ---- forms ------------------------------------------------------------------- */
form { display: grid; gap: 10px; margin-top: 10px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: var(--fs-small); }
label .muted { font-weight: 400; }
input, select, textarea {
  font: 400 var(--fs)/1.3 var(--font); letter-spacing: -0.01em;
  min-height: 30px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: var(--radius-field);
  background: var(--card); color: var(--text);
  width: 100%;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.47; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--accent); }
input[type=color] { padding: 4px; width: 88px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 10px 12px; display: grid; gap: 8px; margin: 0; }
legend { font-weight: 600; padding: 0 6px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: var(--fs); }

/* ---- buttons (pill-shaped; press shrinks slightly) ----------------------------- */
button {
  font: 600 var(--fs-small)/1.17 var(--font); letter-spacing: 0;
  min-height: 30px; padding: 6px 14px;
  border: 1px solid var(--accent); border-radius: var(--pill);
  background: var(--accent); color: var(--on-accent);
  cursor: pointer; transition: transform .1s ease;
}
button:active { transform: scale(.95); }
button:disabled { opacity: .5; cursor: default; transform: none; }
.secondary { background: transparent; color: var(--accent); }
.secondary.danger, .danger.secondary { border-color: var(--error); color: var(--error); }
.link { background: none; border: 0; min-height: 0; padding: 6px 0; color: var(--accent); }
.link:active { transform: none; opacity: .6; }
.danger { color: var(--error); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > button, .row > select { flex: 1 1 140px; width: auto; }

/* ---- messages ------------------------------------------------------------------ */
.note { background: var(--accent-soft); padding: 8px 12px; border-radius: var(--radius-field); margin: 10px 0; }
.error { color: var(--error); background: var(--error-soft); padding: 8px 12px; border-radius: var(--radius-field); margin: 0; }
.divider { text-align: center; color: var(--muted); margin: 16px 0 0; font-size: 11px; }

/* ---- chips, tags, segmented tabs -------------------------------------------------- */
.tabs { display: flex; gap: 6px; margin: 10px 0 4px; flex-wrap: wrap; }
.tab { background: var(--card); color: var(--text); border: 1px solid var(--line); padding: 5px 12px; min-height: 28px; font-size: var(--fs-small); font-weight: 400; }
.tab.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.tag { display: inline-block; font-size: 10px; line-height: 1.6; padding: 0 9px; margin-left: 6px; border-radius: var(--pill); border: 1px solid var(--accent); color: var(--accent); vertical-align: 2px; letter-spacing: 0; }
.muted-tag { border-color: var(--line); color: var(--muted); }
.danger-tag { border-color: var(--error); color: var(--error); }
.chip { --chip: var(--accent); display: inline-block; font-size: 10px; font-weight: 600; line-height: 1.6; padding: 0 9px; border-radius: var(--pill); color: var(--chip); border: 1px solid var(--chip); letter-spacing: 0; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 8px; vertical-align: -1px; }

/* ---- lists ------------------------------------------------------------------------- */
section { margin-top: 12px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li > div { min-width: 0; overflow-wrap: anywhere; }
.list li.warn b { color: var(--error); }
.list li.off b { color: var(--muted); }
.list li > button { white-space: nowrap; }
.actions { display: flex; gap: 14px; flex-shrink: 0; }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item > div:first-child { flex: 1 1 240px; }
.item p { margin: 2px 0 0; }
.item .list { flex-basis: 100%; }
.item > input { flex: 1 1 220px; width: auto; }
details { margin-top: 10px; }
summary { cursor: pointer; color: var(--accent); font-size: 11px; }

/* ---- home ----------------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.tile {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card);
  color: var(--text); text-decoration: none; transition: transform .1s ease;
}
.tile:hover { text-decoration: none; border-color: var(--accent); }
.tile:active { transform: scale(.98); }
.tile-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.tile-icon .lu { width: 18px; height: 18px; }
.tile-body { display: grid; gap: 4px; justify-items: start; }
.tile-body b { font-size: 13px; }
.coming { list-style: none; padding: 0; margin: 0; }
.coming li { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); }
.coming li:last-child { border-bottom: 0; }
.due { font-size: 11px; font-weight: 600; min-width: 92px; color: var(--muted); }
.due.soon { color: var(--error); }

/* ---- control panel ------------------------------------------------------------------------ */
.grid-profile { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 14px 16px; margin-top: 14px; background: var(--card); }
.grid-head { display: flex; gap: 8px; align-items: center; }
.grid-row { align-items: center !important; }
.grid-row select { width: auto; min-width: 128px; }
.part-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 400; margin: 10px 0 0 12px; }
.part-row select { width: auto; }
.pillar-pick .parts { margin: 8px 0 4px 30px; display: grid; gap: 8px; }
[hidden] { display: none !important; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }

/* ---- family tree --------------------------------------------------------------------------- */
.fam-head { justify-content: space-between; }
.fam-head .tabs { margin: 0; }
.fam-head > button { flex: 0 0 auto; }
.fam-head > .row > button, .fam-wait > button { flex: 0 0 auto; }
.fam-wait > .grow { flex: 1 1 240px; }
.fam-tools { margin: 12px 0; gap: 18px; }
.fam-tools .check { font-size: 12px; }
.ftree { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); max-height: 72vh; }
.fcanvas { position: relative; margin: 0 auto; }
.flines { position: absolute; inset: 0; pointer-events: none; }
.flines path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.flines path.dashed { stroke-dasharray: 5 4; }
.flines path.waiting { stroke-dasharray: 3 4; stroke: var(--accent); }
.fcard.pending .fcard-main { border: 1.5px dashed var(--accent); background: var(--card); }
.fcard.pending .fcard-main span { color: var(--accent); }
.fam-wait { align-items: center; gap: 10px; }
.fcard { position: absolute; width: 108px; height: 96px; }
.fcard-main { width: 100%; height: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 2px; text-align: center; padding: 6px 6px 4px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px; font-size: 12px; }
/* the circle: a photo can go here later */
.fface { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; margin-bottom: 1px;
  background: var(--fill); color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.fshort { font-size: 10px; font-weight: 700; color: var(--muted); line-height: 1.1; min-height: 11px; }
/* a long name takes two lines, and is cut short with "…" past that */
.fcard-main b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  font-size: 11px; line-height: 1.2; overflow-wrap: anywhere; max-width: 100%; }
.fcard.me .fface { background: var(--band-bg); color: var(--band-text); }
.fface .lu { width: 20px; height: 20px; }
.fshort { font-size: 11px; color: var(--text); }
.fcard-main:hover { border-color: var(--accent); }
.fcard.me .fcard-main { background: var(--accent-soft); }
.fcard.centre .fcard-main { border: 2px solid var(--focus); }
.fcard .more-box { position: absolute; top: -9px; right: -8px; display: grid; gap: 2px; justify-items: end; }
.fcard .more { min-height: 0; padding: 0 7px; font-size: 10px; line-height: 16px; border-radius: var(--pill); }
.fcard .more.conn { background: var(--card); color: var(--muted); border-color: var(--muted); }
.list.compact li { padding: 8px 0; }
.small-btn { min-height: 36px; font-size: 12px; padding: 6px 14px; }
.edit-line > input, .edit-line > select { flex: 1 1 140px; width: auto; }
.edit-line > input[type=date] { flex: 0 1 170px; }
label.grow { flex: 1 1 220px; }
.sheet { max-height: 88vh; overflow: auto; }
.sheet h3 { margin: 18px 0 4px; font-size: 13px; }

/* ---- sign-in extras --------------------------------------------------------------------------- */
.qr { display: block; margin: 16px auto; width: 220px; height: 220px; image-rendering: pixelated; background: #fff; padding: 10px; border-radius: 12px; }
.key code { font-size: 12px; overflow-wrap: anywhere; }
.steps { padding-left: 22px; }
.steps li { margin: 6px 0; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 14px; }
.codes li { padding: 4px 0; }

/* ---- sheet (quick capture) --------------------------------------------------------------------- */
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 80; display: grid; place-items: end center; }
@media (min-width: 834px) { .sheet-back { place-items: center; } }

.sheet { width: 100%; max-width: 520px; background: var(--card); border-radius: var(--radius-card) var(--radius-card) 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 834px) { .sheet { border-radius: var(--radius-card); } }
.sheet h2 { margin-top: 0; }

@media print {
  body { background: #fff; color: #000; }
  button { display: none !important; }
  #app { border: 0; }
}

/* phones: inputs stay at 16px so the page doesn't zoom in when typing */
@media (max-width: 640px) { input, select, textarea { font-size: 16px; } }

/* ---- control panel: one page ---------------------------------------------------------------- */



.cp-sec { scroll-margin-top: calc(var(--band) + 10px); }
.signed-in #app > .panel.cp-sec > h2.cp-h { font-size: 15px; margin: 12px 0 6px; }
.cp-back { margin: 0 0 6px; }

.remind-l { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; }
.remind-l .lu { width: 14px; height: 14px; color: var(--muted); }
.remind-day { width: 132px; min-height: 26px; padding: 2px 6px; font-size: var(--fs-small); }
.chip.remind { margin-left: 6px; }

/* ---- home: the weather and each pillar's key figures ------------------------------------------ */
.signed-in #app:has(.dash) { max-width: 1400px; }
.greet { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.greet h1 { margin: 0; }
/* blocks stack in as many columns as fit (three on a full screen, two at half, one on a phone) */
.dash { columns: 330px; column-gap: 12px; }
.dash > * { break-inside: avoid; margin: 0 0 12px !important; display: block; width: 100%; }
.signed-in #app .dash-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 10px 14px; margin: 0; min-width: 0; }
.dash-card h2 { margin: 2px 0 8px; }
.kpi-h { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; margin-bottom: 8px; }
.kpi-h b { font-size: 13px; }
.kpi-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--accent); color: var(--on-accent); }
.kpi-icon .lu { width: 14px; height: 14px; }
.kpi-go { margin-left: auto; color: var(--muted); } .kpi-go .lu { width: 16px; height: 16px; }
.kpi-h:hover .kpi-go { color: var(--text); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fact { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--radius-field); background: var(--fill); color: var(--text); text-decoration: none; }
.fact:hover { background: var(--accent-soft); }
.fact b { font-size: 14px; display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.fact b.up { color: var(--up); } .fact b.down { color: var(--error); }
.fact-trend .lu { width: 15px; height: 15px; }
.tiny { font-size: 10px; }
.weather .w-now { display: flex; gap: 12px; align-items: center; }
.w-icon .lu { width: 40px; height: 40px; stroke-width: 1.6; }
.w-temp { font-size: 28px; line-height: 1; font-weight: 700; }
.w-more { margin: 8px 0; }
.w-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; border-top: 1px solid var(--line); padding-top: 8px; }
.w-days > div { display: grid; justify-items: center; gap: 2px; }
.w-day-icon .lu { width: 18px; height: 18px; }

/* My account: frame colour */
.band-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.band-sw { width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; }
.band-sw.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--text); }
.band-pick input[type=color] { width: 30px; height: 28px; padding: 0 2px; border-radius: 6px; min-height: 0; }

/* home: notes block */
.notes-card .card-h { display: flex; align-items: baseline; justify-content: space-between; }
.notes-list { list-style: none; margin: 0 0 8px; padding: 0; max-height: 300px; overflow-y: auto; }
.notes-list li { display: flex; align-items: flex-start; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.notes-list li:last-child { border-bottom: 0; }
.notes-list li.done .n-body > div:first-child { color: var(--muted); text-decoration: line-through; }
.n-body { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes-list .tick { min-height: 0; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border-radius: 50%;
  background: none; border: 0; color: var(--muted); flex: none; cursor: pointer; }
.notes-list .tick:hover { background: var(--hover); color: var(--text); }
.notes-list .tick .lu { width: 15px; height: 15px; }
.notes-list .remind-l { position: relative; flex: none; }
.notes-list .remind-l .remind-day { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; }
.notes-list .tick.on { color: var(--text); }
.notes-card textarea { width: 100%; min-height: 34px; resize: vertical; }
/* home: weather list */
.w-list { width: 100%; border-collapse: collapse; margin-top: 8px; border-top: 1px solid var(--line); }
.w-list td { padding: 5px 4px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.w-list tr:last-child td { border-bottom: 0; }
.w-list .w-ic .lu { width: 18px; height: 18px; }
.w-list .r { text-align: right; white-space: nowrap; }
.w-time { font-variant-numeric: tabular-nums; }
/* home: calendar */
.cal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cal-nav { background: none; border: 0; color: var(--text); min-height: 0; padding: 4px; border-radius: 50%; }
.cal-nav:hover { background: var(--hover); }
.cal-nav .lu { width: 16px; height: 16px; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-w { font-size: 10px; color: var(--muted); padding: 2px 0; }
.cal-d { position: relative; background: none; border: 0; color: var(--text); min-height: 30px; padding: 0; border-radius: 50%; font-weight: 400; font-size: var(--fs); }
.cal-d:hover { background: var(--hover); }
.cal-d.today { font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--text); }
.cal-d.on { background: var(--accent); color: var(--on-accent); }
.cal-d.has::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.cal-list { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 3px; }
