/* css/workspace.css — Study Sets hub and workspace (chat 2.33, Phase B1).
   New file; every rule is scoped to .hub-* or .ws-* so nothing else on
   the site changes. Loaded after style.css and teachers.css (the door
   styles), whose tokens it uses. Approved mockups: "Study Sets — Mockups v1". */

/* ── Hub: which tab is showing (body class set by PHP, switched by JS) ── */
.hub-tab-study .hub-print,
.hub-tab-print .hub-study { display: none !important; }

.hub-top {
  position: relative;
  z-index: 5;
  max-width: 1120px;
  margin: 0 auto;
  padding: 6.5rem 1.25rem 4.5rem;
}
@media (min-width: 900px) {
  .hub-top { padding: 6.5rem 3rem 5rem; }
}

/* ── Folder tabs (owner: "the tabs look perfect", DECISIONS #432) ── */
.hub-tabs,
.ws-tabs {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border-bottom: 1px solid rgba(201,168,76,0.4);
}
.hub-tabs { margin-top: 1.25rem; }
.hub-tab,
.ws-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  margin-bottom: -1px;
  background: rgba(245,237,216,0.035);
  border: 1px solid rgba(201,168,76,0.22);
  border-bottom-color: rgba(201,168,76,0.4);
  border-radius: 9px 9px 0 0;
  text-decoration: none;
  color: rgba(245,237,216,0.62);
  transition: background .2s, color .2s;
}
.hub-tab { flex: 0 1 260px; min-width: 0; padding: 12px 22px 13px; align-items: flex-start; }
.ws-tab {
  flex: 0 1 160px;
  min-width: 0;
  align-items: center;
  padding: 0 18px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hub-tab:hover,
.ws-tab:hover { background: rgba(245,237,216,0.07); color: var(--gold-light); }
.hub-tab-t { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(245,237,216,0.62); }
.hub-tab-d { font-size: 0.78rem; font-weight: 300; color: rgba(245,237,216,0.45); }
.hub-tab:hover .hub-tab-t { color: var(--gold-light); }
.hub-tab[aria-current="page"],
.ws-tab[aria-current="page"] {
  background: #16140F;
  border-color: rgba(201,168,76,0.4);
  border-bottom-color: #16140F;
  color: var(--gold);
  font-weight: 500;
  padding-top: 16px;
}
.ws-tab[aria-current="page"] { min-height: 54px; padding-top: 0; }
.hub-tab[aria-current="page"] .hub-tab-t { color: var(--gold); font-weight: 500; }
.hub-tab[aria-current="page"] .hub-tab-d { color: rgba(245,237,216,0.62); }
.hub-tab[aria-current="page"]::before,
.ws-tab[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  top: -1px;
  height: 3px;
  background: var(--gold);
  border-radius: 9px 9px 0 0;
}
.hub-tab:focus-visible,
.ws-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 599px) {
  .hub-tab { flex: 1 1 0; padding: 12px 14px; }
  .hub-tab-d { display: none; }
  .ws-tab { flex: 1 1 0; padding: 0 8px; font-size: 0.72rem; letter-spacing: 0.08em; }
}

/* The framed panel each tab opens into. */
.hub-frame,
.ws-tabpanel {
  background: #16140F;
  border: 1px solid rgba(201,168,76,0.4);
  border-top: none;
  border-radius: 0 0 12px 12px;
}
.hub-frame { padding: 2rem 1.25rem 2.25rem; }
.ws-tabpanel { padding: 1.5rem 1.1rem 1.75rem; }
@media (min-width: 760px) {
  .hub-frame { padding: 2.75rem 3rem 3rem; }
  .ws-tabpanel { padding: 1.75rem 1.75rem 2rem; }
}
.ws-tabpanel[hidden] { display: none; }

/* Printables tab: today's hero, sitting inside the frame. */
.hub-frame .tp-hero-inner { padding: 0; }
@media (min-width: 900px) {
  .hub-frame .tp-hero-inner { padding: 0; gap: 3.5rem; }
  /* Keep the cream section peeking in on a 768px-tall laptop (DECISIONS
     #393): the tabs take ~7rem more height than the old hero. */
  .hub-frame .tp-sheet { max-width: min(440px, calc((100vh - 23rem) * 0.773)); }
}

/* ── Signed-out Study Sets intro ── */
.hub-intro {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 900px) {
  .hub-intro { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 3.5rem; }
}
.hub-intro .tp-title { margin-top: 0; }
.hub-phone {
  width: 290px;
  max-width: 100%;
  margin: 0 auto;
  border: 10px solid #2A2722;
  border-radius: 34px;
  background: var(--ink);
  padding: 16px 12px 18px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.55);
  transform: rotate(1.6deg);
}
.hub-phone-label { margin: 0; text-align: center; font-size: 0.55rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.hub-phone-title { margin: 4px 0 10px; text-align: center; font-family: 'Playfair Display', serif; font-size: 0.9rem; color: var(--cream); }
.hub-phone-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  padding: 4px;
}
.hub-phone-grid span {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  color: var(--cream);
  border: 1px solid rgba(201,168,76,0.18);
}
.hub-phone-grid span.is-found { background: rgba(107,155,209,0.28); color: #fff; }
.hub-phone-q { margin: 10px 2px 0; font-size: 0.68rem; line-height: 1.4; color: rgba(245,237,216,0.8); }

.hub-feats {
  display: grid;
  gap: 1.75rem 2.5rem;
}
@media (min-width: 760px) {
  .hub-feats { grid-template-columns: repeat(2, 1fr); }
}
.hub-feats p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--tp-graphite);
  padding-left: 1rem;
  border-left: 2px solid var(--tp-blue);
}
.hub-feats b { font-weight: 500; color: var(--tp-blue); }

/* ── Shared workspace pieces ── */
.ws-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ws-label {
  margin: 0 0 6px;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.ws-field {
  display: block;
  width: 100%;
  min-height: 44px;
  background: rgba(245,237,216,0.04);
  border: 1px solid rgba(245,237,216,0.16);
  border-radius: 3px;
  padding: 0.7rem 0.9rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--cream);
  box-sizing: border-box;
}
.ws-field::placeholder { color: var(--ink-muted); }
.ws-field:focus { outline: none; border-color: var(--gold); }
select.ws-field { appearance: auto; }
select.ws-field option { background: var(--ink-mid); color: var(--cream); }
.ws-field-group { margin-bottom: 2rem; }
.ws-field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.ws-field-label-sub { margin-top: 0.9rem; }
.ws-hint { margin: 8px 0 0; font-size: 0.78rem; font-weight: 300; line-height: 1.5; color: rgba(245,237,216,0.55); }
.ws-center { text-align: center; }
.ws-mt { margin-top: 1.4rem; }

.ws-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.ws-pill:hover { background: rgba(201,168,76,0.1); border-color: var(--gold); }
.ws-pill-on { background: rgba(201,168,76,0.12); border-color: var(--gold); }
.ws-pill-tall { min-height: 44px; }
.ws-pill-danger { color: #E8A99C; border-color: rgba(196,105,90,0.4); }
.ws-pill-danger:hover { background: rgba(196,105,90,0.12); border-color: var(--error); }

.ws-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  background: transparent;
  border: none;
  color: rgba(245,237,216,0.65);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.ws-text-btn:hover { color: var(--gold); }
.ws-danger { color: #E8A99C; }

.ws-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.ws-search { flex: 999 1 240px; width: auto; }

.ws-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  z-index: 200;
  padding: 10px 18px;
  border-radius: 50px;
  background: var(--ink-mid);
  border: 1px solid rgba(201,168,76,0.45);
  color: var(--cream);
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.ws-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.ws-alert {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  background: rgba(196,105,90,0.12);
  border: 1px solid rgba(196,105,90,0.4);
  color: #E8A99C;
  font-size: 0.88rem;
  line-height: 1.5;
}
.ws-alert[hidden] { display: none; }

.ws-warn {
  display: flex;
  gap: 7px;
  align-items: baseline;
  margin-top: 6px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #E8A99C;
}
.ws-warn b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid #E8A99C;
  font-size: 0.62rem;
  font-weight: 500;
}

.ws-ans {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 50px;
  border: 1px solid rgba(201,168,76,0.3);
  background: rgba(201,168,76,0.12);
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* ── The workspace list (signed-in Study Sets tab) ── */
.ws-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}
.ws-title {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--cream);
}
.ws-empty {
  padding: 2.5rem 1.5rem;
  border: 1px dashed rgba(201,168,76,0.35);
  border-radius: 10px;
  text-align: center;
}
.ws-empty-title { margin: 0 0 0.6rem; font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--cream); }
.ws-empty-text { margin: 0 auto 1.5rem; max-width: 34rem; font-size: 0.95rem; font-weight: 300; line-height: 1.6; color: var(--ink-soft); }
.ws-no-match { margin: 0.5rem 0 1rem; color: var(--ink-soft); font-size: 0.9rem; }
.ws-no-match[hidden] { display: none; }

.ws-courses { display: flex; flex-direction: column; gap: 12px; }
.ws-course {
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 10px;
  background: var(--ink-mid);
  overflow: hidden;
}
.ws-course[hidden] { display: none; }
.ws-course-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  text-align: left;
  cursor: pointer;
}
.ws-course-head:hover { background: rgba(245,237,216,0.03); }
.ws-course-head:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.ws-chev {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-right: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  transform: rotate(-45deg);
  transition: transform .2s;
}
.ws-course.is-open .ws-chev { transform: rotate(45deg); }
.ws-course-name { flex: 1 1 auto; min-width: 0; }
.ws-course-title { display: block; font-family: 'Playfair Display', serif; font-size: 1.3rem; line-height: 1.25; }
.ws-course-meta { display: block; margin-top: 2px; font-size: 0.8rem; color: rgba(245,237,216,0.55); }
.ws-num { flex: 0 0 auto; text-align: right; }
.ws-num b { display: block; font-family: 'Playfair Display', serif; font-weight: 400; font-size: 1.15rem; line-height: 1; color: var(--gold); }
.ws-num span { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(245,237,216,0.5); }

.ws-course-body[hidden] { display: none; }
.ws-creview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 20px 14px 44px;
  border-top: 1px solid rgba(201,168,76,0.12);
  background: rgba(201,168,76,0.05);
}
.ws-creview-text { flex: 999 1 240px; font-size: 0.86rem; color: var(--ink-soft); }
.ws-creview-text b { font-weight: 500; color: var(--gold); }
.ws-unit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 20px 12px 44px;
  border-top: 1px solid rgba(201,168,76,0.12);
}
.ws-unit[hidden] { display: none; }
.ws-unit-name { flex: 999 1 220px; min-width: 0; font-size: 0.98rem; color: var(--cream); }
.ws-unit-meta { display: block; margin-top: 2px; font-size: 0.78rem; color: rgba(245,237,216,0.55); }
.ws-tag {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 50px;
  border: 1px solid rgba(201,168,76,0.45);
  color: var(--gold);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.ws-unit-actions { display: flex; gap: 6px; }
.ws-add-unit {
  display: block;
  padding: 12px 20px 14px 44px;
  border-top: 1px solid rgba(201,168,76,0.12);
  font-size: 0.82rem;
  color: var(--gold);
  text-decoration: none;
}
.ws-add-unit:hover { color: var(--gold-light); background: rgba(201,168,76,0.05); }
.ws-foot { margin: 1.25rem 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.ws-foot a { color: var(--gold); }
@media (max-width: 599px) {
  .ws-course-head { padding: 14px 14px; }
  .ws-creview, .ws-unit, .ws-add-unit { padding-left: 16px; padding-right: 14px; }
}

/* ── Workspace pages (study-new.php, study-unit.php) ── */
.ws-page { min-height: 100vh; }
.ws-main {
  position: relative;
  z-index: 5;
  max-width: 880px;
  margin: 0 auto;
  padding: 6.5rem 1.25rem 5rem;
}
.ws-narrow { max-width: 680px; }
.ws-page-head { text-align: center; margin-bottom: 1.75rem; }
.ws-back {
  display: block;
  width: fit-content;
  margin: 0 auto 1.1rem;
  padding: 6px 16px;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 50px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
}
.ws-back:hover { background: rgba(201,168,76,0.1); border-color: var(--gold); }
.ws-page-title {
  margin: 0.25rem 0 0.6rem;
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.2;
  color: var(--cream);
}
.ws-page-sub { margin: 0 auto; max-width: 30rem; font-size: 0.9rem; font-weight: 300; line-height: 1.55; color: var(--ink-soft); }
.ws-live { color: var(--emerald-light); }
.ws-paused { color: #E8A99C; }
.ws-head-actions { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.ws-title-edit { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; max-width: 32rem; }
.ws-title-input { flex: 1 1 220px; font-size: 1.1rem; }

/* new unit: question rows (the Builder's row look) */
.ws-rows-head { display: flex; justify-content: space-between; align-items: baseline; }
.ws-rows-count { font-size: 0.8rem; color: var(--ink-soft); }
.ws-rows { display: flex; flex-direction: column; gap: 10px; }
.ws-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px 12px;
  background: var(--ink-mid);
  border: 1px solid rgba(245,237,216,0.1);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
}
.ws-row-num { width: 18px; flex-shrink: 0; padding-top: 10px; text-align: center; font-family: 'Playfair Display', serif; font-size: 0.85rem; }
.ws-row-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 165px; gap: 6px 10px; }
.ws-row-clue,
.ws-row-answer {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(245,237,216,0.18);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
}
.ws-row-clue { grid-column: 1; grid-row: 1 / 3; min-height: 64px; resize: vertical; line-height: 1.4; }
.ws-row-answer { grid-column: 2; grid-row: 1; min-height: 44px; text-transform: uppercase; letter-spacing: 0.06em; }
.ws-row-answer::placeholder, .ws-row-clue::placeholder { color: var(--ink-muted); font-style: italic; text-transform: none; letter-spacing: 0; }
.ws-row-clue:focus, .ws-row-answer:focus { outline: none; border-color: var(--gold); }
.ws-row-note { grid-column: 2; grid-row: 2; font-size: 0.72rem; color: rgba(245,237,216,0.55); text-align: right; }
.ws-row-note.is-warn { color: #E8A99C; }
.ws-row-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-top: 6px;
  border: 1px solid rgba(196,105,90,0.35);
  border-radius: 4px;
  background: transparent;
  color: #E8A99C;
  font-size: 1rem;
  cursor: pointer;
}
.ws-row-remove:hover { background: rgba(196,105,90,0.12); }
@media (max-width: 599px) {
  .ws-row-fields { grid-template-columns: 1fr; }
  .ws-row-clue { grid-row: auto; }
  .ws-row-answer, .ws-row-note { grid-column: 1; grid-row: auto; }
  .ws-row-note { text-align: left; }
}
.ws-add-row {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.ws-add-row:hover { background: var(--gold); color: var(--ink); }
.ws-add-row:disabled { opacity: 0.4; cursor: not-allowed; }
.ws-submit { width: 100%; min-height: 48px; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.ws-submit:disabled { opacity: 0.5; cursor: wait; }

/* unit page: questions */
.ws-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(196,105,90,0.35);
  background: rgba(196,105,90,0.08);
  border-radius: 6px;
  font-size: 0.88rem;
  color: #E8A99C;
}
.ws-banner span { flex: 1 1 220px; }
.ws-banner[hidden] { display: none; }
.ws-qlist { list-style: none; margin: 0; padding: 0; }
.ws-q {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}
.ws-q-num { width: 24px; flex-shrink: 0; padding-top: 2px; text-align: right; font-family: 'Playfair Display', serif; font-size: 0.82rem; color: var(--gold); }
.ws-q-body { flex: 1; min-width: 0; }
.ws-q-clue { font-size: 0.95rem; line-height: 1.5; color: var(--cream); overflow-wrap: anywhere; }
.ws-q-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ws-q-len { font-size: 0.75rem; color: rgba(245,237,216,0.5); }
.ws-q-actions { display: flex; flex-shrink: 0; margin-top: -10px; }
@media (max-width: 599px) {
  .ws-q { flex-wrap: wrap; }
  .ws-q-actions { width: 100%; justify-content: flex-end; margin-top: 0; }
}
.ws-empty-line { margin: 1.5rem 0 0.5rem; text-align: center; color: var(--ink-soft); font-size: 0.92rem; }
.ws-empty-line[hidden] { display: none; }
.ws-edit {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 10px 14px;
  width: 100%;
  margin: 8px 0;
  padding: 16px;
  background: var(--ink-mid);
  border: 1px solid rgba(201,168,76,0.45);
  border-radius: 8px;
}
.ws-edit-clue { min-height: 70px; resize: vertical; line-height: 1.45; }
.ws-edit-answer { text-transform: uppercase; letter-spacing: 0.06em; }
.ws-edit-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; }
.ws-edit-actions .btn-primary, .ws-edit-actions .btn-ghost { min-height: 44px; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.ws-edit-actions .btn-ghost { border: 1px solid rgba(201,168,76,0.4); background: transparent; }
@media (max-width: 599px) {
  .ws-edit { grid-template-columns: 1fr; }
}

/* unit page: share */
.ws-card {
  padding: 22px;
  background: var(--ink-mid);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 10px;
}
.ws-card-top { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; justify-content: space-between; align-items: flex-start; }
.ws-card-intro { flex: 1 1 300px; }
.ws-card-title { margin: 0; font-family: 'Playfair Display', serif; font-weight: 400; font-size: 1.5rem; color: var(--cream); }
.ws-card-text { margin: 6px 0 0; font-size: 0.9rem; font-weight: 300; line-height: 1.55; color: var(--ink-soft); }
.ws-stepper-wrap { flex: 0 0 auto; text-align: center; }
.ws-stepper { display: inline-flex; align-items: center; border: 1px solid rgba(245,237,216,0.2); border-radius: 50px; overflow: hidden; }
.ws-stepper button { width: 44px; height: 44px; background: transparent; border: none; color: var(--gold); font-size: 1.25rem; cursor: pointer; }
.ws-stepper button:disabled { opacity: 0.3; cursor: not-allowed; }
.ws-stepper span { min-width: 46px; text-align: center; font-family: 'Playfair Display', serif; font-size: 1.35rem; color: var(--cream); }
.ws-mode { display: flex; max-width: 520px; border: 1px solid rgba(245,237,216,0.15); border-radius: 6px; overflow: hidden; }
.ws-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 11px 10px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.ws-mode-t { font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(245,237,216,0.62); }
.ws-mode-d { font-size: 0.72rem; font-weight: 300; color: rgba(245,237,216,0.5); text-align: center; }
.ws-mode-btn.is-on { background: rgba(201,168,76,0.12); }
.ws-mode-btn.is-on .ws-mode-t { color: var(--gold); }
.ws-mode-btn[data-mode="classic"].is-on { background: rgba(111,169,143,0.12); }
.ws-mode-btn[data-mode="classic"].is-on .ws-mode-t { color: var(--emerald-light); }
.ws-mode-btn:not(.is-on):hover { background: rgba(245,237,216,0.04); }
.ws-linkrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.ws-linkbox {
  flex: 999 1 260px;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(245,237,216,0.16);
  border-radius: 3px;
  font-size: 0.92rem;
  color: var(--cream);
  overflow-wrap: anywhere;
}
.ws-linkrow .btn-primary, .ws-linkrow .btn-ghost { display: inline-flex; align-items: center; min-height: 44px; padding-top: 0; padding-bottom: 0; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.ws-linkrow .btn-ghost { border: 1px solid rgba(201,168,76,0.4); }
.ws-note {
  margin-top: 1.25rem;
  padding: 16px 18px;
  border: 1px solid rgba(245,237,216,0.1);
  border-radius: 8px;
  background: rgba(245,237,216,0.02);
}
.ws-note p:last-child { margin: 0; font-size: 0.88rem; line-height: 1.6; color: var(--ink-soft); }

/* First screen never a false bottom (DECISIONS #393): with the tabs added,
   the hero inside the panel is a little smaller and tighter so the cream
   section still peeks in on a 768px-tall laptop (measured chat 2.33 at
   1366x768: 39px on Printables, 129px on Study Sets). */
@media (min-width: 900px) {
  .hub-top { padding-top: 5.5rem; padding-bottom: 3.5rem; }
  .hub-tab-study .hub-top { padding-bottom: 2.25rem; } /* no Explore cue on this tab */
  .hub-top .tp-kicker { margin-bottom: 0.4rem; }
  .hub-frame { padding: 2rem 3rem; }
  .hub-frame .tp-title { font-size: clamp(2rem, 3.1vw, 2.45rem); margin-bottom: 1rem; max-width: 18ch; }
  .hub-frame .tp-lede { font-size: 1rem; margin-bottom: 1.5rem; }
  .hub-frame .tp-actions { margin-bottom: 0.75rem; }
  .hub-frame .tp-sheet { max-width: min(400px, calc((100vh - 25rem) * 0.773)); }
  .hub-phone { width: 260px; }
}
@media (max-width: 599px) {
  .ws-stepper-wrap { text-align: left; }
}

/* ============================================================
   Phase B2 — CSV import, featured puzzles, activity, course settings,
   QR sheet.
   ============================================================ */

/* workspace list: course footer row, archived */
.ws-course-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; border-top: 1px solid rgba(201,168,76,0.12); }
.ws-course-foot .ws-add-unit { border-top: none; flex: 1 1 auto; }
.ws-course-settings { padding: 12px 20px 14px; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(245,237,216,0.65); text-decoration: underline; text-underline-offset: 3px; }
.ws-course-settings:hover { color: var(--gold); }
.ws-archived { margin-top: 1.25rem; padding: 14px 16px; border: 1px dashed rgba(245,237,216,0.18); border-radius: 10px; }
.ws-archived[hidden] { display: none; }
.ws-archived-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 4px; border-top: 1px solid rgba(245,237,216,0.08); color: var(--cream); text-decoration: none; }
.ws-archived-row:hover span { color: var(--gold-light); }
.ws-archived-row em { font-style: normal; font-size: 0.78rem; color: rgba(245,237,216,0.5); }

/* CSV import */
.ws-csv { margin: 0 0 1rem; padding: 18px; border: 1px solid rgba(201,168,76,0.3); border-radius: 8px; background: rgba(245,237,216,0.02); }
.ws-csv-pick { position: relative; display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 12px; border: 1px dashed rgba(201,168,76,0.5); border-radius: 6px; cursor: pointer; color: var(--gold); font-size: 0.9rem; text-align: center; }
.ws-csv-pick:hover { background: rgba(201,168,76,0.06); }
.ws-csv-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ws-csv-pick:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.ws-csv .ws-hint a { color: var(--gold); }
.ws-csv-result { margin-top: 14px; }
.ws-csv-result .ws-alert { display: block; }
.ws-csv-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.ws-csv-stat { flex: 1 1 140px; padding: 12px 14px; border: 1px solid rgba(245,237,216,0.12); border-radius: 8px; }
.ws-csv-stat b { display: block; font-family: 'Playfair Display', serif; font-weight: 400; font-size: 1.6rem; line-height: 1; }
.ws-csv-stat span { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.ws-csv-stat.is-ok b { color: var(--emerald-light); }
.ws-csv-stat.is-check b { color: var(--gold); }
.ws-csv-stat.is-no b { color: #E8A99C; }
.ws-csv-group { margin-top: 18px; }
.ws-csv-group h3 { margin: 0 0 4px; font-size: 0.76rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }
.ws-csv-group.is-ok h3 { color: var(--emerald-light); }
.ws-csv-group.is-check h3 { color: var(--gold); }
.ws-csv-group.is-no h3 { color: #E8A99C; }
.ws-csv-list { list-style: none; margin: 0; padding: 0; }
.ws-csv-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(201,168,76,0.1); }
.ws-csv-list li[hidden] { display: none; }
.ws-csv-row { flex: 0 0 52px; font-size: 0.72rem; color: rgba(245,237,216,0.5); padding-top: 2px; }
.ws-csv-body { flex: 1; min-width: 0; }
.ws-csv-clue { margin-right: 8px; font-size: 0.9rem; line-height: 1.5; color: var(--cream); overflow-wrap: anywhere; }
.ws-csv-go { margin-top: 18px; width: 100%; min-height: 48px; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.ws-csv-go:disabled { opacity: 0.5; cursor: wait; }
.ws-csv .ws-text-btn { margin-top: 8px; }

/* share: featured list */
.ws-flist { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid rgba(201,168,76,0.12); }
.ws-frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid rgba(201,168,76,0.12); }
.ws-frow-name { flex: 999 1 220px; min-width: 0; font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--cream); }
.ws-frow-name span { display: block; margin-top: 2px; font-family: 'DM Sans', sans-serif; font-size: 0.78rem; color: rgba(245,237,216,0.55); overflow-wrap: anywhere; }
.ws-frow-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ws-frow-actions .ws-text-btn { min-height: 38px; }

/* activity */
.ws-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.ws-stat { flex: 1 1 160px; padding: 16px 18px; border: 1px solid rgba(201,168,76,0.25); border-radius: 10px; background: var(--ink-mid); }
.ws-stat b { display: block; font-family: 'Playfair Display', serif; font-weight: 400; font-size: 2rem; line-height: 1; color: var(--gold); }
.ws-stat span { display: block; margin-top: 8px; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.ws-chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.ws-legend { display: flex; gap: 16px; font-size: 0.78rem; color: var(--ink-soft); }
.ws-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; vertical-align: -1px; }
.ws-key-s { background: rgba(201,168,76,0.35); }
.ws-key-f { background: var(--emerald-light); }
.ws-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 0 2px; border-bottom: 1px solid rgba(245,237,216,0.18); }
.ws-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.ws-col i { display: block; width: 100%; max-width: 28px; background: rgba(201,168,76,0.35); border-radius: 3px 3px 0 0; }
.ws-col i.ws-col-f { background: var(--emerald-light); border-radius: 0; }
.ws-days { display: flex; gap: 6px; padding: 6px 2px 0; }
.ws-days span { flex: 1; text-align: center; font-size: 0.66rem; color: rgba(245,237,216,0.5); }
.ws-table-wrap { overflow-x: auto; }
.ws-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ws-table th { padding: 10px 12px; text-align: right; font-weight: 400; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1px solid rgba(201,168,76,0.25); }
.ws-table td { padding: 12px; text-align: right; border-bottom: 1px solid rgba(201,168,76,0.12); color: var(--cream); }
.ws-table th:first-child, .ws-table td:first-child { text-align: left; }
.ws-table td span { color: rgba(245,237,216,0.5); }

/* featured picker */
.ws-wide-ish { max-width: 760px; }
.ws-pickbar {
  position: sticky;
  top: 10px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 16px;
  background: var(--ink-mid);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.ws-pickbar-count { min-width: 74px; font-size: 0.85rem; color: var(--ink-soft); }
.ws-pickbar-count b { font-family: 'Playfair Display', serif; font-weight: 400; font-size: 1.5rem; color: var(--gold); }
.ws-meter { flex: 1 1 120px; height: 6px; background: rgba(201,168,76,0.2); border-radius: 3px; overflow: hidden; }
.ws-meter i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.ws-pickbar-save { min-height: 44px; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.ws-pickbar-save:disabled { opacity: 0.45; cursor: not-allowed; }
.ws-pick-full { color: var(--gold); }
.ws-pick-full[hidden] { display: none; }
.ws-picklist { list-style: none; margin: 0; padding: 0; }
.ws-pick {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 14px 10px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(201,168,76,0.12);
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  text-align: left;
  cursor: pointer;
}
.ws-pick:hover { background: rgba(245,237,216,0.03); }
.ws-pick.is-on { background: rgba(201,168,76,0.07); }
.ws-pick:disabled { opacity: 0.4; cursor: not-allowed; }
.ws-pick:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.ws-check { flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; border: 1.5px solid rgba(245,237,216,0.45); border-radius: 4px; background: rgba(14,12,10,0.75); display: inline-flex; align-items: center; justify-content: center; }
.ws-check.is-on { background: var(--gold); border-color: var(--gold); }
.ws-check.is-on::after { content: ''; width: 5px; height: 10px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.ws-pick-clue { flex: 1; min-width: 0; font-size: 0.93rem; line-height: 1.5; overflow-wrap: anywhere; }

/* course settings */
.ws-notice { margin: 0 0 1.25rem; padding: 0.85rem 1rem; border-radius: 4px; background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.35); color: var(--gold-light); font-size: 0.9rem; }
.ws-linkbox-input { flex: 999 1 260px; width: auto; }
.ws-checks { margin: 1.4rem 0 0; padding: 0; border: none; }
.ws-check-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 0; border-bottom: 1px solid rgba(201,168,76,0.1); cursor: pointer; color: var(--cream); font-size: 0.95rem; }
.ws-check-row input { width: 20px; height: 20px; accent-color: var(--gold); flex-shrink: 0; }
.ws-check-row em { font-style: normal; font-size: 0.78rem; color: rgba(245,237,216,0.5); margin-left: 6px; }
.ws-manage { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 14px 0; border-top: 1px solid rgba(201,168,76,0.12); }
.ws-manage:first-of-type { border-top: none; }
.ws-manage div { flex: 999 1 280px; }
.ws-manage b { display: block; font-weight: 500; color: var(--cream); }
.ws-manage span { display: block; margin-top: 2px; font-size: 0.85rem; line-height: 1.5; color: var(--ink-soft); }

/* QR sheet (study-qr.php) — on screen a white page; printed, one US Letter page */
.qr-body { margin: 0; background: #E9E5DB; font-family: 'DM Sans', sans-serif; color: #1C1A16; }
.qr-toolbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 16px; background: #0E0C0A; }
.qr-btn { min-height: 44px; padding: 0 18px; border: 1px solid rgba(201,168,76,0.5); border-radius: 50px; background: transparent; color: #C9A84C; font-family: 'DM Sans', sans-serif; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.qr-btn:hover { background: rgba(201,168,76,0.12); }
.qr-btn-main { background: #C9A84C; color: #0E0C0A; }
.qr-btn-main:hover { background: #E8C97A; }
.qr-sheet {
  box-sizing: border-box;
  width: 8.5in;
  min-height: 11in;
  max-width: 100%;
  margin: 24px auto;
  padding: 0.75in 0.75in 0.6in;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.qr-label { margin: 0; font-size: 10pt; letter-spacing: 0.28em; text-transform: uppercase; color: #8A6D24; }
.qr-title { margin: 12pt 0 0; font-family: 'Playfair Display', serif; font-weight: 400; font-size: 32pt; line-height: 1.15; color: #1C1A16; max-width: 6.5in; overflow-wrap: anywhere; }
.qr-context { margin: 6pt 0 0; font-size: 13pt; color: #6B655B; }
.qr-scan { margin: 33pt 0 0; font-size: 15pt; color: #34302A; }
/* Round 3 (owner chose option A): the code is 1.5 in, in a double-line box. */
.qr-code { box-sizing: content-box; width: 1.5in; margin-top: 14pt; padding: 9pt; border: 4px double #1C1A16; background: #fff; }
.qr-code svg { display: block; width: 100%; height: auto; }
.qr-or { margin: 30pt 0 4pt; font-size: 11pt; color: #34302A; }
.qr-url { margin: 0; font-size: 19pt; font-weight: 500; letter-spacing: 0.01em; color: #1C1A16; overflow-wrap: anywhere; }
.qr-note { margin: 16pt 0 0; font-size: 11pt; color: #6B655B; }
.qr-foot { margin-top: auto; padding-top: 14pt; width: 100%; border-top: 1px solid #DDD6C6; font-size: 9pt; color: #6B655B; }
@media print {
  @page { size: letter; margin: 0; }
  .qr-body { background: #fff; }
  .qr-toolbar { display: none; }
  .qr-sheet { margin: 0; box-shadow: none; width: 8.5in; height: 11in; min-height: 0; }
}

/* ============================================================
   Phase C — Print tab, filed worksheets, dashboard card.
   ============================================================ */
.ws-tag-blue { border-color: rgba(143,169,204,0.5); color: var(--ink-blue-light); }
.ws-frow-name .ws-tag { font-family: 'DM Sans', sans-serif; }
.ws-options { margin: 0; padding: 0; border: none; display: flex; flex-direction: column; gap: 10px; }
.ws-option { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid rgba(245,237,216,0.12); border-radius: 8px; background: rgba(245,237,216,0.02); cursor: pointer; }
.ws-option:has(input:checked) { border-color: var(--gold); background: rgba(201,168,76,0.08); }
.ws-option input[type="radio"] { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--gold); flex-shrink: 0; }
.ws-option b { display: block; font-weight: 500; color: var(--cream); }
.ws-option > span > span { display: block; margin-top: 3px; font-size: 0.86rem; font-weight: 300; line-height: 1.5; color: var(--ink-soft); }
.ws-option-extra { margin-top: 10px !important; }
.ws-option-select { width: auto; max-width: 100%; }
.ws-inline-hint { margin: 0; align-self: center; }

/* dashboard.php card (only this card uses these rules there) */
.ws-adv-card {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin: 0 0 2.5rem;
  padding: 18px 22px;
  border: 1px solid rgba(143,169,204,0.45);
  border-radius: 10px;
  background: rgba(143,169,204,0.06);
  text-align: left;
}
.ws-adv-text { flex: 999 1 320px; min-width: 0; }
.ws-adv-head { position: relative; display: flex; align-items: center; gap: 10px; }
.ws-adv-title { margin: 0; font-family: 'Playfair Display', serif; font-weight: 400; font-size: 1.3rem; color: var(--cream); }
.ws-adv-sub { margin: 6px 0 0; font-size: 0.88rem; font-weight: 300; color: var(--ink-soft); }
.ws-adv-btn { flex: 0 0 auto; }
.ws-adv-info { position: relative; }
.ws-adv-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(143,169,204,0.7);
  background: transparent;
  color: var(--ink-blue-light);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.95rem;
  cursor: pointer;
}
.ws-adv-i:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ws-adv-info.is-open .ws-adv-i { background: rgba(143,169,204,0.15); }
.ws-adv-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 10;
  width: min(360px, 80vw);
  padding: 14px 16px;
  background: var(--ink);
  border: 1px solid rgba(143,169,204,0.5);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.5);
}
.ws-adv-tip p { margin: 0 0 8px; font-size: 0.84rem; line-height: 1.55; color: var(--ink-soft); }
.ws-adv-tip p:last-child { margin-bottom: 0; }
.ws-adv-tip .ws-adv-tip-title { color: var(--cream); font-weight: 500; font-size: 0.9rem; }
.ws-options.ws-mt { margin-top: 1.4rem; }

/* Round 2 — course first, clearer Activity, demo card */
.ws-btn { min-height: 44px; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.btn-ghost.ws-btn { border: 1px solid rgba(201,168,76,0.4); background: transparent; }
.ws-left { margin: 0 0 14px; max-width: none; text-align: left; }
.ws-left b { font-weight: 500; color: var(--cream); }
.ws-table td small { display: block; margin-top: 2px; font-size: 0.78rem; color: rgba(245,237,216,0.5); }
.ws-start { padding: 2rem 2rem 2.25rem; border: 1px dashed rgba(201,168,76,0.4); border-radius: 12px; }
.ws-start-title { margin: 0 0 1.4rem; font-family: 'Playfair Display', serif; font-weight: 400; font-size: 1.75rem; color: var(--cream); }
.ws-start-steps { list-style: none; margin: 0 0 1.75rem; padding: 0; display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .ws-start-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; } }
.ws-start-steps li { display: flex; gap: 14px; align-items: flex-start; }
.ws-start-steps b { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold); font-family: 'Playfair Display', serif; font-weight: 400; }
.ws-start-steps span { display: block; font-size: 0.9rem; line-height: 1.55; color: var(--ink-soft); }
.ws-start-steps span:first-child { font-size: 1rem; color: var(--cream); margin-bottom: 3px; }
.ws-new-course-panel { margin: 0 0 1.25rem; padding: 16px 18px; border: 1px solid rgba(201,168,76,0.35); border-radius: 10px; background: var(--ink-mid); }
.ws-new-course-panel[hidden] { display: none; }
.ws-first-unit { padding: 2rem 1.5rem; text-align: center; border-top: 1px solid rgba(201,168,76,0.12); }
.ws-first-unit-title { margin: 0 0 6px; font-family: 'Playfair Display', serif; font-size: 1.25rem; color: var(--cream); }
.ws-first-unit-text { margin: 0 auto 1.1rem; max-width: 28rem; font-size: 0.9rem; line-height: 1.55; color: var(--ink-soft); }
.ws .ws-alert { margin-bottom: 1rem; }
.hub-demo { max-width: 340px; margin: 0 auto; padding: 24px; text-align: center; border: 1px solid rgba(201,168,76,0.35); border-radius: 12px; background: var(--ink-mid); }
.hub-demo-title { margin: 6px 0 0; font-family: 'Playfair Display', serif; font-weight: 400; font-size: 1.5rem; color: var(--cream); }
.hub-demo-qr { width: 180px; height: 180px; margin: 14px auto 10px; background: #fff; border-radius: 6px; padding: 8px; box-sizing: border-box; }
.hub-demo-qr svg { display: block; width: 100%; height: 100%; }
.hub-demo-note { margin: 0 0 14px; font-size: 0.86rem; color: var(--ink-soft); }
@media (max-width: 899px) { .hub-demo-qr { display: none; } .hub-demo-title { display: none; } } /* already on a phone: just the button */

/* the (i): shown when tapped/clicked open; with a mouse, also on hover or keyboard focus */
.ws-adv-info.is-open .ws-adv-tip { display: block; }
@media (hover: hover) and (pointer: fine) {
  .ws-adv-info:hover .ws-adv-tip,
  .ws-adv-info:focus-within .ws-adv-tip { display: block; }
}
.ws-adv-tip { padding-right: 40px; }
.ws-adv-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: rgba(245,237,216,0.7);
  font-size: 1.3rem;
  cursor: pointer;
}
.ws-adv-close:hover { color: var(--gold); }
@media (max-width: 599px) {
  /* on a phone the note spans the card (the card is position: relative) */
  .ws-adv-info { position: static; }
  .ws-adv-tip { left: 12px; right: 12px; top: 58px; width: auto; }
}
.ws-save-summary { margin: 10px 0 0; text-align: center; font-size: 0.88rem; color: var(--ink-soft); }

/* QR sheet footer (round 3, owner): the worksheets' footer, logo in color */
.qr-foot { display: flex; flex-direction: column; align-items: center; gap: 4pt; }
.qr-foot-made { font-size: 9pt; color: #6B655B; }
.qr-brand { display: inline-flex; align-items: center; line-height: 1; }
.qr-brand-text { font-family: 'Playfair Display', serif; font-weight: 400; font-size: 12pt; color: #1C1A16; }
.qr-brand-text:first-child { margin-right: 1pt; }
.qr-brand svg + .qr-brand-text { margin-left: 1pt; }

/* QR sheet: three learning benefits under the code (round 3) */
.qr-benefits { display: flex; width: 100%; margin-top: 30pt; }
.qr-benefit { flex: 1 1 0; min-width: 0; padding: 0 11pt; text-align: center; }
.qr-benefit + .qr-benefit { border-left: 1px solid #DDD6C6; }
.qr-benefit-t { margin: 0 0 6pt; font-family: 'Playfair Display', serif; font-weight: 400; font-size: 14.5pt; color: #1C1A16; }
.qr-benefit-d { margin: 0; font-size: 11pt; line-height: 1.55; color: #4A453D; }
@media (max-width: 640px) { .qr-benefits { flex-direction: column; gap: 14pt; } .qr-benefit + .qr-benefit { border-left: none; } }

/* Activity: updated time + Refresh (round 3) */
.ws-activity-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin: -4px 0 14px; }
.ws-activity-bar .ws-hint { margin: 0; }

/* Round 5 — a workstation: plain header, clickable rows */
.ws-back-left { margin: 0 0 14px; }
.ws-infobar { margin-bottom: 1.5rem; padding: 4px 20px; border: 1px solid rgba(201,168,76,0.3); border-radius: 10px; background: var(--ink-mid); }
.ws-inforow { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 10px 0; }
.ws-inforow + .ws-inforow { border-top: 1px solid rgba(201,168,76,0.12); }
.ws-info-k { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.ws-info-v { min-width: 0; font-size: 1.08rem; color: var(--cream); overflow-wrap: anywhere; }
.ws-info-v small { margin-left: 10px; font-size: 0.82rem; color: rgba(245,237,216,0.55); white-space: nowrap; }
.ws-info-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.ws-info-acts .ws-text-btn { min-height: 38px; }
.ws-info-v .ws-title-edit { justify-content: flex-start; }
@media (max-width: 599px) {
  .ws-inforow { grid-template-columns: 1fr; gap: 2px; }
  .ws-info-acts { justify-content: flex-start; margin-left: -8px; }
  .ws-info-v small { display: block; margin: 2px 0 0; }
}
.ws-row-link { text-decoration: none; color: var(--cream); cursor: pointer; }
.ws-row-link:hover { background: rgba(201,168,76,0.06); }
.ws-row-link:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.ws-row-main { flex: 999 1 220px; min-width: 0; }
.ws-row-title { display: block; font-size: 1rem; }
.ws-row-meta { display: block; margin-top: 2px; font-size: 0.78rem; color: rgba(245,237,216,0.55); }
.ws-row-meta-blue { color: var(--ink-blue-light); }
.ws-row-chev { flex-shrink: 0; width: 9px; height: 9px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); transform: rotate(-45deg); margin-left: 4px; }
.ws-card-plays { margin: 8px 0 0; font-size: 0.86rem; color: var(--ink-soft); }
.ws-card-plays b { font-family: 'Playfair Display', serif; font-weight: 400; font-size: 1.1rem; color: var(--gold); }

/* Round 6 — color: each course highlighted in green; its units plain, marked by a green dot */
:root { --ws-course: #52A675; }
.ws-course { border-left: 6px solid var(--ws-course); border-color: rgba(82,166,117,0.45); border-left-color: var(--ws-course); }
.ws-course-head { background: linear-gradient(90deg, rgba(82,166,117,0.16), transparent 65%); }
.ws-course-head .ws-chev { border-color: var(--ws-course); }
.ws-course-head .ws-num b { color: var(--ws-course); }
.ws-level {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 50px;
  border: 1px solid rgba(245,237,216,0.25);
  color: rgba(245,237,216,0.6);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: 3px;
}
.ws-level-course { border-color: var(--ws-course); color: var(--ws-course); vertical-align: 5px; }
.ws-row-link { padding-left: 24px; }
.ws-row-dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--ws-course); margin-right: 2px; }
.ws-inforow-course .ws-info-k { color: var(--ws-course); }
.ws-inforow-course { box-shadow: inset 4px 0 0 var(--ws-course); margin-left: -20px; padding-left: 20px; background: linear-gradient(90deg, rgba(82,166,117,0.12), transparent 60%); }
.ws-inforow-unit .ws-info-k { display: inline-flex; align-items: center; gap: 8px; color: rgba(245,237,216,0.6); }
.ws-infobar { overflow: hidden; }

/* Round 6b — units highlighted in blue under each green course; no COURSE/UNIT words in the list */
:root { --ws-unit: #6B9BD1; }
.ws-row-unit { box-shadow: inset 4px 0 0 var(--ws-unit); background: linear-gradient(90deg, rgba(107,155,209,0.13), transparent 60%); }
.ws-row-unit:hover { background: linear-gradient(90deg, rgba(107,155,209,0.22), rgba(107,155,209,0.04) 70%); }
.ws-row-unit .ws-row-chev { border-color: var(--ws-unit); }
.ws-row-unit .ws-num b { color: var(--ws-unit); }
.ws-inforow-unit { box-shadow: inset 4px 0 0 var(--ws-unit); margin-left: -20px; padding-left: 20px; background: linear-gradient(90deg, rgba(107,155,209,0.12), transparent 60%); }
.ws-inforow-unit .ws-info-k { color: var(--ws-unit); }

/* Round 6c — units sit indented under their course, like a submenu */
.ws-course-body .ws-row-link { margin-left: 40px; padding-left: 18px; border-top-color: rgba(201,168,76,0.12); }
.ws-course-body .ws-row-link:first-child { margin-top: 2px; }
.ws-course-body .ws-course-foot { padding-left: 40px; }
.ws-course-body .ws-course-foot .ws-add-unit { padding-left: 18px; }
@media (max-width: 599px) {
  .ws-course-body .ws-row-link { margin-left: 18px; padding-left: 14px; }
  .ws-course-body .ws-course-foot { padding-left: 18px; }
  .ws-course-body .ws-course-foot .ws-add-unit { padding-left: 14px; }
}

/* Round 7 (owner chose A) — the course row opens/closes; a gear opens Course settings */
.ws-course-headrow { display: flex; align-items: center; gap: 6px; padding-right: 16px; background: linear-gradient(90deg, rgba(82,166,117,0.16), transparent 65%); }
.ws-course-headrow .ws-course-head { flex: 1 1 auto; min-width: 0; background: none; }
.ws-course-gear {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(82,166,117,0.55);
  color: var(--ws-course);
  transition: background .2s, border-color .2s, transform .3s;
}
.ws-course-gear:hover { background: rgba(82,166,117,0.14); border-color: var(--ws-course); }
.ws-course-gear:hover svg { transform: rotate(45deg); transition: transform .3s; }
.ws-course-gear:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ws-course-foot { justify-content: flex-start; }
@media (max-width: 599px) { .ws-course-headrow { padding-right: 10px; } .ws-course-gear { width: 40px; height: 40px; } }
/* Course activity (after v4.12): the Total row */
.ws-table .ws-total-row td { border-top: 1px solid rgba(201,168,76,0.4); font-weight: 500; }
.ws-course-activity .ws-activity-bar { margin-top: -28px; }

/* Course settings: units in blue, the course in green — same meaning as the main list */
.ws-checks .ws-check-row { padding-left: 14px; margin-bottom: 4px; border-bottom: none; border-radius: 0 6px 6px 0;
  box-shadow: inset 4px 0 0 var(--ws-unit); background: linear-gradient(90deg, rgba(107,155,209,0.13), transparent 60%); }
.ws-table tr.ws-act-unit td:first-child { box-shadow: inset 4px 0 0 var(--ws-unit); padding-left: 16px; background: linear-gradient(90deg, rgba(107,155,209,0.10), transparent 90%); }
.ws-table tr.ws-act-course td:first-child { box-shadow: inset 4px 0 0 var(--ws-course); padding-left: 16px; background: linear-gradient(90deg, rgba(82,166,117,0.10), transparent 90%); }

/* Round 8 (owner chose A, in blue): units in the course review */
.ws-checks .ws-unit-pick { gap: 14px; min-height: 52px; padding-right: 16px; }
.ws-unit-dot { flex: 0 0 11px; width: 11px; height: 11px; border-radius: 50%; background: var(--ws-unit); }
.ws-unit-pick.is-off .ws-unit-dot { background: transparent; border: 1.5px solid rgba(245,237,216,0.45); }
.ws-unit-pick-name { flex: 1 1 auto; min-width: 0; }
.ws-unit-state { margin-left: auto; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ws-unit); white-space: nowrap; }
.ws-unit-pick.is-off { box-shadow: inset 4px 0 0 rgba(107,155,209,0.35); background: linear-gradient(90deg, rgba(107,155,209,0.05), transparent 60%); color: rgba(245,237,216,0.55); }
.ws-unit-pick.is-off .ws-unit-state { color: rgba(245,237,216,0.45); }
.ws-unit-pick:hover { background: linear-gradient(90deg, rgba(107,155,209,0.2), rgba(107,155,209,0.03) 70%); }
.ws-unit-pick:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; } /* keyboard only */

/* Plain text links inside Study Sets text (hints, notes) — gold, never the
   browser's default blue/purple, visited or not. */
.ws-main p a:not([class]), .ws p a:not([class]),
.ws-main p a:not([class]):visited, .ws p a:not([class]):visited { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.ws-main p a:not([class]):hover, .ws p a:not([class]):hover { color: var(--gold-light); }
