/* Tabletidy shared look: tokens and components used by the hosted playground and the
   extension side panel. Built during #BuildHybridAI 2026. */
:root {
  --ink: #17201f; --muted: #5d6b69; --line: #e3e8e7; --bg: #f6f8f7; --card: #fff;
  --brand: #0f766e; --brand-soft: #e3f3f1; --cloud: #3156c9; --cloud-soft: #e7edfc;
  --warn: #a24b0c; --warn-soft: #fdf0e4; --err: #a3271c; --err-soft: #fdecea;
}
.tt, .tt * { box-sizing: border-box; }
.tt { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); display: grid; gap: 12px; align-content: start; min-width: 0; }
.tt [hidden] { display: none !important; }
.tt .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; overflow: visible; }
.tt h2 { font-size: 14px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; letter-spacing: 0; }
.tt .num { width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; display: inline-grid; place-items: center; flex: none; }
.tt .btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.tt .btn:hover { border-color: #b9c4c2; }
.tt .btn:focus-visible, .tt input:focus-visible, .tt select:focus-visible, .tt textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tt .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; width: 100%; padding: 10px 14px; }
.tt .btn.primary:hover { background: #0c635c; }
.tt .btn.primary:disabled { opacity: .6; cursor: progress; }
.tt .btn.ghost { background: transparent; }
.tt .btn.small { padding: 4px 10px; font-size: 12px; }
.tt .muted { color: var(--muted); } .tt .small { font-size: 12px; }
.tt p { margin: 8px 0 0; }
.tt .statusbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; }
.tt .statusbar progress { width: 120px; accent-color: var(--brand); }
.tt .pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--line); color: var(--muted); }
.tt .pill.ok { background: var(--brand-soft); color: var(--brand); }
.tt .pill.warn { background: var(--warn-soft); color: var(--warn); }
.tt .empty { border-style: dashed; background: transparent; text-align: center; padding: 28px 14px; }
.tt .empty p { margin: 0; }
.tt .seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg); border-radius: 8px; padding: 3px; gap: 3px; }
.tt .seg input { position: absolute; opacity: 0; }
.tt .seg span { display: block; text-align: center; padding: 7px 4px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.tt .seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.tt .seg input:focus-visible + span { outline: 2px solid var(--brand); }
.tt .rule { font-size: 12px; color: var(--muted); background: var(--bg); border-left: 3px solid var(--brand); padding: 7px 10px; border-radius: 0 6px 6px 0; margin: 10px 0; }
.tt .runline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tt .badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.tt .badge.on_device { background: var(--brand-soft); color: var(--brand); }
.tt .badge.in_cloud { background: var(--cloud-soft); color: var(--cloud); }
.tt .badge.local { background: var(--line); color: var(--muted); }
.tt .attempts { margin-top: 6px; }
.tt .error { color: var(--err); background: var(--err-soft); border-radius: 6px; padding: 7px 10px; }
.tt [aria-busy="true"] { opacity: .55; transition: opacity .15s; }
.tt .title { font-size: 16px; margin: 12px 0 8px; letter-spacing: -.01em; }
.tt .cols { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tt .cols li { display: grid; grid-template-columns: minmax(70px, 150px) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.tt .cols .orig { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, monospace; }
.tt .cols input[type=text], .tt .cols select { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; min-width: 0; width: 100%; background: var(--card); color: var(--ink); }
.tt .cols select { width: 96px; }
.tt .pii { font: inherit; font-size: 12px; border-radius: 999px; padding: 3px 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--muted); white-space: nowrap; min-width: 104px; text-align: center; }
.tt .pii.on { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-weight: 600; }
.tt .sent { margin: 12px 0 6px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.tt .sent summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.tt .sent pre { max-height: 220px; overflow: auto; background: var(--bg); padding: 10px; border-radius: 6px; font-size: 12px; white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; }
.tt .preview-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.tt .preview { border-collapse: collapse; font-size: 12px; width: 100%; }
.tt .preview th, .tt .preview td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; }
.tt .preview th { background: var(--bg); color: var(--ink); font-size: 12px; position: static; }
.tt .preview tr:last-child td { border-bottom: 0; }
.tt .check { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.tt .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
/* Narrow: side panel and phones */
@container tt (max-width: 520px) {
  .tt .cols li { grid-template-columns: minmax(0, 1fr) auto auto; }
  .tt .cols .orig { grid-column: 1 / -1; margin-bottom: -4px; }
  .tt .cols select { width: 84px; padding: 5px 4px; }
  .tt .pii { min-width: 0; padding: 3px 8px; }
  .tt .card { padding: 12px; }
}
.tt-box { container: tt / inline-size; min-width: 0; }
