/* Your First Sale: a month of a small shop, played on the page. Load after lab.css and /lab/due-by-3/day.css,
   which hold the shared frame (the bar, messages, buttons, the note). Nothing here hides the readable version:
   every rule that hides anything sits under html.day-on, which sale.js adds only after it has loaded. */

/* ── The readable version ────────────────────────────────── */
.sale-ai { background: var(--day-panel); color: var(--day-ai-ink); border-radius: 14px; padding: 14px 16px 6px; margin: 0 0 18px; font-size: 15.5px; line-height: 1.5; }
.sale-ai p, .sale-ai li { color: var(--day-ai-ink); }
.sale-ai h3 { font-family: var(--tt-font-display); font-size: 17px; font-weight: 700; color: #fff; margin: 16px 0 8px; }
.sale-ai strong { color: #fff; }
.sale-ai ul { margin: 0 0 12px; padding-left: 20px; }
.sale-ai li { margin-bottom: 6px; }
.sale-ai table { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 14.5px; }
.sale-ai th, .sale-ai td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.14); }
.sale-ai td:last-child, .sale-ai th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sale-ai thead th { color: var(--day-ai-soft); font-size: 13px; }

.sale-doc { background: #fff; border: 1px solid var(--tt-line-strong); border-radius: 10px; padding: 4px 14px 2px; margin: 0 0 18px; box-shadow: 0 2px 8px rgba(12,35,80,.05); }
.sale-doc table { width: 100%; border-collapse: collapse; margin: 8px 0 10px; font-size: 15px; }
.sale-doc th, .sale-doc td { text-align: left; vertical-align: top; padding: 7px 6px; border-bottom: 1px solid var(--tt-line); }
.sale-doc thead th { font-size: 12.5px; color: var(--tt-ink-muted); text-transform: uppercase; letter-spacing: .4px; }
.sale-doc td:last-child, .sale-doc th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.sale-doc tfoot th { border-bottom: 0; border-top: 2px solid var(--tt-navy-deep); color: var(--tt-navy-deep); }
.sale-fee-doc td:last-child, .sale-fee-doc th:last-child { text-align: left; }
.sale-zones td:nth-child(3), .sale-zones th:nth-child(3) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sale-doc-note { font-size: 14.5px; line-height: 1.5; color: var(--tt-ink-soft); margin: 0 0 12px; }
.sale-doc ul { margin: 12px 0; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.sale-doc li { margin-bottom: 9px; }
.sale-sub { font-family: var(--tt-font-display); font-size: 19px; font-weight: 700; color: var(--tt-navy-deep); margin: 22px 0 8px; }
.sale-runs { display: grid; gap: 8px; margin: 16px 0; }
.sale-runs > div { display: flex; gap: 12px; align-items: baseline; background: #fff; border: 1px solid var(--tt-line); border-radius: 10px; padding: 10px 12px; }
.sale-runs b { flex: none; min-width: 64px; font-family: var(--tt-font-display); font-size: 21px; color: var(--tt-navy-deep); }
.sale-runs span { font-size: 15px; line-height: 1.4; }

/* ── Faces ───────────────────────────────────────────────── */
.day-face.is-noa { background: #0d7a6f; }
.day-face.is-parent { background: #6b4bb0; }
.day-face.is-buyer { background: #a8450b; }
.day-face.is-sam { background: #7a5a12; }

/* ── The bar ─────────────────────────────────────────────── */
.sale-bar .day-clock { font-size: 14px; }
.sale-count { color: var(--tt-ice); font-weight: 600; }

/* ── Your desk ───────────────────────────────────────────── */
.day-scene.is-desk { background: var(--tt-surface-2); }
.sale-tabs { grid-template-columns: repeat(3, 1fr); }
.sale-tabs .day-tab { font-size: 13.5px; min-height: 42px; padding: 4px 6px; line-height: 1.2; }
.sale-panel { padding-top: 10px; }
.sale-panel .sale-ai, .sale-panel .sale-doc { margin-bottom: 12px; }
.sale-form { background: #fff; border: 1px solid var(--tt-line-strong); border-radius: 12px; padding: 12px 14px 4px; }
.sale-field { display: block; border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.sale-field-name { display: block; font-family: var(--tt-font-display); font-weight: 700; font-size: 15px; color: var(--tt-navy-deep); margin: 0 0 7px; padding: 0; }
.sale-money { display: inline-flex; align-items: center; gap: 4px; font-family: var(--tt-font-display); font-size: 20px; font-weight: 700; color: var(--tt-navy-deep); }
.sale-money input { width: 7.5em; font: inherit; font-size: 20px; padding: 8px 10px; border: 2px solid var(--tt-line-strong); border-radius: 10px; background: #fff; color: var(--lab-ink); min-height: 46px; transition: border-color .15s, box-shadow .15s; }
.sale-money input:hover { border-color: var(--tt-blue); }
.sale-money input:focus { outline: none; border-color: var(--tt-navy); box-shadow: 0 0 0 3px rgba(0,167,184,.28); }
.sale-money.is-small { font-size: 16px; margin-left: 4px; }
.sale-money.is-small input { width: 5.5em; font-size: 16px; min-height: 40px; padding: 6px 8px; }
.sale-radio, .sale-check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 10px; margin: 0 0 6px; border: 1.5px solid var(--tt-line-strong); border-radius: 10px; font-size: 15px; line-height: 1.35; color: var(--lab-ink); cursor: pointer; transition: border-color .15s, background .15s; }
.sale-radio:hover, .sale-check:hover { border-color: var(--tt-navy); }
.sale-radio:has(input:checked), .sale-check:has(input:checked) { border-color: var(--tt-navy); background: #eef3fb; }
.sale-radio > span:first-of-type, .sale-check > span { flex: 1 1 60%; }
.sale-radio input, .sale-check input { width: 20px; height: 20px; accent-color: var(--tt-navy); margin: 0; flex: none; }
.sale-check { margin-bottom: 10px; }
.sale-err { min-height: 1.3em; margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--lab-wrong); }

/* The calculator stays under the tabs, whichever one is open */
.sale-calc { margin: 0 12px 10px; background: var(--day-panel); border-radius: 12px; padding: 9px 12px; color: var(--day-ai-ink); }
.sale-calc-row { display: flex; align-items: center; gap: 10px; }
.sale-calc-name { flex: none; font-family: var(--tt-font-display); font-weight: 700; font-size: 14px; color: var(--tt-ice); }
.sale-calc input { flex: 1; min-width: 0; font-family: var(--lab-mono); font-size: 16px; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: var(--day-panel-2); color: #fff; min-height: 42px; }
.sale-calc input::placeholder { color: #9fb3d6; }
.sale-calc input:focus { outline: 2px solid var(--tt-cyan); outline-offset: 1px; }
.sale-calc-out { display: block; min-height: 1.4em; margin-top: 5px; font-family: var(--lab-mono); font-size: 18px; font-weight: 700; color: #fff; text-align: right; }

/* ── Noa's question ──────────────────────────────────────── */
.sale-answer { display: flex; gap: 8px; align-items: center; }
.sale-answer .sale-money input { width: 100%; }
.sale-answer .sale-money { flex: 1; }
.sale-answer .day-btn { flex: none; }
.sale-break { align-self: stretch; list-style: none; background: #fff; border: 1px solid var(--tt-line-strong); border-radius: 12px; padding: 6px 12px; animation: dayIn .25s ease; }
.sale-break table, .sale-statement table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.sale-break td, .sale-break th, .sale-statement td, .sale-statement th { text-align: left; padding: 6px 2px; border-bottom: 1px solid var(--tt-line); }
.sale-break td:last-child, .sale-break th:last-child, .sale-statement td:last-child, .sale-statement th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sale-break .is-total th, .sale-statement .is-total th { border-bottom: 0; border-top: 2px solid var(--tt-navy-deep); color: var(--tt-navy-deep); font-size: 15.5px; }

/* ── The weeks ───────────────────────────────────────────── */
.day-scene.is-week { background: var(--tt-surface-2); min-height: min(calc(100svh - 190px), 620px); }
.sale-feed { list-style: none; margin: 0; padding: 14px 12px 0; display: grid; gap: 7px; }
.sale-feed-item { background: #fff; border: 1px solid var(--tt-line); border-left: 4px solid var(--tt-line-strong); border-radius: 10px; padding: 9px 12px; font-size: 15px; line-height: 1.42; color: var(--lab-ink); animation: dayIn .22s ease; }
.sale-feed-item.is-sale { border-left-color: #0d7a6f; }
.sale-feed-item.is-money { border-left-color: var(--tt-blue); }
.sale-feed-item.is-stock { border-left-color: #7a5a12; }
.sale-feed-item.is-quiet { color: var(--tt-ink-soft); font-size: 14px; }
.is-week .day-thread { padding-top: 10px; }
.day-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* ── The statement ───────────────────────────────────────── */
.day-scene.is-statement { background: var(--tt-surface-2); }
.sale-statement .sale-after { margin-top: 14px; }
.sale-statement-note { margin: 10px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--tt-ink-soft); }
.sale-behind { margin: 0 12px 14px; background: #fff; border: 1px solid var(--tt-line-strong); border-radius: 10px; padding: 0 12px; }
.sale-behind summary { cursor: pointer; padding: 12px 0; font-family: var(--tt-font-display); font-weight: 700; font-size: 15px; color: var(--tt-navy); min-height: 44px; }
.sale-behind summary:hover { color: #0b2d78; }
.sale-behind p { margin: 0 0 8px; font-size: 14px; color: var(--tt-ink-soft); }
.sale-behind table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 12px; }
.sale-behind th, .sale-behind td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--tt-line); vertical-align: top; }
.sale-behind th { font-size: 12px; color: var(--tt-ink-muted); }

@media (min-width: 700px) {
  .sale-calc { margin: 0 18px 12px; }
  .sale-feed { padding: 18px 18px 0; }
  .sale-behind { margin: 0 18px 16px; }
  .sale-tabs .day-tab { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .sale-feed-item, .sale-break { animation: none; }
}
