/* IDTC Student Portal
   Palette taken from the IDTC mandala: maroon, gold, unbleached paper.
   The studio shifts to an indigo rail so staff always know where they are. */

:root[data-theme="light"] {
  --ink:        #2B0D11;
  --ink-soft:   #6B5148;
  --ink-faint:  #9A8478;
  --paper:      #FBF6EE;
  --surface:    #FFFFFF;
  --surface-2:  #F4EDE2;
  --line:       #E4D8C7;
  --line-soft:  #EFE6D8;
  --accent:     #8E1B22;
  --accent-dim: #A84046;
  --gold:       #B08325;
  --gold-soft:  #F0E4C2;
  --ok:         #2F6B43;
  --ok-bg:      #E7F1E9;
  --bad:        #A32229;
  --bad-bg:     #F8E9E9;
  --shadow:     0 1px 2px rgba(43,13,17,.05), 0 8px 24px -14px rgba(43,13,17,.18);
  --rail-bg:    #2B0D11;
  --rail-ink:   #EBDCC8;
  --rail-dim:   #A98F7B;
}

:root[data-theme="dark"] {
  --ink:        #F2E7D8;
  --ink-soft:   #B7A492;
  --ink-faint:  #8A7869;
  --paper:      #140609;
  --surface:    #1E0C10;
  --surface-2:  #2A1218;
  --line:       #3C1F26;
  --line-soft:  #2E161C;
  --accent:     #DC6F76;
  --accent-dim: #B9525A;
  --gold:       #E0B759;
  --gold-soft:  #463617;
  --ok:         #7DC694;
  --ok-bg:      #17301F;
  --bad:        #EE8B8F;
  --bad-bg:     #34161A;
  --shadow:     0 1px 2px rgba(0,0,0,.4), 0 8px 28px -16px rgba(0,0,0,.8);
  --rail-bg:    #170709;
  --rail-ink:   #EBDCC8;
  --rail-dim:   #927C6A;
}

/* The studio wears indigo so nobody confuses the two areas at a glance. */
.idtc-body.is-studio {
  --rail-bg:  #16182B;
  --rail-ink: #DFE2F2;
  --rail-dim: #8489A8;
}
:root[data-theme="dark"] .idtc-body.is-studio { --rail-bg: #0F111F; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body.idtc-body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Karla", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.012em;
  margin: 0;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-dim); }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 3px;
}

img { max-width: 100%; height: auto; }

.idtc-skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--accent); color: #fff; padding: 10px 18px; }
.idtc-skip:focus { left: 8px; top: 8px; }

.idtc-quiet { color: var(--ink-faint); }
.idtc-bad { color: var(--bad); }
.idtc-center { text-align: center; }

/* ---------------------------------------------------------------
   Mandala motif, drawn from the IDTC logo. Used once per screen.
   --------------------------------------------------------------- */

.idtc-mandala {
  display: block; width: 34px; height: 34px; border-radius: 50%;
  background:
    radial-gradient(circle, var(--accent) 0 28%, transparent 29%),
    repeating-conic-gradient(var(--gold) 0deg 12deg, transparent 12deg 24deg);
  flex-shrink: 0;
}
.idtc-mandala--lg { width: 58px; height: 58px; }

/* ---------------------------------------------------------------
   Shell
   --------------------------------------------------------------- */

.idtc-shell { display: flex; min-height: 100vh; }

.idtc-preview {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  flex-wrap: wrap;
  background: var(--gold-soft);
  color: var(--ink);
  padding: 9px 18px;
  font-size: 13.6px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 45;
}
.idtc-preview a { font-weight: 600; }

.idtc-rail {
  width: 252px; flex-shrink: 0;
  background: var(--rail-bg);
  color: var(--rail-ink);
  display: flex; flex-direction: column;
  padding: 24px 16px 20px;
  position: sticky; top: 0; height: 100vh;
}
.has-preview .idtc-rail { height: calc(100vh - 41px); top: 41px; }

.idtc-rail__brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 8px 22px;
  border-bottom: 1px solid rgba(235,220,200,.14);
}
.idtc-rail__logo { width: 38px; height: 38px; object-fit: contain; }
.idtc-rail__name {
  font-family: "Fraunces", serif; font-size: 15.5px; font-weight: 600; line-height: 1.2;
  display: flex; flex-direction: column;
}
.idtc-rail__name small {
  font-family: "Karla", sans-serif; font-size: 11.5px; font-weight: 500;
  letter-spacing: .04em; color: var(--rail-dim); margin-top: 3px;
}

.idtc-nav { display: flex; flex-direction: column; gap: 2px; padding-top: 20px; flex: 1; }
.idtc-nav__link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 9px;
  color: var(--rail-dim); text-decoration: none;
  font-size: 14.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.idtc-nav__link:hover { background: rgba(235,220,200,.08); color: var(--rail-ink); }
.idtc-nav__link.is-current {
  background: rgba(235,220,200,.11); color: #fff;
  box-shadow: inset 2px 0 0 var(--gold);
}
.idtc-nav__icon { width: 19px; height: 19px; display: block; }
.idtc-nav__icon svg { width: 100%; height: 100%; display: block; }

.idtc-rail__foot {
  border-top: 1px solid rgba(235,220,200,.14);
  padding-top: 14px; display: flex; flex-direction: column; gap: 4px;
}
.idtc-who { display: flex; align-items: center; gap: 10px; padding: 6px 12px 12px; }
.idtc-who__av {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(235,220,200,.14); color: var(--rail-ink);
  font-weight: 700; font-size: 13px;
}
.idtc-who__text {
  display: flex; flex-direction: column; min-width: 0;
  font-size: 13.8px; font-weight: 600; color: var(--rail-ink);
}
.idtc-who__text small { font-size: 11.2px; font-weight: 500; color: var(--rail-dim); }
.idtc-rail__foot .idtc-quiet {
  padding: 9px 14px; border-radius: 8px;
  color: var(--rail-dim); font-size: 14px; text-decoration: none;
}
.idtc-rail__foot .idtc-quiet:hover { background: rgba(235,220,200,.08); color: var(--rail-ink); }

/* Theme toggle */
.idtc-theme {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; cursor: pointer;
  padding: 9px 14px; border-radius: 8px;
  color: var(--rail-dim); font: inherit; font-size: 14px;
  width: 100%; text-align: left;
}
.idtc-theme:hover { background: rgba(235,220,200,.08); color: var(--rail-ink); }
.idtc-theme__track {
  width: 34px; height: 19px; border-radius: 999px;
  background: rgba(235,220,200,.22); position: relative; flex-shrink: 0;
}
.idtc-theme__knob {
  position: absolute; top: 2.5px; left: 2.5px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
}
:root[data-theme="dark"] .idtc-theme__knob { transform: translateX(15px); }
.idtc-theme__text::after { content: attr(data-light); }
:root[data-theme="dark"] .idtc-theme__text::after { content: attr(data-dark); }
.idtc-theme--float {
  position: absolute; top: 18px; right: 18px;
  width: auto; padding: 8px; color: var(--ink-faint);
}
.idtc-theme--float:hover { background: var(--surface-2); }
.idtc-theme--float .idtc-theme__track { background: var(--line); }

/* Main column */
.idtc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.idtc-topbar {
  display: none; align-items: center; gap: 14px;
  padding: 11px 18px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.idtc-topbar__title { font-family: "Fraunces", serif; font-size: 17px; font-weight: 600; flex: 1; }
.idtc-burger {
  background: none; border: 0; padding: 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; width: 32px;
}
.idtc-burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
.idtc-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}

.idtc-content { padding: 38px 42px 72px; max-width: 1140px; width: 100%; flex: 1; }
.idtc-scrim { position: fixed; inset: 0; background: rgba(20,6,9,.5); z-index: 30; border: 0; }
.idtc-tabs { display: none; }

/* ---------------------------------------------------------------
   Headings
   --------------------------------------------------------------- */

.idtc-pagehead { margin-bottom: 26px; }
.idtc-pagehead h1 { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 7px; }
.idtc-pagehead p { margin: 0; color: var(--ink-soft); max-width: 62ch; }
.idtc-pagehead--split { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

.idtc-block { margin-bottom: 42px; }
.idtc-block__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; padding-bottom: 11px;
  border-bottom: 1px solid var(--line-soft);
}
.idtc-block__head h2 { font-size: 19.5px; }
.idtc-block__head a { font-size: 14px; text-decoration: none; font-weight: 600; }
.idtc-block__head a:hover { text-decoration: underline; }

.idtc-count { color: var(--ink-faint); font-size: 13.5px; margin: 0 0 15px; }
.idtc-fineprint { font-size: 12.8px; color: var(--ink-faint); margin: 0; }
.idtc-hint { margin: 0; font-size: 12.8px; color: var(--ink-faint); }
.idtc-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------------------------------------------------------------
   Student hero
   --------------------------------------------------------------- */

.idtc-hero {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  padding: 32px 34px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 38px;
}
.idtc-hero__text { position: relative; z-index: 2; }
.idtc-hero__greet { margin: 0 0 4px; color: var(--ink-soft); font-size: 14.5px; }
.idtc-hero h1 { font-size: clamp(27px, 4vw, 39px); margin-bottom: 15px; }
.idtc-hero__note { margin: 0; color: var(--ink-soft); font-size: 14.5px; max-width: 46ch; }
.idtc-hero__mandala {
  position: absolute; right: -66px; top: 50%; transform: translateY(-50%);
  width: 248px; height: 248px; border-radius: 50%;
  opacity: .13; pointer-events: none;
  background:
    radial-gradient(circle, var(--accent) 0 22%, transparent 23%),
    repeating-conic-gradient(from 0deg, var(--gold) 0deg 9deg, transparent 9deg 18deg),
    radial-gradient(circle, transparent 0 58%, var(--accent) 59% 64%, transparent 65%);
}

/* ---------------------------------------------------------------
   Chips, pills, flags
   --------------------------------------------------------------- */

.idtc-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; }
.idtc-chips--sm { margin: 8px 0 0; }
.idtc-chip {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft);
  padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
}

.idtc-pill {
  display: inline-block;
  background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok);
  padding: 2px 10px; border-radius: 999px; font-size: 12.2px; font-weight: 600;
}
.idtc-pin {
  font-size: 10.8px; font-weight: 700; letter-spacing: .04em;
  background: var(--gold-soft); color: var(--gold);
  padding: 2px 7px; border-radius: 999px; vertical-align: middle; margin-left: 6px;
}
.idtc-pin--bad, .idtc-pill.idtc-pin--bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }

.idtc-flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.idtc-flag { position: relative; padding-left: 24px; font-size: 14.4px; color: var(--ink-soft); }
.idtc-flag::before {
  content: ""; position: absolute; left: 4px; top: 9px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
}
.idtc-flag--bad::before { background: var(--bad); }

.idtc-tick { color: var(--ok); font-weight: 600; }

.idtc-pre {
  background: #16182B; color: #DFE2F2;
  padding: 14px 16px; border-radius: 10px;
  font-size: 13px; line-height: 1.5; overflow-x: auto; margin: 12px 0 0;
}

/* ---------------------------------------------------------------
   Stats
   --------------------------------------------------------------- */

.idtc-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 38px;
}
.idtc-stat {
  display: flex; flex-direction: column; gap: 3px;
  padding: 22px 24px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.idtc-stat:hover { border-color: var(--accent); transform: translateY(-2px); color: inherit; }
.idtc-stat__n { font-family: "Fraunces", serif; font-size: 32px; font-weight: 600; line-height: 1.05; }
.idtc-stat__l { font-size: 13.2px; color: var(--ink-faint); }

/* ---------------------------------------------------------------
   Resource cards
   --------------------------------------------------------------- */

.idtc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }

.idtc-card {
  display: flex; flex-direction: column; padding: 20px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: inherit; min-height: 166px;
  transition: border-color .15s, transform .15s;
}
.idtc-card:hover { border-color: var(--accent); transform: translateY(-2px); color: inherit; }
.idtc-card__kind {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--accent); margin-bottom: 13px;
}
.idtc-card__kind svg { width: 19px; height: 19px; }
.idtc-card__kind--video { background: var(--gold-soft); color: var(--gold); }
.idtc-card__meta { font-size: 11.5px; font-weight: 600; letter-spacing: .03em; color: var(--ink-faint); margin-bottom: 6px; }
.idtc-card__title { font-size: 16.2px; font-weight: 600; line-height: 1.3; margin-bottom: auto; }
.idtc-card__foot { display: flex; gap: 14px; margin-top: 15px; font-size: 12.5px; color: var(--ink-faint); }

/* ---------------------------------------------------------------
   Notices
   --------------------------------------------------------------- */

.idtc-notices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.idtc-notice { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 19px 22px; }
.idtc-notice.is-pinned { border-left: 3px solid var(--gold); }
.idtc-notice__top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 7px; }
.idtc-notice__top h2, .idtc-notice__top h3 { font-size: 17.5px; }
.idtc-notice__top time { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; }
.idtc-notice__body { color: var(--ink-soft); font-size: 14.8px; }
.idtc-notice__body p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------
   Single resource
   --------------------------------------------------------------- */

.idtc-single { max-width: 860px; }
.idtc-back { display: inline-block; margin-bottom: 20px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-soft); }
.idtc-back:hover { color: var(--accent); }
.idtc-back::before { content: "\2190"; margin-right: 7px; }

.idtc-single__head { margin-bottom: 22px; }
.idtc-single__eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--gold); }
.idtc-single__head h1 { font-size: clamp(25px, 3.4vw, 33px); margin-bottom: 12px; }
.idtc-single__meta { display: flex; flex-wrap: wrap; gap: 8px; }
.idtc-single__meta span {
  font-size: 12.5px; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 999px;
}

.idtc-player { border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line); margin-bottom: 24px; }
.idtc-player video { display: block; width: 100%; max-height: 72vh; background: #000; }
.idtc-player--audio { background: var(--surface); padding: 22px; }
.idtc-player--audio audio { width: 100%; display: block; }

.idtc-pdf { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 24px; background: var(--surface-2); }
.idtc-pdf iframe { display: block; width: 100%; height: 76vh; border: 0; }

.idtc-prose { max-width: 68ch; color: var(--ink-soft); }
.idtc-prose h2, .idtc-prose h3 { color: var(--ink); margin: 26px 0 10px; }
.idtc-prose h2 { font-size: 20.5px; }
.idtc-prose h3 { font-size: 17.5px; }
.idtc-prose p { margin: 0 0 15px; }
.idtc-prose ul, .idtc-prose ol { margin: 0 0 15px; padding-left: 22px; }
.idtc-prose li { margin-bottom: 6px; }
.idtc-prose img { border-radius: 10px; }

/* ---------------------------------------------------------------
   Filters
   --------------------------------------------------------------- */

.idtc-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; }
.idtc-search { display: flex; flex: 1; min-width: 220px; }
.idtc-search input {
  flex: 1; min-width: 0; padding: 10px 15px;
  border: 1px solid var(--line); border-right: 0; border-radius: 9px 0 0 9px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px;
}
.idtc-search button {
  padding: 10px 18px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; border-radius: 0 9px 9px 0;
  font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.idtc-search button:hover { background: var(--accent-dim); border-color: var(--accent-dim); }

.idtc-selects { display: flex; gap: 10px; flex-wrap: wrap; }
.idtc-selects select {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}

.idtc-quickfilters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.idtc-quickfilters a {
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); text-decoration: none; font-size: 13.2px; font-weight: 600;
}
.idtc-quickfilters a:hover { border-color: var(--accent); color: var(--accent); }
.idtc-quickfilters a.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Section tabs inside a page */
.idtc-tabstrip { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.idtc-tabstrip__link {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px;
  color: var(--ink-soft); text-decoration: none; font-size: 14.5px; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.idtc-tabstrip__link:hover { color: var(--ink); }
.idtc-tabstrip__link.is-current { color: var(--accent); border-bottom-color: var(--accent); }
.idtc-tabstrip__link span {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 8px; font-size: 11.5px; font-weight: 600; color: var(--ink-faint);
}
.idtc-tabstrip__link.is-current span { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------------------------------------------------------------
   Rows and tables
   --------------------------------------------------------------- */

.idtc-table { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--surface); }
.idtc-table--plain { border: 0; border-radius: 0; background: none; }

.idtc-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.idtc-row:last-child { border-bottom: 0; }
.idtc-row:hover { background: var(--surface-2); }

.idtc-row__icon {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  flex-shrink: 0; background: var(--surface-2); color: var(--accent);
}
.idtc-row__icon svg { width: 18px; height: 18px; }
.idtc-row__av {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  flex-shrink: 0; background: var(--accent); color: #fff; font-weight: 700; font-size: 13.5px;
}
.idtc-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.idtc-row__main strong { font-size: 15.2px; font-weight: 600; }
.idtc-row__sub { font-size: 12.8px; color: var(--ink-faint); }
.idtc-row__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.idtc-row__tags em {
  font-style: normal; font-size: 11.2px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft);
  padding: 2px 8px; border-radius: 999px;
}
.idtc-row__tags--warn em { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.idtc-row__acts { display: flex; gap: 14px; flex-shrink: 0; font-size: 13.5px; font-weight: 600; }
.idtc-row__acts a { text-decoration: none; }
.idtc-row__acts a:hover { text-decoration: underline; }

.idtc-nest { padding-left: 22px; position: relative; }
.idtc-nest::before {
  content: ""; position: absolute; left: 6px; top: 50%;
  width: 9px; height: 1px; background: var(--line);
}

/* ---------------------------------------------------------------
   Forms
   --------------------------------------------------------------- */

.idtc-form { display: flex; flex-direction: column; gap: 17px; }
.idtc-form h2 { font-size: 19px; margin-top: 6px; }

.idtc-field { display: flex; flex-direction: column; gap: 6px; }
.idtc-field label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.idtc-field--mid { max-width: 240px; }

.idtc-field input[type="text"],
.idtc-field input[type="email"],
.idtc-field input[type="password"],
.idtc-field input[type="search"],
.idtc-field input[type="date"],
.idtc-field input[type="number"],
.idtc-field select,
.idtc-field textarea {
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; width: 100%;
}
.idtc-field textarea { line-height: 1.55; resize: vertical; min-height: 96px; }
.idtc-field select { cursor: pointer; }
.idtc-field input:disabled { background: var(--surface-2); color: var(--ink-faint); }
.idtc-field input:focus, .idtc-field select:focus, .idtc-field textarea:focus { border-color: var(--accent); }

.idtc-field input[type="file"] {
  padding: 11px 14px; border: 1px dashed var(--line); border-radius: 9px;
  background: var(--surface-2); color: var(--ink-soft);
  font: inherit; font-size: 14px; width: 100%; cursor: pointer;
}
.idtc-field input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.idtc-field input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }

.idtc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.idtc-cols { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 24px; align-items: start; }

.idtc-peek { position: relative; display: flex; }
.idtc-peek input { padding-right: 62px !important; }
.idtc-peek__btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; color: var(--ink-faint);
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 8px; border-radius: 6px;
}
.idtc-peek__btn:hover { color: var(--accent); background: var(--surface-2); }

.idtc-row--inline, .idtc-form .idtc-row:not(.idtc-table .idtc-row) {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; font-size: 13.8px;
  padding: 0; border: 0; background: none;
}
.idtc-form .idtc-row:hover { background: none; }
.idtc-form .idtc-row a { text-decoration: none; font-weight: 600; }
.idtc-form .idtc-row a:hover { text-decoration: underline; }

.idtc-check { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); cursor: pointer; font-size: 14px; }
.idtc-check input { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }

/* Targeting dimensions: program, class, age group, level */
.idtc-dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.idtc-dim { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); overflow: hidden; }
.idtc-dim > strong {
  display: block; padding: 10px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: 12.8px; font-weight: 700; color: var(--ink-soft);
}
.idtc-dim__opts { display: flex; flex-direction: column; gap: 7px; padding: 13px 14px; max-height: 190px; overflow-y: auto; }

.idtc-btn {
  display: inline-block; padding: 12px 24px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: 9px; font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; text-align: center; text-decoration: none; transition: background .15s;
}
.idtc-btn:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }
.idtc-btn--ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.idtc-btn--ghost:hover { background: var(--surface-2); color: var(--accent); border-color: var(--accent); }
.idtc-btn--block { display: block; width: 100%; }

.idtc-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 26px; }
.idtc-panel--quiet { background: var(--surface-2); }

.idtc-facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 9px 20px; font-size: 14px; align-items: baseline; }
.idtc-facts dt { color: var(--ink-faint); }
.idtc-facts dd { margin: 0; color: var(--ink); font-weight: 500; }
.idtc-facts code { font-size: 12.5px; word-break: break-all; }

.idtc-note { padding: 12px 16px; border-radius: 10px; font-size: 14.2px; margin-bottom: 18px; border: 1px solid transparent; }
.idtc-note--error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.idtc-note--success { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }

.idtc-empty {
  padding: 50px 30px; text-align: center;
  border: 1px dashed var(--line); border-radius: 15px; background: var(--surface);
}
.idtc-empty p { margin: 0; font-family: "Fraunces", serif; font-size: 18px; }
.idtc-empty__sub {
  margin-top: 8px !important; font-family: "Karla", sans-serif !important;
  font-size: 14.2px !important; color: var(--ink-faint);
}

/* Upload overlay, shown while a large video is sent */
.idtc-uploading {
  position: fixed; inset: 0; background: rgba(20,6,9,.74);
  display: grid; place-items: center; z-index: 60;
  color: #F2E7D8; text-align: center; padding: 24px;
}
.idtc-uploading p { font-family: "Fraunces", serif; font-size: 19px; margin: 0 0 6px; }
.idtc-uploading small { color: #A98F7B; font-size: 13.5px; }
.idtc-uploading__bar { width: min(280px, 76vw); height: 4px; background: rgba(242,231,216,.2); border-radius: 999px; overflow: hidden; margin: 18px auto 0; }
.idtc-uploading__fill { display: block; height: 100%; width: 30%; background: var(--gold); animation: idtc-slide 1.1s ease-in-out infinite; }
@keyframes idtc-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(333%); } }

/* ---------------------------------------------------------------
   Sign-in
   --------------------------------------------------------------- */

.idtc-gate { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.idtc-gate__art { position: relative; background: #2B0D11; display: flex; align-items: flex-end; padding: 52px; overflow: hidden; }
.idtc-gate__mandala {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  width: 520px; height: 520px; border-radius: 50%; opacity: .3;
  background:
    radial-gradient(circle, #8E1B22 0 15%, transparent 16%),
    repeating-conic-gradient(from 0deg, #B08325 0deg 7.5deg, transparent 7.5deg 15deg),
    radial-gradient(circle, transparent 0 40%, #8E1B22 41% 46%, transparent 47%),
    radial-gradient(circle, transparent 0 62%, #B08325 63% 66%, transparent 67%);
  animation: idtc-turn 90s linear infinite;
}
@keyframes idtc-turn { to { transform: translate(-50%, -50%) rotate(360deg); } }

.idtc-gate__words { position: relative; z-index: 2; margin: 0; max-width: 34ch; }
.idtc-gate__words p { font-family: "Fraunces", serif; font-size: 25px; line-height: 1.35; color: #F2E7D8; margin: 0 0 14px; }
.idtc-gate__words cite { font-style: normal; font-size: 13px; letter-spacing: .05em; color: #A98F7B; }

.idtc-gate__panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--paper); }
.idtc-gate__inner { width: 100%; max-width: 372px; }
.idtc-gate__head { margin-bottom: 24px; }
.idtc-gate__logo { width: 60px; height: 60px; object-fit: contain; margin-bottom: 18px; }
.idtc-gate__head .idtc-mandala { margin-bottom: 18px; }
.idtc-gate__head h1 { font-size: 29px; margin-bottom: 8px; }
.idtc-gate__head p { margin: 0; color: var(--ink-soft); font-size: 14.8px; }
.idtc-gate__foot {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 12.8px; color: var(--ink-faint);
}
.idtc-gate__foot a { text-decoration: none; }
.idtc-gate__foot a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */

@media (max-width: 1040px) { .idtc-cols { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .idtc-gate { grid-template-columns: 1fr; } .idtc-gate__art { display: none; } }

@media (max-width: 860px) {
  .idtc-topbar { display: flex; }

  .idtc-rail {
    position: fixed; top: 0; bottom: 0; left: 0; height: 100%; z-index: 40;
    transform: translateX(-100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
  }
  .has-preview .idtc-rail { top: 0; height: 100%; }
  .idtc-rail.is-open { transform: translateX(0); }

  .idtc-content { padding: 24px 18px 104px; }

  .idtc-hero { padding: 24px 20px; margin-bottom: 28px; }
  .idtc-hero__mandala { width: 176px; height: 176px; right: -76px; opacity: .1; }

  .idtc-panel { padding: 20px 17px; }
  .idtc-pair { grid-template-columns: 1fr; }
  .idtc-dims { grid-template-columns: 1fr; }

  .idtc-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .idtc-card { padding: 16px; min-height: 146px; }
  .idtc-card__title { font-size: 15px; }

  .idtc-stats { grid-template-columns: 1fr 1fr; }
  .idtc-stat { padding: 18px 18px; }
  .idtc-stat__n { font-size: 27px; }

  .idtc-filters { flex-direction: column; align-items: stretch; }
  .idtc-selects select { flex: 1; min-width: 0; }
  .idtc-tabstrip { overflow-x: auto; flex-wrap: nowrap; }
  .idtc-tabstrip__link { white-space: nowrap; }

  .idtc-table .idtc-row { flex-wrap: wrap; }
  .idtc-row__acts { width: 100%; padding-left: 48px; }

  .idtc-pdf iframe { height: 62vh; }

  .idtc-tabs {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 35;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .idtc-tabs__link {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 4px 8px; font-size: 10.6px; font-weight: 600;
    color: var(--ink-faint); text-decoration: none;
  }
  .idtc-tabs__link svg { width: 21px; height: 21px; }
  .idtc-tabs__link.is-current { color: var(--accent); }
}

@media (min-width: 861px) { .idtc-scrim { display: none !important; } }

@media (max-width: 420px) {
  .idtc-grid { grid-template-columns: 1fr 1fr; }
  .idtc-hero h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .idtc-gate__mandala, .idtc-uploading__fill { animation: none; }
  .idtc-card:hover, .idtc-stat:hover { transform: none; }
  * { transition-duration: .01ms !important; }
}

@media print {
  .idtc-rail, .idtc-tabs, .idtc-topbar, .idtc-player, .idtc-preview { display: none !important; }
  .idtc-content { padding: 0; }
}

/* "Any" sits slightly apart from the specific choices it replaces */
.idtc-tick--any {
  padding-bottom: 9px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 600;
  color: var(--ink);
}
