/* Tool deep dive (getplace-style). Builds on the tokens in styles.css. */

.t-page { background: var(--t-bg); color: var(--t-ink); font-family: var(--font-tool); }
.t-page a { color: var(--accent); }
.t-page a:hover { color: var(--accent-ink); }

.t-shell { min-height: 100vh; display: grid; grid-template-columns: auto minmax(0, 1fr); }

/* Sidebar */
.t-side {
  width: 248px; background: #fff; border-right: 1px solid var(--t-line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 24px;
}
.t-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; font-weight: 700; font-size: 15px; }
.t-brand__mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.t-nav { display: flex; flex-direction: column; font-size: 14px; }
.t-nav ul { display: flex; flex-direction: column; gap: 2px; }
.t-nav__group { padding: 6px 10px; font-size: 11px; font-weight: 600; color: var(--t-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.t-nav ul + .t-nav__group { padding-top: 16px; }
.t-nav__item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 6px; color: var(--t-ink-2); }
.t-nav__icon { display: inline-flex; }
.t-page .t-nav__item.is-current { background: var(--t-blue-soft); color: var(--accent-ink); font-weight: 600; } /* 5.9:1 */
.t-nav__item.is-off { cursor: not-allowed; color: #8a979c; }
.t-nav__item.is-off .t-nav__icon { opacity: 0.6; }
.t-nav__tag {
  margin-left: auto; padding: 2px 7px; border-radius: 999px;
  background: #eceef2; color: var(--t-ink-2);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.t-note { border: 1px solid var(--t-line); border-radius: 8px; padding: 14px; font-size: 13px; color: var(--t-ink-2); line-height: 1.5; background: #fff; }
.t-side .t-note { margin-top: auto; }
.t-note--mobile { display: none; }

/* Top bar */
.t-main-col { display: flex; flex-direction: column; min-width: 0; }
.t-top {
  min-height: 64px; background: #fff; border-bottom: 1px solid var(--t-line);
  padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.t-crumbs ol { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--t-muted); }
.t-crumbs li + li::before { content: "/"; margin-right: 8px; }
.t-crumbs [aria-current] { color: var(--t-ink); font-weight: 600; }
.t-top__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.t-amber { padding: 5px 10px; border-radius: 999px; background: #FFF4DE; color: #7A4B00; font-size: 12px; font-weight: 600; white-space: nowrap; }
.t-btn {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px;
  font: 500 14px var(--font-tool); cursor: pointer; white-space: nowrap;
}
.t-btn--ghost { border: 1px solid var(--t-line-2); background: #fff; color: var(--t-ink); }
.t-btn--ghost:hover { border-color: var(--accent); }
.t-page .t-btn--blue { background: var(--accent); color: #fff; font-weight: 600; border: 0; }
.t-page .t-btn--blue:hover { background: var(--accent-ink); color: #fff; }

/* Content */
.t-content { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; }
.t-titlebar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.t-titlebar__text { display: flex; flex-direction: column; gap: 4px; }
.t-h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.t-sub { font-size: 14px; color: var(--t-ink-2); }
.t-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.t-filter-label { font-size: 13px; color: var(--t-muted); }
.t-select--lg { height: 36px; border-radius: 4px; font-size: 14px; }
.t-chip { height: 36px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--t-line-2); background: #fff; font-size: 14px; display: inline-flex; align-items: center; }

.t-seg { display: flex; gap: 4px; padding: 4px; background: #eceef2; border-radius: 999px; align-self: flex-start; flex-wrap: wrap; }
.t-seg__btn {
  height: 36px; padding: 0 18px; border-radius: 999px; border: 0; background: transparent;
  color: var(--t-ink-2); font: 600 14px var(--font-tool); cursor: pointer;
}
.t-seg__btn:hover { color: var(--t-ink); }
.t-seg__btn[aria-pressed="true"] { background: #fff; color: var(--t-ink); box-shadow: 0 1px 2px rgba(27, 49, 57, 0.15); }

.t-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.t-kpi { background: #fff; border: 1px solid var(--t-line); border-radius: 8px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.t-kpi__label { font-size: 13px; color: var(--t-ink-2); }
.t-kpi__value { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.t-kpi__note { font-size: 12px; font-weight: 600; color: var(--t-muted); }
.t-kpi__sub { margin-top: -4px; font-size: 13px; color: var(--t-ink-2); }

.t-split { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 12px; }
.t-panel { background: #fff; border: 1px solid var(--t-line); border-radius: 8px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.t-h2 { font-size: 15px; font-weight: 600; }
.t-foot { margin-top: auto; font-size: 12px; color: var(--t-muted); line-height: 1.5; }

/* Project story */
.t-story { gap: 18px; padding: 20px 22px; }
.t-story__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; }
.t-story__title { font-size: 12px; font-weight: 600; color: var(--t-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.t-story__client { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 4px; font-size: 18px; font-weight: 700; }
.t-story__client span + span { font-weight: 500; color: var(--t-ink-2); }
.t-story__client span + span::before { content: "·"; margin-right: 8px; }
.t-story__status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.t-live {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 10px; border-radius: 999px;
  background: #E3F5EC; color: var(--t-up); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.t-live i { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.t-story__note { font-size: 14px; font-weight: 600; color: var(--t-ink); }
.t-story__blocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 28px; border-top: 1px solid var(--t-line); padding-top: 16px; }
.t-story__block h3 { margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.t-story__block p { font-size: 14px; line-height: 1.55; color: var(--t-ink-2); }

/* ROI bars */
.t-bars { display: flex; flex-direction: column; gap: 14px; }
.t-bar { display: flex; flex-direction: column; gap: 6px; }
.t-bar__row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.t-bar__track { position: relative; height: 8px; border-radius: 4px; background: #eceef2; }
.t-bar__track::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: var(--even); width: 2px; border-radius: 1px; background: var(--t-ink); opacity: 0.35; }
.t-bar__fill { height: 8px; border-radius: 4px; background: #8fb3c0; }
.t-bar__fill.is-paid { background: var(--accent); }

/* Events table */
.t-panel--table { padding: 0; gap: 0; overflow: hidden; }
.t-panel__head { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--t-line); }
.t-count { font-size: 13px; color: var(--t-muted); }
.t-table-wrap { overflow-x: auto; }
/* Fixed layout: widths come from each table's <colgroup>, so gaps stay even across the panel. */
.t-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; table-layout: fixed; }
.t-table--mid { min-width: 700px; }
.t-table--wide { min-width: 860px; }
.t-table thead tr { background: var(--t-bg); color: var(--t-ink-2); }
.t-table th { padding: 10px 12px; font-weight: 600; font-size: 12px; text-align: left; vertical-align: bottom; }
.t-table td { padding: 12px; border-top: 1px solid #eceef2; text-align: left; }
.t-table th:first-child, .t-table td:first-child { padding-left: 20px; }
/* Text columns left; numeric and badge columns centred, header and values alike. */
.t-table .num, .t-table .ctr { text-align: center; font-variant-numeric: tabular-nums; }
.t-table tfoot th, .t-table tfoot td { padding: 12px; border-top: 1px solid var(--t-line-2); background: var(--t-bg); font-weight: 600; }
.t-table tfoot th:first-child { padding-left: 20px; }
.t-mono { font-family: var(--font-mono); font-size: 13px; }
.t-muted { color: var(--t-ink-2); }
.t-strong { font-weight: 500; }
.t-result { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.t-result.is-paid { background: #E3F5EC; color: var(--t-up); }
.t-result.is-not { background: #FDECEA; color: var(--t-down); }

/* ==========================================================================
   Assortment tool
   ========================================================================== */

.t-nav__item.is-sub { padding-left: 22px; font-size: 13px; height: 34px; }
.t-todo { padding: 0 4px; border-radius: 4px; background: #FFF4DE; color: #7A4B00; font-weight: 600; }
[tabindex="-1"]:focus { outline: none; }

.a-slider { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--t-ink-2); }
.a-slider input { flex: 1 1 100px; min-width: 0; accent-color: var(--accent); height: 24px; cursor: pointer; }
.a-slider output { min-width: 3ch; font-weight: 600; color: var(--t-ink); font-size: 14px; }
.a-help { margin-top: -6px; }

.a-scatter { position: relative; min-height: 260px; }
.a-scatter__frame { position: relative; border-radius: 6px; }
.a-scatter__frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.a-scatter svg { display: block; max-width: none; }
.a-axis { font: 500 10px var(--font-mono); fill: var(--t-muted); }
.a-axis--review { fill: #8A5300; }
.a-axis-title { font: 600 11px var(--font-tool); fill: var(--t-ink-2); }
.a-cut-label {
  position: absolute; transform: translateX(-100%);
  padding: 2px 6px; border-radius: 4px; background: var(--t-ink); color: #fff;
  font-size: 10px; font-weight: 600; white-space: nowrap; pointer-events: none;
}
.a-tip {
  position: absolute; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; gap: 2px; min-width: 190px;
  padding: 10px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--t-line-2);
  box-shadow: 0 8px 24px rgba(27, 49, 57, 0.16); font-size: 12px; color: var(--t-ink-2);
}
.a-tip strong { color: var(--t-ink); font-size: 13px; }
.a-tip .a-badge { align-self: flex-start; margin-top: 4px; }
.a-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--t-ink-2); }
.a-legend span { display: inline-flex; align-items: center; gap: 6px; }
.a-legend__mark { display: inline-flex; }

.a-badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.a-badge--keep { background: var(--t-blue-soft); color: var(--accent-ink); }
.a-badge--review { background: #FFF4DE; color: #7A4B00; }
.a-badge--delist { background: #FDECEA; color: var(--t-down); }
.a-badge--space { background: #fff; color: var(--t-ink); box-shadow: inset 0 0 0 1.5px var(--t-ink); }

.a-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.a-weights { display: flex; flex-direction: column; gap: 16px; }
.a-weights__head { font-weight: 600; }
.a-weights ul { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.a-weights__item { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 3.5ch; align-items: center; gap: 10px; font-size: 13px; color: var(--t-ink-2); }
.a-weights__item .t-mono { text-align: right; color: var(--t-ink); }
.a-weights__bar { height: 6px; border-radius: 3px; background: #eceef2; overflow: hidden; }
.a-weights__bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

.a-shelf-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--t-ink-2); }
.a-number {
  width: 88px; height: 36px; padding: 0 10px; border-radius: 4px; border: 1px solid var(--t-line-2);
  font: 500 14px var(--font-mono); color: var(--t-ink); background: #fff;
}
.a-number:disabled { background: var(--t-bg); color: var(--t-muted); cursor: not-allowed; }
.a-occupancy .t-bar__fill { transition: width 0.15s ease; }
.a-occupancy::after { display: none; }
.t-bar__fill.is-over { background: var(--t-down); }
.a-table-note { padding: 12px 20px 16px; border-top: 1px solid var(--t-line); }

/* ==========================================================================
   Plan simulator
   ========================================================================== */

.pl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.pl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-help { margin-top: -6px; }
/* Calendar: 4 rows (quarters) × 13 weeks; scrolls inside the panel when narrow */
.pl-cal-wrap { overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; }
.pl-cal { display: grid; grid-template-columns: 30px repeat(13, minmax(50px, 1fr)); gap: 4px; min-width: 750px; }
.pl-row { display: contents; }
.pl-q { display: flex; align-items: center; justify-content: center; font: 500 11px var(--font-mono); color: var(--t-ink-2); }
.pl-week {
  width: 100%; height: 54px; padding: 5px 6px; border: 1px solid var(--t-line-2); border-radius: 6px; background: #fff;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 2px;
  font-family: var(--font-tool); color: var(--t-ink); text-align: left; cursor: pointer;
}
.pl-week:hover { border-color: var(--accent); }
.pl-week:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-week__n { font: 500 10px var(--font-mono); color: var(--t-ink-2); }
.pl-week__mech { font-size: 11px; font-weight: 600; line-height: 1.15; }
.pl-week.is-promo { background: var(--t-blue-soft); border-color: #B9CEF3; }
.pl-week.is-start { box-shadow: inset 3px 0 0 var(--accent); }
.pl-week.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.pl-editor { border-top: 1px solid var(--t-line); padding-top: 14px; }
.pl-form { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; }
.pl-form__title { flex-basis: 100%; font-size: 14px; font-weight: 600; }
.pl-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--t-ink-2); }
.pl-field .t-select { min-width: 140px; }
.pl-form__buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-remove { color: var(--t-down); }
.pl-how__text { display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.55; color: var(--t-ink-2); max-width: 900px; }

@media (max-width: 900px) {
  .t-shell { grid-template-columns: minmax(0, 1fr); }
  .t-side { display: none; }
  .t-note--mobile { display: block; }
  .t-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-split { grid-template-columns: minmax(0, 1fr); }
  .t-story__blocks { grid-template-columns: minmax(0, 1fr); }
  .t-top { padding: 12px 16px; flex-wrap: wrap; }
  .t-content { padding: 16px; }
}

@media (max-width: 520px) {
  .t-story__client span:first-child { flex-basis: 100%; }
  .t-story__client span:nth-child(2)::before { content: none; }
  .t-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-self: stretch; }
  .t-seg__btn { padding: 0 4px; font-size: 13px; }
}

@media (max-width: 420px) {
  .t-kpi { padding: 12px 14px; }
  .t-kpi__value { font-size: 22px; }
  .t-top__actions { gap: 8px; }
}
.t-crumbs a { color: var(--t-ink-2); text-decoration: underline; text-underline-offset: 3px; }
.t-crumbs a:hover { color: var(--accent-ink); }
