/* Sessions — booking a coaching session, and the instructor's open hours. */

.ses-page { max-width: 720px; margin: 0 auto; }
.ses-hint { margin: 8px 2px 14px; }
.ses-closed { padding: 14px 16px; border-radius: 12px; background: var(--sunken); color: var(--ink-soft); font-size: .88rem; line-height: 1.55; }

/* The next session. */
.ses-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; margin-bottom: 10px; }
.ses-card.is-compact { margin-bottom: 14px; }
.ses-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--sunken); border: 1px solid var(--border); color: var(--ink-mid);
}
.ses-icon svg { width: 20px; height: 20px; }
.ses-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ses-eyebrow { font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.ses-when { font-size: 1rem; font-weight: 750; color: var(--ink); margin-top: 2px; }
.ses-sub { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }
.ses-actions { margin-top: 12px; }
.ses-actions .btn span { display: inline-flex; }
.ses-actions .btn svg { width: 16px; height: 16px; }
.ses-tip { font-size: .76rem; color: var(--ink-soft); margin-top: 8px; }

/* Home: "Book your next session". */
.ses-book { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; text-decoration: none; color: var(--ink); }
.ses-book:hover { border-color: var(--line-2); }
.ses-book b { font-size: .92rem; }
.ses-go { color: var(--ink-soft); display: inline-flex; }
.ses-go svg { width: 18px; height: 18px; }

/* Free times: a strip of days, then the chosen day's times. */
.ses-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 6px; scrollbar-width: thin; }
.ses-dayb {
  flex: none; width: 58px; padding: 8px 0; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.15;
}
.ses-dayb-wd, .ses-dayb-m { font-size: .68rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.ses-dayb-d { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ses-dayb.is-on { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.ses-dayb.is-on .ses-dayb-wd, .ses-dayb.is-on .ses-dayb-m { color: var(--red); }

.ses-day { margin-bottom: 16px; }
.ses-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 8px; font-size: .92rem; }
.ses-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.ses-slot {
  min-width: 118px; min-height: 42px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 650; font-size: .92rem; font-variant-numeric: tabular-nums;
}
.ses-slot:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.ses-slot:disabled { cursor: default; text-decoration: line-through; color: var(--ink-soft); }
.ses-confirm-when { font-size: 1.15rem; font-weight: 750; margin-bottom: 6px; }
.ses-confirm .btn { margin-top: 16px; }

/* The instructor. */
.ses-admin .label .btn span { display: inline-flex; }
.ses-admin .label .btn svg { width: 16px; height: 16px; }
.ses-list { overflow: hidden; }
.ses-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.ses-row:first-child { border-top: 0; }
.card-pad .ses-row { padding: 10px 0; }
.ses-row-main { display: flex; flex-direction: column; min-width: 0; }
.ses-row-main b { font-size: .92rem; }
.ses-row-main span { font-size: .8rem; color: var(--ink-soft); }
.ses-row .btn-row { flex: none; align-items: center; gap: 2px; flex-wrap: nowrap; }
.ses-row .btn-row .btn-sm { padding: 0 10px; }
.ses-row-main b { white-space: nowrap; }
.ses-inline { display: flex; gap: 8px; align-items: center; }
.ses-inline .input { flex: 1; min-width: 0; }
.ses-inline .ses-time, .ses-time { flex: 0 0 auto; width: 120px; padding: 0 8px; }
.ses-zoom .hint { margin-top: 10px; }

.ses-hours { overflow: hidden; }
.ses-hours-row { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: center; }
.ses-hours-row:first-child { border-top: 0; }
.ses-hours-day { font-size: .9rem; }
.ses-hours-spans { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ses-span { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.ses-span-x { border: 0; background: none; padding: 0; color: inherit; display: inline-flex; opacity: .6; }
.ses-span-x svg { width: 13px; height: 13px; }
.ses-hours-add { grid-column: 2; display: flex; gap: 6px; align-items: center; }
.ses-hours-add .ses-time { flex: 1; width: auto; min-width: 0; max-width: 130px; min-height: 38px; padding: 0 8px; font-size: .9rem; }
.ses-hours-save { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
@media (max-width: 520px) {
  .ses-hours-row { grid-template-columns: 1fr; }
  .ses-hours-add { grid-column: 1; }
}
.ses-closed-form { display: grid; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ses-closed-form .btn { justify-self: start; margin-top: 6px; }

/* The instructor's week calendar: Japan-time days across, half hours down. */
.cal-card { padding: 10px 10px 12px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-nav b { font-size: .92rem; }
.cal-grid { display: grid; grid-template-columns: 40px repeat(7, minmax(0, 1fr)); gap: 0 3px; }
.cal-dayhead { height: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.cal-dayhead span { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.cal-dayhead b { font-size: .9rem; }
.cal-dayhead.is-today b { color: var(--red); }
.cal-times { position: relative; }
.cal-times span { position: absolute; left: 0; right: 4px; transform: translateY(-50%); text-align: right; font-size: .62rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cal-times span:first-child { transform: none; }
.cal-col {
  /* The page scrolls over it; a press and hold picks (see admin-sessions.js). */
  position: relative; border-radius: 8px; touch-action: pan-y; cursor: default;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  background-color: var(--sunken);
  /* A line every hour, a fainter one every half hour (16px a half hour). */
  background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px), linear-gradient(to bottom, transparent 15px, rgba(127, 127, 127, .08) 15px, rgba(127, 127, 127, .08) 16px, transparent 16px);
  background-size: 100% 32px, 100% 32px;
}
.cal-col.is-past { opacity: .45; cursor: default; }
.cal-open, .cal-booking {
  position: absolute; left: 2px; right: 2px; border-radius: 6px; overflow: hidden;
  font-size: .6rem; font-weight: 700; line-height: 1.2; padding: 2px 3px; pointer-events: none;
}
.cal-open { background: var(--green-bg); border: 1px solid var(--green-ln); color: var(--green); }
html[data-theme="dark"] .cal-open { background: var(--green-ln); border-color: var(--green); }
.cal-open.is-weekly { background: var(--green-bg); border-style: solid; }
.cal-open span, .cal-booking span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-booking { pointer-events: auto; border: 0; text-align: left; background: var(--red); color: var(--on-red); z-index: 2; cursor: pointer; }
/* The draft: dashed until applied, a dot at each end to drag. */
.cal-draft {
  position: absolute; left: 1px; right: 1px; z-index: 3; border-radius: 6px;
  border: 2px dashed var(--ink-mid); background: rgba(127, 127, 127, .12); color: var(--ink);
  font-size: .6rem; font-weight: 800; line-height: 1.2; padding: 2px 3px; pointer-events: none;
}
.cal-draft.is-open { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.cal-draft.is-close { border-color: var(--ink-soft); background: repeating-linear-gradient(45deg, rgba(127, 127, 127, .18) 0 4px, transparent 4px 8px); }
.cal-draft.is-saving { border-style: solid; }
.cal-draft-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-handle {
  position: absolute; left: 50%; width: 36px; height: 28px; margin-left: -18px; pointer-events: auto;
  touch-action: none; cursor: ns-resize; z-index: 4;
}
.cal-handle.is-top { top: -15px; }
.cal-handle.is-bottom { bottom: -15px; }
.cal-handle::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--surface); border: 2.5px solid currentColor; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.cal-draft.is-saving .cal-handle { display: none; }
/* Under the calendar while there is a draft: what it does, Cancel, Apply.
   It stays in view at the bottom of the screen while the calendar scrolls. */
.cal-bar {
  position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}
.cal-bar[hidden] { display: none; }
.cal-bar-text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cal-bar .btn-row { margin-left: auto; }
.cal-bar-text b { font-size: .88rem; }
.cal-bar-text span { font-size: .8rem; color: var(--ink-soft); }
@media (min-width: 900px) { .cal-bar { bottom: 12px; } }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.cal-hint { margin-top: 10px; font-size: .78rem; }
@media (max-width: 420px) {
  .cal-grid { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); gap: 0 2px; }
  .cal-open span, .cal-draft-label { display: none; }
}

/* This week's mission: a to-do list, then the coach's note. Compact — it
   sits on Home among the other cards. */
.note-card { padding: 12px 14px; margin-bottom: 10px; }
.note-card.is-compact { margin-bottom: 12px; }
.note-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.note-title { font-size: .88rem; font-weight: 800; color: var(--ink); }
.note-when { font-size: .7rem; color: var(--ink-soft); }
.note-left { flex: none; font-size: .68rem; font-weight: 750; color: var(--red); }
.note-left.is-done { color: var(--green); }
.note-hw { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; }
.note-hw li { border-top: 1px solid var(--border); }
.note-hw li:first-child { border-top: 0; }
.note-hw label { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.note-hw input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--green); flex: none; }
.note-item { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.note-item-title { font-size: .84rem; font-weight: 650; line-height: 1.35; color: var(--ink); }
.note-item-detail { font-size: .74rem; line-height: 1.45; color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
/* On Home, a detail is one line; the whole of it is on the Compass page. */
.note-card.is-compact .note-item-detail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Done: ticked and struck through. */
.note-hw li.is-done .note-item-title, .note-hw li.is-done .note-item-detail { color: var(--ink-soft); text-decoration: line-through; }
.note-body { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); font-size: .8rem; line-height: 1.5; color: var(--ink-mid); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-card.is-compact .note-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-more { display: inline-block; margin-top: 4px; font-size: .74rem; font-weight: 650; color: var(--ink-mid); }

/* The instructor's to-do editor. */
.todo-edit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.todo-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 36px; gap: 8px; align-items: start; }
.todo-box { width: 16px; height: 16px; margin-top: 13px; border: 1.5px solid var(--line-2); border-radius: 4px; }
.todo-fields { display: flex; flex-direction: column; gap: 6px; }
.todo-title { min-height: 42px; }
textarea.input.todo-detail { min-height: 0; font-size: .86rem; padding: 8px 12px; }
.todo-more { align-self: flex-start; min-height: 26px; padding: 0 6px; font-size: .76rem; }
.todo-x { width: 36px; height: 42px; }
.todo-x svg { width: 16px; height: 16px; }

/* The instructor's notes sheet. */
.notes-h { font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin: 4px 0 10px; }
.notes-h + form, .notes-admin form { margin-bottom: 8px; }
.notes-admin .notes-h:not(:first-child) { margin-top: 18px; }
.notes-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.notes-row-main { display: flex; flex-direction: column; min-width: 0; }
.notes-row-main b { font-size: .88rem; }
.notes-row-main span { font-size: .8rem; color: var(--ink-mid); }
.notes-row .btn-row { flex: none; flex-wrap: nowrap; gap: 2px; }
