/* Riff calendar demo (calendar.html). Tokens come from site.css; see docs/customer-journey.md section 10-11. */
/* Prototype for design section 10 (docs/customer-journey.md). Tokens copied from
   assets/css/site.css so the page stands alone on the docs hub; the real page
   would link site.css instead. Blocks live only in this page: no cal-provider. */
/* site.css sets body text to --ink (each section picks its own); this page sits on ink, so its text is chalk. */
.rcal-page { color: var(--chalk); max-width: 1180px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 96px max(16px, env(safe-area-inset-left)); }
.rcal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rcal-top h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; font-size: clamp(1.4rem, 5vw, 2.1rem); margin: 0; line-height: 1.1; }
.rcal-top .biz { color: var(--chalk-2); font-size: var(--t-sm); margin: 2px 0 0; }
.badge { background: var(--brass); color: var(--brass-ink); border-radius: var(--r-pill); font-size: .62rem;
  font-weight: 700; letter-spacing: .1em; padding: .25rem .55rem; white-space: nowrap; }
.hint { color: var(--chalk-2); font-size: var(--t-sm); margin: 0 0 12px; max-width: 60ch; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; padding: 0; list-style: none; font-size: var(--t-xs); color: var(--chalk-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sw.job { background: var(--brass); }
.sw.block { background: var(--block); }
.sw.open { background: #1F424F /* verdigris 22% over ink-2 */; border: 1px dashed var(--verdigris); }
.sw.closed { background: #0A1422; border: 1px solid var(--line-ink); }

.steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.steps li { background: var(--ink-2); border: 1px solid var(--line-ink); border-radius: 12px; padding: 10px 12px; font-size: var(--t-xs); color: var(--chalk-2); display: flex; gap: 8px; align-items: flex-start; transition: border-color .3s, background .3s; }
.steps .dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--slate); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--chalk-2); }
.steps li.now { border-color: var(--brass); color: var(--chalk); }
.steps li.now .dot { border-color: var(--brass); color: var(--brass); }
.steps li.done { background: #1D3A4A /* verdigris 16% over ink-2 */; border-color: var(--verdigris); color: var(--chalk); }
.steps li.done .dot { background: var(--verdigris); border-color: var(--verdigris); color: var(--ink); }
.steps li.pop { animation: pop .45s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }
.examplebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--brass) 12%, var(--ink-2)); border: 1px solid color-mix(in srgb, var(--brass) 45%, transparent);
  border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; font-size: var(--t-sm); }
.examplebar .btn { flex: 0 0 auto; min-height: 44px; }
.rif-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip[aria-pressed="true"] { background: var(--verdigris); border-color: var(--verdigris); color: var(--ink); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.rif { background: var(--ink-2); border: 1px solid color-mix(in srgb, var(--brass) 45%, transparent); border-radius: var(--r-card); padding: 12px; margin: 0 0 12px; }
.rif-log { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; margin-bottom: 10px; }
.msg { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-sm); }
.msg .who { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; font-family: var(--font-display); }
.msg.riff .who { background: var(--brass); color: var(--brass-ink); }
.msg.me { flex-direction: row-reverse; }
.msg.me .who { background: var(--ink-3); color: var(--chalk-2); }
.msg .text { background: var(--ink-3); border-radius: 12px; padding: 8px 11px; max-width: 85%; }
.msg.riff .text { background: color-mix(in srgb, var(--brass) 14%, var(--ink-3)); }
.msg.new .text { animation: pop .35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { background: transparent; color: var(--chalk); border: 1.5px solid rgba(233, 238, 243, 0.35); border-radius: var(--r-pill); min-height: 40px; padding: 0 14px; font-weight: 600; font-size: var(--t-sm); cursor: pointer; }
.chip.primary { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); }
.say { display: flex; gap: 8px; }
.say input { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--chalk); background: var(--ink); border: 1px solid var(--line-ink); border-radius: var(--r-pill); padding: 10px 14px; }
.say button { flex: none; min-height: 44px; }
@media (prefers-reduced-motion: reduce) { .msg.new .text { animation: none; } }
.types { background: var(--ink-2); border: 1px solid var(--line-ink); border-radius: var(--r-card); padding: 10px 12px; margin: 0 0 12px; }
.types h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--t-base); margin: 0 0 2px; }
.types p { color: var(--chalk-2); font-size: var(--t-xs); margin: 0 0 8px; }
.types ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px 16px; }
.types li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line-ink); font-size: var(--t-sm); }
.types li.flash { background: color-mix(in srgb, var(--brass) 16%, transparent); border-radius: 8px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid rgba(233, 238, 243, 0.35); border-radius: var(--r-pill); }
.stepper button { background: transparent; border: 0; color: var(--chalk); width: 40px; height: 40px; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.stepper output { min-width: 58px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.linkish { background: none; border: 0; color: var(--chalk-2); text-decoration: underline; cursor: pointer; font-size: var(--t-sm); padding: 8px 0; }
@media (prefers-reduced-motion: reduce) { .steps li.pop { animation: none; } }
@media (max-width: 720px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.card { background: var(--ink-2); border: 1px solid var(--line-ink); border-radius: var(--r-card); padding: clamp(8px, 2vw, 16px); }

/* ---- FullCalendar, re-skinned with the site tokens ---- */

/* ---- bottom sheet (no browser dialogs) ---- */
.scrim { position: fixed; inset: 0; background: rgba(5, 11, 20, 0.55); opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 40; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--ink-2);
  border-top: 1px solid var(--line-ink); border-radius: 18px 18px 0 0;
  padding: 10px 16px max(18px, env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .22s cubic-bezier(0.2, 0.7, 0.2, 1);
  max-width: 560px; margin: 0 auto; visibility: hidden; transition: transform .22s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s .22s; }
.sheet.on { transform: none; visibility: visible; transition: transform .22s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--slate); margin: 0 auto 12px; }
.sheet h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--t-md); margin: 0 0 4px; }
.sheet .when { color: var(--chalk-2); font-size: var(--t-sm); margin: 0 0 14px; }
.sheet label { display: block; font-size: var(--t-xs); color: var(--chalk-2); margin-bottom: 6px; }
.sheet input[type=text] { width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
  color: var(--chalk); background: var(--ink); border: 1px solid var(--line-ink); border-radius: 10px; padding: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: var(--ink-3); border: 1px solid var(--line-ink); pointer-events: none; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--chalk); transition: transform .15s; }
.switch input:checked + span { background: var(--verdigris); }
.switch input:checked + span::after { transform: translateX(20px); }
.warn { background: color-mix(in srgb, var(--ember) 18%, var(--ink-2)); border: 1px solid var(--ember); border-radius: 10px; padding: 10px 12px; font-size: var(--t-sm); margin: 0 0 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; /* thumb-sized */
  padding: .7rem 1.2rem; border-radius: var(--r-pill); font-weight: 600; border: 1.5px solid transparent; cursor: pointer; }
.btn-brass { background: var(--brass); color: var(--brass-ink); }
.btn-ghost { background: transparent; color: var(--chalk); border-color: rgba(233, 238, 243, 0.35); }
.btn-danger { background: transparent; color: var(--ember); border-color: var(--ember); }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 140%);
  background: var(--chalk); color: var(--ink); border-radius: var(--r-pill); padding: .6rem 1.1rem; font-size: var(--t-sm); font-weight: 600;
  transition: transform .2s, opacity .2s; z-index: 50; max-width: calc(100vw - 32px); text-align: center;
  opacity: 0; visibility: hidden; }
.toast.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* Computer: the calendar gets the room; RIF, steps and job types sit in a sidebar. */
@media (min-width: 1024px) {
  .rcal-page { max-width: 1480px; }
  .layout { display: grid; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
  .steps { grid-template-columns: 1fr 1fr; }
  .types ul { grid-template-columns: 1fr; }
  .rif-log { max-height: 280px; }
}
