/* Tartan web components: styles (decision 192). Values follow components/spec/; colours only through tokens.css.
   Sizes are in px = Android dp, so a mockup at 360 px wide matches a 360 dp phone. */

.t-root { font-family: var(--t-font-product); color: var(--t-ink); background: var(--t-surface);
  font-size: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; }
.t-root *, .t-root *::before, .t-root *::after { box-sizing: border-box; }
.t-root p, .t-root h2, .t-root h3 { margin: 0; }
tartan-header, tartan-button, tartan-status-card, tartan-chip, tartan-field, tartan-card, tartan-banner,
tartan-tabs, tartan-nav, tartan-name-row, tartan-list-row, tartan-dialog, tartan-sheet, tartan-mark,
tartan-divider, tartan-text { display: block; }
tartan-chip, tartan-mark { display: inline-block; }

/* ---- type roles (Material 3 scale on the brand families, as Theme.kt) ---- */
.t-headline { font-family: var(--t-font-brand); font-weight: 700; font-size: 24px; line-height: 32px; margin: 0; }
.t-title { font-weight: 600; font-size: 16px; line-height: 24px; margin: 0; }
.t-body { font-size: 16px; line-height: 24px; margin: 0; }
.t-body-m { font-size: 14px; line-height: 20px; margin: 0; }
.t-small { font-size: 12px; line-height: 16px; margin: 0; }
.t-mono { font-family: var(--t-font-mono); font-size: 14px; line-height: 20px; }
.t-muted { color: var(--t-muted); }
.t-error { color: var(--t-error); }

/* ---- wordmark: "Tartan" in Cardo Bold, cream on dark grounds (decision 178) ---- */
.t-wordmark { font-family: var(--t-font-brand); font-weight: 700; color: var(--t-on-header);
  text-shadow: 0 1px 14px rgba(0,0,0,.45); }

/* ---- header ---- */
.t-header { background: var(--t-header); color: var(--t-on-header); }
.t-header__bar { height: 56px; padding: 0 16px; display: flex; align-items: center; gap: 10px; }
.t-header__bar img { width: 26px; height: 26px; border-radius: 5px; }
.t-header__name { font-family: var(--t-font-brand); font-weight: 700; font-size: 22px; line-height: 1; }
.t-statusbar { height: 24px; background: var(--t-header); }

/* ---- buttons ---- */
.t-btn { font: 600 14px/20px var(--t-font-product); letter-spacing: .1px; border-radius: 20px; min-height: 40px;
  padding: 10px 24px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 0; background: none; color: var(--t-primary); text-decoration: none; }
.t-btn--full { width: 100%; }
.t-btn--main, .t-btn--outline { margin: 4px 0; } /* Material's 48 px touch target around a 40 px button */
.t-btn--main { background: var(--t-button-fill); color: var(--t-button-label);
  box-shadow: inset 0 0 0 1.5px var(--t-button-edge); }
.t-btn--outline { box-shadow: inset 0 0 0 1px var(--t-outline); color: var(--t-primary); }
.t-btn--text { padding: 10px 12px; }
.t-btn:disabled { cursor: default; opacity: 1; color: color-mix(in srgb, var(--t-ink) 38%, transparent); }
.t-btn--main:disabled { background: color-mix(in srgb, var(--t-ink) 12%, transparent); box-shadow: none; }
.t-btn--outline:disabled { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t-ink) 12%, transparent); }
.t-btn:where(:not([disabled], [aria-disabled="true"])):focus-visible { outline: 2px solid var(--t-primary); outline-offset: 2px; }

/* ---- status card ---- */
.t-status { border-radius: 18px; padding: 16px 18px; }
.t-status .t-headline { color: inherit; }
.t-status p { font-size: 14px; line-height: 20px; margin: 0; }
/* The card is the connect control (decision 366): tap the card to connect or disconnect; a switch at its right, drawn in
   the card's label colour (white; ink on the gold in-progress card). On: filled, the knob in the card's colour. */
.t-status--switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.t-status__text { flex: 1; min-width: 0; }
.t-switch { width: 52px; height: 32px; border-radius: 16px; flex-shrink: 0; position: relative;
  box-shadow: inset 0 0 0 2px currentColor; }
.t-switch i { position: absolute; top: 8px; left: 8px; width: 16px; height: 16px; border-radius: 50%; background: currentColor; }
.t-switch--on { background: currentColor; }
.t-switch--on i { left: 24px; top: 4px; width: 24px; height: 24px; background: var(--t-status-connected); }
.t-switch--busy i { left: 16px; top: 6px; width: 20px; height: 20px; }
.t-switch--on.t-switch--busy { background: transparent; }
.t-switch--on.t-switch--busy i { background: currentColor; }

/* ---- chip (a name's reach) ---- */
.t-chip { display: inline-block; border-radius: 999px; padding: 3px 10px; font: 600 12px/16px var(--t-font-product);
  letter-spacing: .5px; white-space: nowrap; }
.t-chip--internal { background: var(--t-chip-internal); color: var(--t-chip-internal-label);
  box-shadow: inset 0 0 0 1.5px var(--t-chip-internal-edge); }
.t-chip--gated { background: var(--t-chip-gated); color: var(--t-chip-gated-label); }
.t-chip--public { background: var(--t-chip-public); color: var(--t-chip-public-label); }

/* ---- text field (Material outlined) ---- */
.t-field { position: relative; margin-top: 8px; }
.t-field__box { min-height: 56px; border: 1px solid var(--t-outline); border-radius: 4px; padding: 16px;
  display: flex; align-items: center; font-size: 16px; line-height: 24px; color: var(--t-ink); }
.t-field__box--empty { color: var(--t-muted); }
.t-field__label { position: absolute; left: 12px; top: -9px; padding: 0 4px; font-size: 12px; line-height: 16px;
  color: var(--t-muted); background: var(--t-field-ground, var(--t-surface)); }
.t-field--mono .t-field__box { font-family: var(--t-font-mono); letter-spacing: 1px; }
.t-field--error .t-field__box { border-color: var(--t-error); }
.t-field--error .t-field__label { color: var(--t-error); }
.t-field__error { font-size: 14px; line-height: 20px; color: var(--t-error); margin: 4px 0 0; }

/* ---- card (elevated) ---- */
.t-card { background: var(--t-card); border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 1px 3px 1px rgba(0,0,0,.08); }

/* ---- banner: the red overcheck as a fine thread down the edge ---- */
.t-banner { background: var(--t-card); border-radius: 12px; overflow: hidden; margin-top: 12px;
  box-shadow: inset 3px 0 0 var(--t-status-needs-attention); padding: 16px 16px 8px; }
.t-banner .t-btn { margin-left: -12px; }

/* ---- tabs ---- */
.t-tabs { display: flex; border-bottom: 1px solid var(--t-line); background: var(--t-surface); }
.t-tab { flex: 1; height: 48px; border: 0; background: none; font: 400 14px/20px var(--t-font-product);
  color: var(--t-muted); position: relative; cursor: pointer; }
.t-tab[aria-selected="true"] { color: var(--t-primary); font-weight: 700; }
.t-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: var(--t-gold); }

/* ---- bottom navigation ---- */
/* On the header navy in both themes (decision 367, amends 197): a bar above every item so each reads as a button;
   unselected bars and labels in on-header (30 % / 72 %); the selected item's bar and bold label in gold. */
.t-nav { height: 80px; background: var(--t-header); display: flex; padding: 12px 0 16px; }
.t-nav__item { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: 400 12px/16px var(--t-font-product); color: color-mix(in srgb, var(--t-on-header) 72%, transparent); cursor: pointer; }
.t-nav__pill { width: 40px; height: 3px; flex-shrink: 0; border-radius: 2px; margin: 14px 0 15px;
  background: color-mix(in srgb, var(--t-on-header) 30%, transparent); }
.t-nav__item[aria-current="page"] { color: var(--t-gold); font-weight: 700; }
.t-nav__item[aria-current="page"] .t-nav__pill { background: var(--t-gold); }

/* ---- list rows ---- */
.t-row { display: flex; align-items: center; gap: 8px; padding: 12px 16px; min-height: 56px;
  border-bottom: 1px solid var(--t-line); cursor: pointer; }
.t-row__main { flex: 1; min-width: 0; }
.t-row__main .t-mono { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-row__chev { color: var(--t-ink); font-size: 18px; padding-left: 2px; }
.t-row__tick { color: var(--t-ink); }

/* ---- divider ---- */
.t-divider { height: 1px; background: var(--t-line); margin: 8px 0; }

/* ---- dialog and sheet (over a scrim) ---- */
.t-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.32); display: flex; z-index: 5; }
.t-dialog { margin: auto 24px; background: var(--t-card); border-radius: 28px; padding: 24px; width: 100%; }
.t-dialog h2 { font: 400 24px/32px var(--t-font-product); margin: 0 0 16px; }
.t-dialog p { color: var(--t-muted); font-size: 14px; line-height: 20px; margin: 0 0 24px; }
.t-dialog__actions, .t-sheet__actions { display: flex; justify-content: flex-end; gap: 8px; }
.t-sheet { margin-top: auto; width: 100%; background: var(--t-card); border-radius: 28px 28px 0 0; padding: 22px 24px 24px;
  --t-field-ground: var(--t-card); }
.t-sheet__handle { width: 32px; height: 4px; border-radius: 2px; background: var(--t-muted); opacity: .4;
  margin: -10px auto 18px; }
