:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: rgba(255,255,255,.82);
  --surface-solid: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: rgba(15, 23, 42, .08);
  --shadow: 0 18px 48px rgba(15, 23, 42, .08);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--accent-glow, rgba(52,87,255,.18)), transparent 34rem),
    linear-gradient(180deg, #fbfcff 0%, #f3f6fb 42%, #eef2f7 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent);
  outline-offset: 3px;
}

.app-shell {
  --topbar-offset: 0px;
  min-height: 100dvh;
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  background: rgba(250, 252, 255, .78);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.62);
  box-shadow: 0 14px 35px rgba(15,23,42,.06);
}

.eyebrow, .section-label {
  margin: 0 0 4px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 11px;
  font-weight: 800;
}

.ghost-icon, .solid-mini, .float-button, .primary-button, .ghost-button, .text-button, .settings-trigger, .switch-row, .settings-segmented button, .settings-action {
  border: 0;
  background: transparent;
}

.ghost-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
  display: grid;
  place-items: center;
  font-size: 19px;
}

.institution-strip {
  display: flex;
  gap: 8px;
  max-width: 980px;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
}
.institution-strip::-webkit-scrollbar { display: none; }

.topbar-row {
  width: min(980px, 100%);
  margin: 0 auto 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.settings-trigger {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: #0f172a;
  background: rgba(255,255,255,.82);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.06), 0 10px 24px rgba(15,23,42,.06);
  font-size: 18px;
  font-weight: 900;
}

.institution-chip {
  flex: 0 0 auto;
  border: 0;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  color: #334155;
  background: rgba(255,255,255,.76);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
  font-weight: 800;
  letter-spacing: -.01em;
}

.institution-chip.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-deep) 32%, var(--accent)));
  box-shadow:
    0 14px 34px var(--accent-glow),
    inset 0 0 0 1px rgba(255,255,255,.18);
}

.quick-selector {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(90px, 140px) 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 22px;
  background: rgba(255,255,255,.74);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
}

.quick-selector label {
  padding-left: 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.quick-selector select {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 17px;
  padding: 0 42px 0 14px;
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: 0 10px 30px rgba(15,23,42,.07);
  font-weight: 800;
  letter-spacing: -.015em;
}

.content-zone {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 18px 16px 0;
}

.overview-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.74)),
    radial-gradient(circle at 12% 0%, var(--accent-glow), transparent 38rem);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.86);
  padding: 22px;
}

.overview-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 30%, white));
}

.overview-title-row { display: flex; justify-content: space-between; gap: 18px; }
.overview-card h2 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(27px, 7vw, 52px);
  line-height: .95;
  letter-spacing: -.065em;
}
.overview-card p { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }

.edit-notice {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 0;
  padding: 16px;
  border-radius: 24px;
  background: #0f172a;
  color: white;
  box-shadow: 0 18px 40px rgba(15,23,42,.16);
}
.edit-notice p { margin: 3px 0 0; color: rgba(255,255,255,.74); font-size: 13px; }
.solid-mini {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  color: #0f172a;
  background: white;
  font-weight: 800;
}

.accordion-list { margin-top: 15px; display: grid; gap: 10px; }
.info-card {
  border-radius: 22px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 14px 38px rgba(15,23,42,.055), inset 0 0 0 1px rgba(15,23,42,.055);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.info-card.open { box-shadow: 0 20px 46px rgba(15,23,42,.075), inset 0 0 0 1px rgba(15,23,42,.055); }
.info-card:active { transform: scale(.995); }

.card-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 5px 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 15px;
  color: var(--text);
  text-align: left;
}
.card-marker {
  width: 5px;
  height: 40px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 9px 18px var(--accent-glow);
}
.card-labels { min-width: 0; }
.card-labels strong {
  display: block;
  font-size: 16px;
  letter-spacing: -.025em;
  line-height: 1.14;
}
.card-labels small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.toggle-symbol {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 900;
  font-size: 20px;
}
.card-panel {
  display: none;
  padding: 0 15px 15px 33px;
}
.info-card.open .card-panel { display: block; }

.script-box, .data-block {
  border-radius: 20px;
  background: rgba(248,250,252,.9);
  padding: 15px;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.055);
  margin-bottom: 10px;
}
.script-box {
  background: linear-gradient(135deg, var(--accent-soft), rgba(255,255,255,.88));
}
.script-box span {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.script-box p, .data-block p, .lead-text {
  margin: 0 0 10px;
  color: #334155;
  line-height: 1.62;
  font-size: 14px;
}
.script-box p:last-child, .data-block p:last-child { margin-bottom: 0; }
.script-box.compact p { font-size: 13px; }

.data-block h3 {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text);
  letter-spacing: -.01em;
}
.clean-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.clean-list li {
  position: relative;
  padding-left: 18px;
  color: #334155;
  line-height: 1.5;
  font-size: 14px;
}
.clean-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .66em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.clean-list.muted li { color: var(--muted); font-size: 12px; }

.pair-table { display: grid; gap: 8px; }
.pair-table > div, .simple-row {
  display: grid;
  grid-template-columns: minmax(110px, .55fr) 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 14px;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.05);
}
.pair-table strong, .simple-row strong { font-size: 13px; color: #0f172a; }
.pair-table span, .simple-row span { font-size: 13px; color: #475569; line-height: 1.45; }

.highlight-list { display: grid; gap: 10px; }
.highlight-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(248,250,252,.94);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.055);
}
.highlight-item > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-deep) 36%, var(--accent)));
  color: white;
  font-weight: 900;
  box-shadow: 0 12px 26px var(--accent-glow);
}
.highlight-item strong { display: block; margin-bottom: 3px; }
.highlight-item small { display: block; color: var(--accent-deep); font-weight: 800; margin-bottom: 6px; }
.highlight-item p { margin: 0; color: #475569; line-height: 1.52; font-size: 13px; }

.program-grid { display: grid; gap: 9px; }
.program-option {
  border: 0;
  border-radius: 20px;
  padding: 14px;
  text-align: left;
  background: rgba(248,250,252,.95);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.055);
}
.program-option strong { display: block; color: #0f172a; letter-spacing: -.02em; }
.program-option span { display: block; color: var(--muted); margin-top: 4px; font-size: 13px; }

.diploma-list { display: grid; gap: 10px; }
.diploma-list section {
  padding: 13px;
  border-radius: 18px;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.05);
}
.diploma-list strong, .diploma-list small { display: block; }
.diploma-list small { margin-top: 4px; color: var(--accent-deep); font-weight: 800; }
.diploma-list p, .diploma-list li { color: #475569; font-size: 13px; line-height: 1.5; }
.diploma-list ul { margin: 10px 0 0; padding-left: 18px; }

.card-toolbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 4px;
}
.text-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-weight: 850;
  font-size: 12px;
}

.floating-actions {
  position: fixed;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 25;
  display: flex;
  gap: 8px;
  flex-direction: column;
  align-items: flex-end;
}
.float-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  color: white;
  background: #0f172a;
  font-weight: 900;
  box-shadow: 0 18px 38px rgba(15,23,42,.2);
}
.float-button.secondary { background: var(--accent); box-shadow: 0 18px 38px var(--accent-glow); }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(15,23,42,.32);
  backdrop-filter: blur(6px);
}
.editor-drawer {
  position: fixed;
  z-index: 50;
  inset: auto 0 0;
  max-height: min(86dvh, 760px);
  overflow: auto;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0;
  background: rgba(255,255,255,.96);
  box-shadow: 0 -28px 80px rgba(15,23,42,.22);
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto 14px;
}
.drawer-head h2 { margin: 0; font-size: 26px; letter-spacing: -.045em; }
.edit-form { display: grid; gap: 12px; max-width: 900px; margin: 0 auto; }
.settings-panel {
  display: grid;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}
.settings-group {
  display: grid;
  gap: 10px;
  padding: 13px;
  border-radius: 24px;
  background: rgba(248,250,252,.86);
  border: 1px solid rgba(15,23,42,.055);
}
.settings-group-head {
  display: grid;
  gap: 2px;
}
.settings-group-head strong {
  color: #0f172a;
  font-size: 15px;
  letter-spacing: -.02em;
}
.settings-group-head span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}
.switch-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  text-align: left;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.055);
}
.switch-row strong,
.switch-row small {
  display: block;
}
.switch-row strong {
  color: #0f172a;
  font-size: 14px;
  letter-spacing: -.015em;
}
.switch-row small {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}
.switch-track {
  width: 48px;
  height: 28px;
  padding: 3px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .18s ease;
}
.switch-track b {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 4px 10px rgba(15,23,42,.18);
  transition: transform .18s ease;
}
.switch-row.on .switch-track {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-deep) 34%, var(--accent)));
  box-shadow: 0 9px 20px var(--accent-glow);
}
.switch-row.on .switch-track b {
  transform: translateX(20px);
}
.settings-segmented {
  display: grid;
  gap: 7px;
}
.settings-segmented > span {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.settings-segmented > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 18px;
  background: #e2e8f0;
}
.settings-segmented button {
  min-height: 36px;
  border-radius: 14px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}
.settings-segmented button.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-deep) 38%, var(--accent)));
  box-shadow: 0 10px 22px var(--accent-glow);
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-actions.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-action {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  color: #0f172a;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
  font-size: 12px;
  font-weight: 900;
}
.settings-action.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-deep) 34%, var(--accent)));
  box-shadow: 0 12px 26px var(--accent-glow);
}
.settings-action.danger {
  color: #7f1d1d;
  background: #fee2e2;
}
.version-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 16px;
  color: #64748b;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.055);
  font-size: 12px;
}
.version-row strong {
  color: #0f172a;
  font-size: 12px;
}
.field { display: grid; gap: 6px; }
.field span { font-weight: 900; color: #0f172a; font-size: 13px; }
.field small { color: var(--muted); font-size: 12px; }
.field input, .field textarea {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 13px 14px;
  background: #f8fafc;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.08);
}
.field textarea { resize: vertical; line-height: 1.5; }
.form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.96) 30%);
}
.primary-button, .ghost-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 900;
}
.primary-button { background: var(--accent); color: white; box-shadow: 0 14px 32px var(--accent-glow); }
.ghost-button { background: #f1f5f9; color: #0f172a; }
.inline-edit-form {
  gap: 10px;
  padding: 14px;
  border-radius: 21px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 72%, white), rgba(255,255,255,.94));
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}
.inline-edit-head {
  display: grid;
  gap: 2px;
}
.inline-edit-head span {
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.inline-edit-head strong {
  color: #0f172a;
  font-size: 16px;
  letter-spacing: -.02em;
}
.inline-edit-form .field {
  gap: 5px;
}
.inline-edit-form .field span {
  font-size: 12px;
}
.inline-edit-form .field input,
.inline-edit-form .field textarea {
  background: rgba(255,255,255,.9);
}
.inline-actions {
  position: static;
  justify-content: stretch;
  padding-top: 2px;
  background: transparent;
}
.inline-actions .primary-button {
  width: 100%;
}
.inline-editor-empty {
  padding: 14px;
  border-radius: 20px;
  background: rgba(248,250,252,.9);
  color: #475569;
}
.inline-editor-empty strong {
  display: block;
  color: #0f172a;
  margin-bottom: 4px;
}
.inline-editor-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 15px;
  border-radius: 999px;
  color: white;
  background: rgba(15,23,42,.94);
  box-shadow: 0 18px 45px rgba(15,23,42,.25);
  font-weight: 800;
  font-size: 13px;
}

@media (min-width: 760px) {
  .topbar { padding-left: 24px; padding-right: 24px; }
  .content-zone { padding-left: 24px; padding-right: 24px; }
  .accordion-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .info-card.open { grid-column: span 2; }
  .editor-drawer {
    left: 50%;
    transform: translateX(-50%);
    width: min(940px, calc(100vw - 32px));
    border-radius: 30px;
    bottom: 16px;
  }
}

@media (max-width: 430px) {
  .quick-selector { grid-template-columns: 1fr; gap: 6px; }
  .quick-selector label { padding-left: 8px; }
  .overview-card { padding: 20px 18px; }
  .pair-table > div, .simple-row { grid-template-columns: 1fr; gap: 4px; }
  .card-panel { padding-left: 15px; }
  .edit-notice { align-items: flex-start; flex-direction: column; }
}

/* r04 update polish */
:root {
  --shadow: 0 16px 42px rgba(15, 23, 42, .065);
}
.topbar {
  background: rgba(250, 252, 255, .84);
  border-bottom-color: rgba(15,23,42,.045);
  box-shadow: 0 10px 28px rgba(15,23,42,.045);
}
.overview-card,
.info-card,
.script-box,
.data-block,
.highlight-item,
.program-option,
.diploma-list section {
  border-color: rgba(15,23,42,.045);
}
.info-card {
  background: rgba(255,255,255,.82);
  box-shadow: 0 12px 34px rgba(15,23,42,.045), inset 0 0 0 1px rgba(15,23,42,.045);
}
.info-card.open {
  box-shadow: 0 18px 42px rgba(15,23,42,.06), inset 0 0 0 1px rgba(15,23,42,.05);
}
.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card-title-row strong { min-width: 0; }
.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: .02em;
  white-space: nowrap;
}
.status-pill.ok {
  color: #064e3b;
  background: #d1fae5;
}
.status-pill.pending {
  color: #78350f;
  background: #fef3c7;
}
.status-pill.neutral {
  color: #334155;
  background: #e2e8f0;
}
.source-details {
  margin: 2px 0 10px;
  border-radius: 16px;
  background: rgba(241,245,249,.72);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.055);
}
.source-details summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 900;
}
.source-details summary::-webkit-details-marker { display: none; }
.source-details p {
  margin: 0;
  padding: 0 12px 12px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}
.edit-notice {
  background: linear-gradient(135deg, #0f172a, color-mix(in srgb, var(--accent-deep) 70%, #0f172a));
}
.edit-notice-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.solid-mini.muted {
  color: white;
  background: rgba(255,255,255,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.solid-mini.danger {
  color: #7f1d1d;
  background: #fee2e2;
}
.selling-list .highlight-item {
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.92));
}
.card-toolbar {
  flex-wrap: wrap;
}
.text-button.edit {
  background: #0f172a;
  color: white;
}
@media (max-width: 430px) {
  .card-title-row { align-items: flex-start; flex-direction: column; gap: 5px; }
  .edit-notice-actions { justify-content: flex-start; }
  .text-button { flex: 1 1 auto; }
}


/* r04 update system */
.update-banner {
  width: min(980px, calc(100% - 32px));
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 24px;
  color: #0f172a;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.88)),
    radial-gradient(circle at 0% 0%, var(--accent-glow), transparent 24rem);
  box-shadow: 0 18px 44px rgba(15,23,42,.08), inset 0 0 0 1px rgba(15,23,42,.055);
}
.update-banner strong {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-deep);
  letter-spacing: -.015em;
}
.update-banner p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.update-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.update-button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 13px;
  color: #0f172a;
  background: #eef2f7;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.update-button.primary {
  color: white;
  background: var(--accent);
  box-shadow: 0 12px 26px var(--accent-glow);
}
@media (max-width: 560px) {
  .update-banner {
    align-items: flex-start;
    flex-direction: column;
  }
  .update-actions {
    width: 100%;
  }
  .update-button {
    flex: 1 1 auto;
  }
}


/* r05 UI/UX final polish */
:root {
  --bg: #f6f8fc;
  --surface: rgba(255,255,255,.86);
  --shadow: 0 18px 46px rgba(15, 23, 42, .055);
}
body {
  background:
    radial-gradient(circle at 12% -10%, var(--accent-glow, rgba(52,87,255,.16)), transparent 28rem),
    radial-gradient(circle at 100% 4%, rgba(255,255,255,.9), transparent 24rem),
    linear-gradient(180deg, #fbfcff 0%, #f6f8fc 48%, #eef2f7 100%);
}
.topbar {
  padding-bottom: 12px;
  background: rgba(251, 252, 255, .88);
  border-bottom: 1px solid rgba(15, 23, 42, .04);
}
.institution-strip {
  margin-bottom: 10px;
}
.topbar-row .institution-strip {
  margin-bottom: 0;
}
.quick-selector {
  grid-template-columns: 1fr;
  gap: 5px;
  padding: 7px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 12px 32px rgba(15,23,42,.045), inset 0 0 0 1px rgba(15,23,42,.035);
}
.quick-selector label {
  padding: 0 8px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.quick-selector select {
  min-height: 44px;
  border-radius: 17px;
  box-shadow: none;
  background: #fff;
}
.context-bar {
  width: min(980px, 100%);
  margin: 8px auto 0;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-radius: 999px;
  color: #64748b;
  background: color-mix(in srgb, var(--accent) 8%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 13%, transparent);
  font-size: 12px;
  font-weight: 850;
}
.context-bar b {
  color: color-mix(in srgb, var(--accent-deep) 58%, #64748b);
}
.context-bar strong {
  min-width: 0;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overview-card {
  padding: 24px;
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 22px 60px rgba(15,23,42,.065);
}
.overview-card.has-overview-accordion {
  padding: 0;
}
.overview-main {
  padding: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, white), color-mix(in srgb, var(--accent-soft) 82%, white)),
    radial-gradient(circle at 10% -8%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 23rem);
}
.overview-main .section-label {
  color: var(--accent);
}
.overview-card::before {
  width: 5px;
}
.overview-card h2 {
  font-size: clamp(28px, 6.6vw, 48px);
}
.overview-accordion {
  position: relative;
  border-top: 1px solid rgba(15,23,42,.045);
  background: rgba(248,250,252,.38);
}
.overview-accordion.open {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, white), rgba(255,255,255,.82));
}
.overview-accordion .card-toggle {
  padding-top: 18px;
  padding-bottom: 18px;
}
.overview-accordion.open .card-panel {
  grid-template-rows: 1fr;
}
.overview-accordion.open .card-panel-inner {
  opacity: 1;
  transform: translateY(0);
  padding-bottom: 18px;
}
.pinned-bar {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 24px;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.045);
}
.pinned-bar > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.pinned-bar strong { color: var(--accent-deep); }
.pinned-bar span { color: #64748b; font-size: 12px; }
.pinned-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pinned-scroll::-webkit-scrollbar { display: none; }
.pinned-chip {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  color: white;
  background: #0f172a;
  font-size: 12px;
  font-weight: 900;
}
.info-card {
  border-radius: 24px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: 0 14px 38px rgba(15,23,42,.045);
  overflow: hidden;
}
.info-card.open {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, white), rgba(255,255,255,.9) 46%, rgba(255,255,255,.86));
  border-color: color-mix(in srgb, var(--accent) 24%, white);
  box-shadow:
    0 18px 46px rgba(15,23,42,.07),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
.info-card.open .card-head,
.overview-accordion.open .card-head {
  border-top: 3px solid var(--accent);
}
.info-card.pinned {
  box-shadow: 0 16px 42px rgba(15,23,42,.055), inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
.card-head {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
}
.card-toggle {
  grid-template-columns: 4px 1fr auto;
  gap: 12px;
  padding: 15px 8px 15px 15px;
}
.pin-button {
  align-self: center;
  justify-self: center;
  width: 36px;
  height: 36px;
  margin-right: 12px;
  border: 0;
  border-radius: 999px;
  color: #94a3b8;
  background: rgba(241,245,249,.78);
  font-size: 17px;
  font-weight: 950;
}
.pin-button.active {
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent) 18%, white);
  box-shadow: 0 10px 24px var(--accent-glow);
}
.card-marker {
  width: 5px;
  height: 38px;
  opacity: 1;
  box-shadow: 0 10px 20px var(--accent-glow);
}
.card-labels small {
  max-width: 94%;
}
.toggle-symbol {
  background: color-mix(in srgb, var(--accent) 16%, white);
  color: var(--accent-deep);
}
.info-card.open .toggle-symbol,
.overview-accordion.open .toggle-symbol {
  color: white;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-deep) 34%, var(--accent)));
  box-shadow: 0 10px 22px var(--accent-glow);
}
.card-panel {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0;
  transition: grid-template-rows .24s ease;
}
.info-card.open .card-panel { grid-template-rows: 1fr; }
.card-panel-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 15px 0 32px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease, padding-bottom .18s ease;
}
.info-card.open .card-panel-inner {
  opacity: 1;
  transform: translateY(0);
  padding-bottom: 15px;
}
.script-box, .data-block {
  border-radius: 21px;
  border: 1px solid rgba(15,23,42,.035);
  box-shadow: none;
}
.script-box {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, white), color-mix(in srgb, var(--accent-soft) 88%, white));
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
}
.data-block {
  background: rgba(248,250,252,.72);
}
.highlight-item, .program-option, .diploma-list section {
  border: 1px solid rgba(15,23,42,.035);
  box-shadow: none;
}
.card-toolbar {
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.card-actions {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 8px;
  margin-bottom: 12px;
}
.card-action {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent) 11%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 13%, transparent);
  font-size: 12px;
  font-weight: 950;
}
.card-action.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-deep) 35%, var(--accent)));
  box-shadow: 0 12px 24px var(--accent-glow);
}
.copy-menu {
  position: relative;
}
.copy-menu summary {
  list-style: none;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 999px;
  color: white;
  background: var(--accent);
  box-shadow: 0 12px 26px var(--accent-glow);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}
.copy-menu summary::-webkit-details-marker { display: none; }
.copy-menu[open] div {
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  gap: 6px;
  min-width: 150px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 44px rgba(15,23,42,.16);
}
.text-button.ghost {
  color: #475569;
  background: #f1f5f9;
}
.edit-notice {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 10px);
  z-index: 20;
  border: 1px solid rgba(255,255,255,.14);
}
.editor-drawer {
  border: 1px solid rgba(255,255,255,.8);
}
.settings-group {
  gap: 0;
}
.settings-group summary {
  list-style: none;
  cursor: pointer;
}
.settings-group summary::-webkit-details-marker {
  display: none;
}
.settings-group-head {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.settings-group-title {
  display: grid;
  gap: 2px;
}
.settings-group-head > b {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent) 10%, white);
  font-size: 17px;
  font-weight: 950;
  transition: transform .18s ease;
}
.settings-group[open] .settings-group-head > b {
  transform: rotate(45deg);
}
.settings-group-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}
.app-shell.is-editing .info-card.open,
.app-shell.is-editing .overview-accordion.open {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 48%, white);
}
.app-shell.is-editing .inline-edit-form {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}
.app-shell.is-editing .inline-edit-form .field input,
.app-shell.is-editing .inline-edit-form .field textarea {
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent),
    0 8px 18px rgba(15,23,42,.035);
}
.field input, .field textarea {
  background: rgba(248,250,252,.82);
  border: 1px solid rgba(15,23,42,.045);
  box-shadow: none;
}
.app-status-card {
  margin: 18px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 2px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: .52;
  user-select: none;
  pointer-events: none;
}
.app-status-card strong,
.app-status-card span { display: block; }
.app-status-card strong {
  color: #475569;
  font-size: 13px;
  letter-spacing: 0;
}
.app-status-card span { color: #64748b; font-size: 11px; margin-top: 1px; }
.theme-clear .overview-card,
.theme-clear .info-card,
.theme-clear .script-box,
.theme-clear .data-block,
.theme-clear .settings-group,
.theme-clear .switch-row {
  background: #ffffff;
}
.theme-clear .overview-main {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, white), #ffffff);
}
.theme-clear .topbar,
.theme-clear .quick-selector,
.theme-clear .pinned-bar {
  background: rgba(255,255,255,.94);
}
.theme-contrast {
  --surface: #ffffff;
}
.theme-contrast .topbar {
  background: rgba(255,255,255,.98);
  border-bottom-color: rgba(15,23,42,.14);
}
.theme-contrast .overview-card,
.theme-contrast .info-card,
.theme-contrast .script-box,
.theme-contrast .data-block,
.theme-contrast .settings-group,
.theme-contrast .switch-row {
  background: #ffffff;
  border-color: rgba(15,23,42,.18);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
}
.theme-contrast .card-labels small,
.theme-contrast .script-box p,
.theme-contrast .data-block p,
.theme-contrast .clean-list li,
.theme-contrast .pair-table span,
.theme-contrast .highlight-item p,
.theme-contrast .settings-group-head span,
.theme-contrast .switch-row small {
  color: #334155;
}
.text-compact .card-labels strong { font-size: 15px; }
.text-compact .card-labels small,
.text-compact .script-box.compact p,
.text-compact .data-block p,
.text-compact .clean-list li,
.text-compact .pair-table span,
.text-compact .highlight-item p {
  font-size: 12px;
  line-height: 1.48;
}
.text-large .card-labels strong { font-size: 18px; }
.text-large .card-labels small,
.text-large .script-box.compact p,
.text-large .data-block p,
.text-large .clean-list li,
.text-large .pair-table span,
.text-large .highlight-item p {
  font-size: 15px;
  line-height: 1.62;
}
.no-highlights .overview-card::before,
.no-highlights .card-marker,
.no-highlights .clean-list li::before {
  background: #cbd5e1;
  box-shadow: none;
}
.no-highlights .script-box {
  background: rgba(248,250,252,.86);
}
.no-highlights .highlight-item > span {
  background: #e2e8f0;
  color: #475569;
  box-shadow: none;
}
.no-highlights .toggle-symbol,
.no-highlights .pin-button.active {
  color: #475569;
  background: #f1f5f9;
  box-shadow: none;
}
.hide-data-blocks .data-block {
  display: none;
}
@media (min-width: 760px) {
  .quick-selector { grid-template-columns: minmax(170px, .28fr) 1fr; align-items: center; }
  .quick-selector label { padding-left: 12px; }
  .pinned-bar { grid-template-columns: auto 1fr; align-items: center; }
  .pinned-bar > div:first-child { display: grid; gap: 2px; justify-content: start; }
}
@media (max-width: 560px) {
  .card-toggle { padding-right: 4px; }
  .card-panel-inner { padding-left: 15px; }
  .card-toolbar { justify-content: stretch; }
  .card-actions { grid-template-columns: 1fr; }
  .copy-menu { flex: 1 1 auto; }
  .copy-menu summary { justify-content: center; width: 100%; }
  .text-button.ghost, .text-button.edit { flex: 1 1 auto; }
  .app-status-card { align-items: stretch; flex-direction: column; }
  .settings-actions,
  .settings-actions.two {
    display: grid;
    grid-template-columns: 1fr;
  }
  .settings-action {
    width: 100%;
  }
}
@media (max-width: 380px) {
  .status-pill { display: none; }
}
