/* OBSCURA OS - TELLTALE, the daily file.
   The file on the left as anybody would see it, with its layers opened
   under it; the five people on the right; one column on a phone. Colours,
   sizes and corners are the theme's tokens, and a layer that opens fades
   in, which theme.js turns down or off with the motion setting. */

.tt { padding: var(--space-6); }
.tt-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0 0 var(--space-3); }
.tt-no { margin: 0; font: 600 var(--text-2xs)/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.tt-nav { display: flex; align-items: center; gap: var(--space-2); }
.tt-navbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; padding: 0; }
.tt-navbtn svg { flex: none; width: 18px; height: 18px; }
#ttToday { min-height: 44px; }
.tt-title { margin: 0 0 var(--space-2); font-size: var(--text-xl); line-height: 1.25; }
.tt-scene { max-width: var(--measure); margin: 0 0 var(--space-6); font-size: var(--text-md); line-height: var(--leading-prose); color: var(--ink); }

.tt-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.tt-h { margin: 0 0 var(--space-3); font: 600 var(--text-2xs)/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }

/* ------------------------------------------------------------ the file */

.tt-file-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-2); }
.tt-layer-no { flex: none; padding: 2px 6px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); font: 600 var(--text-2xs)/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.tt-file-name { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.tt-file-meta { font-size: var(--text-xs); color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.tt-page { padding: var(--space-4) var(--space-6); border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper); color: var(--ink); font-size: var(--text-sm); line-height: var(--leading-prose); }
.tt-page p { margin: 0 0 var(--space-2); }
.tt-page p:last-child { margin-bottom: 0; }
.tt-pg-h { font-weight: 650; font-size: var(--text-md); }
.tt-pg-small { font: var(--text-2xs)/1.5 var(--font-mono); color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
/* A page typed in Courier, so a box over it is as wide as the letters it hides. */
.tt-page-mono p { font: var(--text-xs)/1.7 var(--font-mono); overflow-wrap: anywhere; }
.tt-box { display: inline-block; background: var(--ink); color: transparent; user-select: none; }
.tt-pg-pic { padding: var(--space-3); border: 1px dashed var(--rule-strong); border-radius: var(--radius-sm); font-size: var(--text-xs); color: var(--ink-soft); }
.tt-page-text p { font: var(--text-xs)/1.6 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.tt-mail-head { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-3); padding: 0 0 var(--space-3); border-bottom: 1px solid var(--rule); }
.tt-page-cal .tt-mail-head { margin: 0; padding: 0; border: 0; }
.tt-mail-head dt { font: 600 var(--text-2xs)/1.9 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.tt-mail-head dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tt-page-sheet { padding: 0; overflow: hidden; }
.tt-sheet-scroll { overflow-x: auto; }
.tt-sheet { width: 100%; border-collapse: collapse; font: var(--text-xs)/1.4 var(--font-mono); font-variant-numeric: tabular-nums; }
.tt-sheet td { padding: 6px 10px; border: 1px solid var(--rule); white-space: nowrap; }
.tt-sheet td.n { text-align: right; }
.tt-sheet tr:first-child td { font-weight: 600; border-top: 0; }
.tt-sheet td:first-child { border-left: 0; }
.tt-sheet td:last-child { border-right: 0; }
.tt-sheet tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------ the layers */

.tt-layers { list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.tt-layer { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); padding: var(--space-3) 0; border-top: 1px solid var(--rule); }
.tt-layer.is-new { animation: os-fade-in var(--dur-4) var(--ease-standard) backwards; }
.tt-layer:focus { outline: none; }
.tt-layer:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tt-layer.is-shut { color: var(--ink-faint); }
.tt-layer.is-shut .tt-layer-no { border-style: dashed; color: var(--ink-faint); }
.tt-layer-name { font-weight: 600; }
.tt-layer.is-shut .tt-layer-name { font-weight: 400; font-size: var(--text-sm); }
.tt-layer-where { font: var(--text-2xs)/1.4 var(--font-mono); color: var(--ink-faint); overflow-wrap: anywhere; }
.tt-fields { flex: 1 1 100%; display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: var(--space-4); margin: var(--space-1) 0 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--paper-inset); }
/* One grid for every field, so the values line up under each other. */
.tt-field { display: contents; }
.tt-field dt, .tt-field dd { padding: 3px 0; font: var(--text-xs)/1.5 var(--font-mono); }
.tt-field dt { color: var(--ink-soft); overflow-wrap: anywhere; }
.tt-field dd { margin: 0; min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.tt-says { flex: 1 1 100%; max-width: var(--measure); margin: var(--space-1) 0 0; font-size: var(--text-sm); line-height: var(--leading-prose); color: var(--ink-soft); }
.tt-deeper { margin-top: var(--space-2); min-height: 44px; }
.tt-deeper[hidden] { display: none; }
.tt-depth { margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--ink-faint); }
.tt-depth:empty { display: none; }

/* ------------------------------------------------------------ the five */

/* A radio group holds its five buttons directly: a list item is not a
   child a radio group may have. */
.tt-suspects { display: flex; flex-direction: column; gap: var(--space-2); }
.tt-suspect { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-2); width: 100%; min-height: 44px; padding: var(--space-2) var(--space-3); border: 1px solid var(--rule-strong); border-radius: var(--radius-md); background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color var(--dur-2) var(--ease-standard), background-color var(--dur-2) var(--ease-standard); }
.tt-suspect:hover { border-color: var(--accent); }
.tt-suspect:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tt-suspect.is-picked { border-color: var(--accent); background: var(--accent-soft); }
.tt-suspect[aria-disabled="true"] { cursor: default; }
.tt-suspect[aria-disabled="true"]:hover { border-color: var(--rule-strong); }
.tt-suspect.is-answer, .tt-suspect.is-answer:hover { border-color: var(--good); background: var(--good-soft); }
.tt-suspect.is-wrong, .tt-suspect.is-wrong:hover { border-color: var(--danger); background: var(--danger-soft); }
.tt-suspect-name { font-weight: 600; }
.tt-mark { grid-column: 2; grid-row: 1; align-self: center; font: 600 var(--text-2xs)/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.tt-suspect-role, .tt-suspect-fact { grid-column: 1 / -1; font-size: var(--text-xs); line-height: 1.45; }
.tt-suspect-role { color: var(--ink-soft); }
.tt-suspect-fact { margin-top: 2px; color: var(--ink); }
.tt-accuse { width: 100%; margin-top: var(--space-3); min-height: 44px; }
.tt-accuse[hidden], .tt-once[hidden] { display: none; }
.tt-once { margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--ink-faint); }

/* ------------------------------------------------------------ the result */

.tt-result { margin: var(--space-8) 0 0; padding: var(--space-6) 0 0; border-top: 1px solid var(--rule-strong); animation: os-fade-in var(--dur-4) var(--ease-standard) backwards; }
.tt-result[hidden] { display: none; }
.tt-verdict { margin: 0 0 var(--space-1); font-size: var(--text-lg); font-weight: 650; }
.tt-verdict:focus { outline: none; }
.tt-squares { margin: 0 0 var(--space-3); font: var(--text-lg)/1 var(--font-mono); letter-spacing: .2em; color: var(--ink-soft); }
.tt-result.is-won .tt-squares { color: var(--good); }
.tt-reveal { max-width: var(--measure); margin: 0; font-size: var(--text-md); line-height: var(--leading-prose); }
.tt-result .action-row { margin-top: var(--space-4); }
.tt-result .action-row button { min-height: 44px; }
.tt-share-text { display: block; width: 100%; max-width: var(--measure); margin: var(--space-3) 0 0; padding: var(--space-2); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--paper-inset); color: var(--ink); font: var(--text-xs)/1.5 var(--font-mono); resize: none; }
.tt-share-text[hidden] { display: none; }
.tt-said { min-height: 1.4em; margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--ink-soft); }
.tt-tool-say a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.tt-tool-say, .tt-next { max-width: var(--measure); margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--ink-soft); }

/* ------------------------------------------------------------ results so far */

.tt-stats { margin: var(--space-8) 0 0; padding: var(--space-6) 0 0; border-top: 1px solid var(--rule); }
.tt-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); max-width: 520px; margin: 0 0 var(--space-4); }
.tt-figs div { display: flex; flex-direction: column-reverse; gap: 2px; }
.tt-figs dt { font-size: var(--text-xs); color: var(--ink-soft); }
.tt-figs dd { margin: 0; font-size: var(--text-xl); font-weight: 650; font-variant-numeric: tabular-nums; }
.tt-bars-head { margin: 0 0 var(--space-2); font-size: var(--text-xs); color: var(--ink-soft); }
.tt-bars { display: flex; flex-direction: column; gap: 4px; max-width: 520px; }
.tt-bar { display: grid; grid-template-columns: 1.5ch minmax(0, 1fr) 3ch; align-items: center; gap: var(--space-2); font: var(--text-xs)/1.6 var(--font-mono); font-variant-numeric: tabular-nums; }
.tt-bar-track { height: 10px; border-radius: var(--radius-sm); background: var(--paper-inset); overflow: hidden; }
.tt-bar-fill { display: block; height: 100%; background: var(--ink-faint); }
.tt-bar.is-mine .tt-bar-fill { background: var(--accent); }
.tt-bar-v { text-align: right; color: var(--ink-soft); }

/* ------------------------------------------------------------ narrow */

@media (max-width: 820px) {
  .tt { padding: var(--space-4); }
  .tt-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .tt-page { padding: var(--space-3) var(--space-4); }
}
@media (max-width: 480px) {
  .tt { padding: var(--space-3); }
  .tt-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tt-fields { grid-template-columns: minmax(0, 1fr); }
  .tt-field dt { padding-bottom: 0; }
  .tt-field dd { padding: 0 0 4px var(--space-2); }
}
@media print {
  .tt-nav, .tt-deeper, .tt-accuse, .tt-once, .tt-result .action-row, .tt-stats { display: none !important; }
}
