/* Time Group Checker (/time-groups).
   Page-scoped: every rule sits under .tgp so the tool's generic class names
   (.card, .panel, .chip, .tag, .menu ...) can't leak into the rest of the site,
   and the site's .wrap / .eyebrow / footer rules only reach it where intended.
   Styles came from the reviewed standalone draft; changes from it are marked "site:". */
/* Single-theme on purpose: mirrors the Call Flow Studio website, which is dark-only. */
.tgp {
  --bg: #1a1e27; --bg-deep: #15181f; --panel: #1e2331; --raised: #232834; --hover: #2b3240;
  --line: #2d3444; --line-bright: #3c4558;
  --ink: #e8ebf2; --dim: #a0a8b8; --mute: #6a7285; --faint: #4a5162;
  --cable: #5ba3f5; --signal: #ff5a1f; --ok: #4caf82; --err: #e57373;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
/* site: body, padding and .wrap come from the site shell. */
.tgp { font-size: 15px; line-height: 1.55; padding-bottom: 64px; }

.tgp header.intro { padding-block: 48px 28px; display: grid; gap: 14px; max-width: 760px; }
.tgp h1 { font-family: var(--serif); font-weight: 650; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
.tgp h1 em { font-style: normal; color: var(--signal); }
.tgp .lede { color: var(--dim); font-size: 17px; margin: 0; max-width: 64ch; }

.tgp .chip { font: 500 13px var(--sans); color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.tgp .chip:hover { background: var(--hover); border-color: var(--line-bright); }
.tgp .chip[aria-pressed="true"] { border-color: var(--cable); background: rgba(91,163,245,.12); }
.tgp .chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--err); flex: none; }
.tgp .chip .dot.ok { background: var(--ok); }
.tgp button:focus-visible, .tgp select:focus-visible { outline: 2px solid var(--cable); outline-offset: 2px; }

.tgp .tool { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 880px) { .tgp .tool { grid-template-columns: minmax(0, 1fr); } }

/* One form for both PBXes: FreePBX and VitalPBX ask for the same start and finish pickers. */
.tgp .form { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; gap: 16px; }
.tgp .form h2, .tgp .results h2 { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 0; }
.tgp .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tgp .fields .col { display: grid; gap: 12px; align-content: start; min-width: 0; }
.tgp .fields .col > h3 { font: 600 13px var(--sans); color: var(--ink); margin: 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.tgp .field { display: grid; gap: 6px; }
.tgp .field > span { font-size: 13px; color: var(--dim); }
.tgp .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tgp .pair.time { grid-template-columns: 1fr 1fr; }
.tgp .hm { display: flex; gap: 4px; }
.tgp select { appearance: none; width: 100%; font: 400 14px var(--mono); color: var(--ink); background: var(--bg-deep); border: 1px solid var(--line); border-radius: 6px; padding: 7px 26px 7px 9px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 8px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.tgp select:hover { border-color: var(--line-bright); }
.tgp .entry-list { display: grid; gap: 6px; }
.tgp .entry-row { display: flex; gap: 6px; align-items: stretch; }
.tgp .entry-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; cursor: pointer; color: var(--dim); }
.tgp .entry-pick:hover { border-color: var(--line-bright); }
.tgp .entry-row.on .entry-pick { border-color: var(--cable); color: var(--cable); }
.tgp .entry-pick code { font: 600 13.5px var(--mono); overflow-x: auto; white-space: nowrap; }
.tgp .entry-n { font: 600 11px var(--mono); color: var(--mute); min-width: 14px; }
.tgp .entry-rm { flex: none; width: 32px; font: 500 16px var(--sans); color: var(--mute); background: transparent; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.tgp .entry-rm:hover { color: var(--err); border-color: var(--err); }
.tgp .entry-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tgp .add-entry { justify-self: start; font: 500 13px var(--sans); color: var(--cable); background: transparent; border: 1px dashed var(--line-bright); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.tgp .copied { font-size: 12px; color: var(--ok); }
.tgp .add-entry:hover { border-color: var(--cable); background: rgba(91,163,245,.08); }
.tgp .scope { font: 600 11px var(--mono); color: var(--ink); background: var(--raised); border-radius: 3px; padding: 1px 5px; margin-right: 2px; }
.tgp .fix { display: inline-block; margin-top: 6px; font: 600 12.5px var(--sans); color: #0f1420; background: var(--cable); border: 0; border-radius: 5px; padding: 4px 10px; cursor: pointer; }
.tgp .fix:hover { filter: brightness(1.1); }

.tgp .results { display: grid; gap: 18px; min-width: 0; }
.tgp .verdict { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; display: grid; gap: 12px; }
.tgp .headline { font-family: var(--serif); font-size: 24px; font-weight: 500; line-height: 1.25; margin: 0; text-wrap: balance; }
.tgp .headline b { font-weight: 650; }
.tgp .notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tgp .notes li { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: baseline; font-size: 14.5px; color: var(--dim); max-width: 78ch; }
.tgp .notes li strong { color: var(--ink); font-weight: 600; }
.tgp .tag { font: 600 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; border-radius: 4px; padding: 2px 6px; text-align: center; }
.tgp .tag.trap { color: #1a1e27; background: var(--err); }
.tgp .tag.works { color: #1a1e27; background: var(--ok); }
.tgp .tag.note { color: var(--dim); background: var(--raised); border: 1px solid var(--line); }

.tgp .card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: grid; gap: 14px; min-width: 0; }
.tgp .card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 18px; align-items: center; }
.tgp .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--dim); }
.tgp .legend span { display: inline-flex; align-items: center; gap: 7px; }
.tgp .sw { width: 13px; height: 13px; border-radius: 3px; display: inline-block; flex: none; }
.tgp .yearsel { display: flex; gap: 4px; }
.tgp .yearsel button { font: 500 12px var(--mono); color: var(--dim); background: transparent; border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px; cursor: pointer; }
.tgp .yearsel button[aria-pressed="true"] { color: var(--ink); border-color: var(--cable); }

.tgp .months { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px 18px; }
.tgp .month h3 { font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin: 0 0 6px; }
.tgp .month.inactive h3 { color: var(--faint); }
.tgp .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.tgp .dow { font: 400 10px var(--mono); color: var(--faint); text-align: center; padding-bottom: 2px; }
.tgp .d { font: 400 11px var(--mono); font-variant-numeric: tabular-nums; text-align: center; line-height: 21px; border-radius: 3px; color: var(--mute); }
.tgp .d.hit { background: var(--cable); color: #0f1420; font-weight: 600; }
.tgp .d.extra { color: #1a1e27; font-weight: 600;
  background: repeating-linear-gradient(135deg, var(--err) 0 4px, #c95858 4px 7px); }
.tgp .d.missed { color: var(--signal); box-shadow: inset 0 0 0 1.5px var(--signal); font-weight: 600; }

.tgp .sw.hit { background: var(--cable); }
.tgp .sw.extra { background: repeating-linear-gradient(135deg, var(--err) 0 3px, #c95858 3px 5px); }
.tgp .sw.missed { box-shadow: inset 0 0 0 1.5px var(--signal); }
.tgp .sw.hour { background: var(--ok); }

.tgp .weekscroll { overflow-x: auto; }
.tgp .week { display: grid; grid-template-columns: 40px repeat(24, minmax(16px, 1fr)); gap: 2px; min-width: 460px; }
.tgp .week .rl { font: 400 11px var(--mono); color: var(--dim); align-self: center; }
.tgp .week .h { height: 18px; border-radius: 2px; background: var(--bg-deep); position: relative; overflow: hidden; }
.tgp .week .h i { position: absolute; top: 0; bottom: 0; background: var(--ok); }
.tgp .week .tick { font: 400 10px var(--mono); color: var(--faint); }
.tgp .fine { font-size: 12.5px; color: var(--mute); margin: 0; max-width: 80ch; }

.tgp .holidays { margin-top: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; display: grid; gap: 12px; }
.tgp .hol-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; }
.tgp .hol-head h2 { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 0; }
.tgp .hol-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.tgp .hol-region { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); }
.tgp .hol-region select { width: auto; min-width: 0; max-width: 100%; }
.tgp .hol-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--dim); cursor: pointer; }
.tgp .hol-lede { margin: 0; color: var(--dim); font-size: 14px; max-width: 80ch; }
.tgp .hol-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 6px 14px; }
.tgp .hol-item { display: grid; grid-template-columns: 18px 1fr; gap: 4px 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-deep); cursor: pointer; }
.tgp .hol-item.on { border-color: var(--cable); }
.tgp .hol-item.easter { cursor: default; opacity: .6; }
.tgp .hol-item input { margin: 3px 0 0; accent-color: var(--cable); }
.tgp .hol-name { font-size: 14px; color: var(--ink); font-weight: 500; }
.tgp .hol-when { font-size: 12.5px; color: var(--dim); }
.tgp .hol-flag { font: 600 10px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--mute); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: 6px; }
.tgp .hol-codes { grid-column: 2; font: 12px var(--mono); color: var(--cable); overflow-wrap: anywhere; }
.tgp .hol-codes .sub { color: var(--mute); }
.tgp .hol-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tgp .hol-actions .fix { margin-top: 0; }
.tgp .hol-spacer { flex: 1; }
.tgp .beyond-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.tgp .learn .beyond-grid article { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: grid; gap: 8px; align-content: start; }
.tgp .learn .beyond-grid article .tag { justify-self: start; }
.tgp .learn .beyond-grid p { margin: 0; color: var(--dim); font-size: 14px; }
.tgp .learn .beyond-grid p strong { color: var(--ink); font-weight: 600; }
.tgp .proof { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 8px; color: var(--mute); font-size: 13px; }
.tgp .proof code { font-family: var(--mono); color: var(--dim); }
.tgp .cta { color: var(--dim); font-size: 14px; }
.tgp .cta a { color: var(--cable); }

/* ---- workbench layout ---- */
.tgp header.intro { padding-block: 28px 20px; gap: 10px; max-width: none; }
.tgp header.intro h1 { font-size: clamp(26px, 3.4vw, 38px); max-width: 26ch; }
.tgp header.intro .lede { font-size: 16px; }
.tgp .topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
body.from-link .tgp header.intro h1, body.from-link .tgp header.intro .lede { display: none; }
.tgp .arrival { margin: 0; font-size: 15px; color: var(--ink); background: rgba(91,163,245,.1); border: 1px solid rgba(91,163,245,.35); border-radius: 8px; padding: 10px 14px; }
.tgp .menu-wrap { position: relative; }
.tgp .menu-btn { font: 600 13px var(--sans); color: var(--ink); background: var(--raised); border: 1px solid var(--line-bright); border-radius: 6px; padding: 7px 12px; cursor: pointer; }
.tgp .menu-btn:hover { background: var(--hover); }
.tgp .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(560px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line-bright); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.45); padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .tgp .menu { grid-template-columns: 1fr; } }
.tgp .menu-title { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-bottom: 6px; }
.tgp .menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: 400 13.5px var(--sans); color: var(--ink); background: transparent; border: 0; border-radius: 5px; padding: 6px 8px; cursor: pointer; }
.tgp .menu-item:hover, .tgp .menu-item:focus-visible { background: var(--hover); }
.tgp .menu-item .dot, .tgp .chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--err); flex: none; }
.tgp .menu-item .dot.ok { background: var(--ok); }

.tgp .tool { grid-template-columns: 370px minmax(0, 1fr); }
.tgp .side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.tgp .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 12px; }
.tgp .panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tgp .panel-head h2 { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 0; }
.tgp .count { color: var(--dim); }
.tgp .link-btn { font: 500 12.5px var(--sans); color: var(--dim); background: transparent; border: 0; padding: 2px 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tgp .link-btn:hover { color: var(--ink); }
.tgp .entries-panel .entry-list { max-height: 330px; overflow-y: auto; padding-right: 2px; }
.tgp .copy-btn { font: 600 14px var(--sans); color: #0f1420; background: var(--cable); border: 0; border-radius: 7px; padding: 10px 14px; cursor: pointer; }
.tgp .copy-btn:hover { filter: brightness(1.08); }
.tgp .entries-panel .copied { min-height: 1em; margin-top: -6px; }
.tgp .example-note { margin: 0; font-size: 13px; color: var(--dim); background: var(--bg-deep); border: 1px dashed var(--line-bright); border-radius: 6px; padding: 8px 10px; }
.tgp .example-note strong { color: var(--ink); font-weight: 600; }
.tgp .small { margin: 0; font-size: 12.5px; color: var(--mute); }
.tgp .paste-panel { display: grid; gap: 8px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.tgp .paste-hint { font-size: 12.5px; color: var(--dim); }
.tgp .paste-hint code { font: 12px var(--mono); color: var(--cable); }
.tgp .paste-panel textarea { width: 100%; box-sizing: border-box; resize: vertical; font: 13px var(--mono); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.tgp .paste-err { font-size: 12.5px; color: var(--err); display: grid; gap: 2px; }
.tgp .paste-err:empty { display: none; }
.tgp .paste-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.tgp .form { gap: 14px; }

.tgp .dialog-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(8,10,14,.66); display: flex; align-items: flex-start; justify-content: center; padding: calc(24px + env(safe-area-inset-top, 0px)) 16px 24px; overflow-y: auto; }
.tgp .dialog-backdrop[hidden] { display: none; }
.tgp .dialog.holidays { margin-top: 0; width: min(1000px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.5); }

.tgp .learn { margin-top: 36px; display: grid; gap: 14px; }
.tgp .learn > h2 { font-family: var(--serif); font-weight: 650; font-size: 26px; margin: 0; }
.tgp .learn h3 { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 0 0 6px; }
.tgp .learn-examples { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
@media (max-width: 760px) { .tgp .learn-examples { grid-template-columns: 1fr; } }
.tgp .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tgp .beyond-title { margin-top: 10px !important; }
.tgp .beyond-grid article h4 { font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.25; margin: 0; text-wrap: balance; }

/* site: the sticky nav would cover the tool when an example chip scrolls to it. */
.tgp .tool { scroll-margin-top: 84px; }
/* site: .eyebrow keeps the site's look; this lets it sit in the flex topline. */
.tgp .topline .eyebrow { flex-wrap: wrap; }

/* site: search-phrased questions under the tool. The accordion look is the site's
   global details/summary/.faq-toggle styles, same as /faq. */
.tgp .tg-faq { margin-top: 36px; }
.tgp .tg-faq > h2 { font-family: var(--serif); font-weight: 650; font-size: 26px; margin: 0; }
.tgp .tg-faq .faq { margin-top: 14px; }
.tgp .tg-faq summary { font-size: 18px; }
.tgp .tg-faq details p { font-size: 15px; }

/* The tool shows and hides panels with the hidden attribute (menu, paste box, dialog, notes). Any
   component rule that sets display (.menu is a grid, .paste-panel too) would otherwise override it and
   leave the panel stuck open. Last in the file on purpose, so it wins on order as well as !important. */
.tgp [hidden] { display: none !important; }
