/* 3분커리 styles. Rules and reasons: docs/product/DESIGN_GUIDE.md
   Every colour, size, space, radius and shadow below comes from the tokens in :root. */

@font-face { font-family: Pretendard; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/Pretendard-Regular.subset.woff2) format("woff2"); }
@font-face { font-family: Pretendard; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/Pretendard-SemiBold.subset.woff2) format("woff2"); }
@font-face { font-family: Pretendard; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/Pretendard-Bold.subset.woff2) format("woff2"); }

:root {
  /* Colour: neutral base, one accent (POSTECH Red). Orange only marks matched words. */
  --bg: #ffffff;
  --surface: #f6f6f5;
  --surface-strong: #ececea;
  --line: #cfcfcb;
  --line-strong: #c5c6ca;   /* POSTECH Silver */
  --text: #1f1e1c;
  --text-2: #4f4d49;
  --text-3: #6b6863;        /* POSTECH Gray #7a7772 darkened to pass 4.5:1 on white */
  --accent: #a61955;        /* POSTECH Red */
  --accent-strong: #86123f;
  --accent-soft: #f9ecf1;
  /* Supporting colours, each with one job:
     orange = "this touches your interest" (matched words, the button that opens a lab, ratings, current step)
     gold   = quoted source material and AI suggestions */
  --orange: #f6a700;        /* POSTECH Orange. Fill only: 2:1 on white, so never text */
  --orange-strong: #df9700;
  --mark: #fde6b0;          /* tint of POSTECH Orange */
  --gold: #daba65;          /* POSTECH Gold. Rules and fills only */
  --gold-soft: #faf4e1;
  --danger: #a3261b;
  --danger-soft: #fbeceb;
  --on-accent: #ffffff;     /* text on an accent or danger fill */
  --on-orange: #1f1e1c;     /* text on an orange fill, the same in both themes */
  color-scheme: light;

  /* Type: six sizes, three weights */
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --lh-body: 1.6;
  --lh-tight: 1.3;

  /* Space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* Shape and depth */
  --r1: 4px;
  --r2: 8px;
  --r-full: 999px;
  --shadow-1: 0 2px 8px rgb(31 30 28 / .12);
  --shadow-2: 0 12px 40px rgb(31 30 28 / .18);

  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", "Malgun Gothic", sans-serif;
  font-size: 100%;
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-text-size-adjust: 100%;
}

/* Dark theme: the same tokens with other values. theme.js sets data-theme on <html> from the header button.
   Red, as text on a dark ground, is lightened to keep 4.5:1; text on that lighter fill turns dark. */
:root[data-theme=dark] {
  --bg: #171716;
  --surface: #222220;
  --surface-strong: #2e2d2b;
  --line: #3d3c39;
  --line-strong: #55534f;
  --text: #f1f0ee;
  --text-2: #c4c2bd;
  --text-3: #9f9c96;
  --accent: #f27aa8;
  --accent-strong: #ff9dc0;
  --accent-soft: #3b1b29;
  --orange-strong: #ffb92e;
  --mark: #5a4300;
  --gold: #b89a4e;
  --gold-soft: #2c2715;
  --danger: #f2877c;
  --danger-soft: #3a1c19;
  --on-accent: #1f1e1c;
  --shadow-1: 0 2px 8px rgb(0 0 0 / .4);
  --shadow-2: 0 12px 40px rgb(0 0 0 / .6);
  color-scheme: dark;
}

/* ---- Base ---- */
* { box-sizing: border-box; }
body { margin: 0; border-top: 4px solid var(--accent); }
h1, h2, h3, h4, h5, p { margin: 0; }
h1, h2, h3, h4 { line-height: var(--lh-tight); font-weight: 700; text-wrap: balance; }
h1 { font-size: var(--fs-3xl); letter-spacing: -.02em; }
h2 { font-size: var(--fs-2xl); letter-spacing: -.01em; }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-md); }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; }
mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 2px; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; border: 0; background: none; padding: 0; }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r1); }
input, textarea, select { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s3) var(--s4); background: var(--bg); color: var(--text); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { resize: vertical; line-height: var(--lh-body); }
label { display: block; font-size: var(--fs-md); font-weight: 600; }
label input, label textarea, label select { margin-top: var(--s2); font-weight: 400; }
label small, legend small, summary small, .field-label small { font-weight: 400; color: var(--text-3); font-size: var(--fs-sm); margin-left: var(--s1); }
details { font-size: var(--fs-sm); margin: var(--s3) 0; }
summary { cursor: pointer; color: var(--text-2); width: fit-content; }
[hidden] { display: none !important; }
.skip { position: fixed; top: -100px; left: var(--s4); background: var(--bg); padding: var(--s3) var(--s4); z-index: 30; border: 1px solid var(--line-strong); border-radius: var(--r2); }
.skip:focus { top: var(--s3); }
.num, .course-code, .selection-count, .nav-button span, .badge, .count { font-variant-numeric: tabular-nums; }

/* ---- Text helpers ---- */
/* A phrase (text up to a comma or full stop) stays together; lines break between phrases, not inside one. */
.ph { display: inline-block; max-width: 100%; }
/* Short guidance text: even out the lines so no single word is left alone on the last line. */
.hero-intro p, .page-heading > p, .sub, .sheet-sub, .empty p, .scope, .how-list li, .selection-actions p, .save-panel > p, .footer-note, dialog > p { text-wrap: balance; }
.group-title, .overview-title { font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); margin: 0 0 var(--s1); }
.micro { font-size: var(--fs-sm); color: var(--text-3); }
.sub { color: var(--text-2); }
.summary { color: var(--text-2); margin: var(--s2) 0 var(--s3); }
.error { font-size: var(--fs-sm); color: var(--danger); min-height: 1.4em; margin-bottom: var(--s2); }
.notice { background: var(--surface); border-radius: var(--r2); padding: var(--s3) var(--s4); font-size: var(--fs-sm); color: var(--text-2); margin: var(--s4) 0; }
.notice.strong { background: var(--accent-soft); color: var(--accent-strong); }
.dirty-notice { color: var(--accent); font-size: var(--fs-sm); margin-top: var(--s3); }
.loading { padding: var(--s8) var(--s4); text-align: center; color: var(--text-3); }
.empty { padding: var(--s7) var(--s5); background: var(--surface); border-radius: var(--r2); }
.empty h3 { margin-bottom: var(--s2); }
.empty p { color: var(--text-2); margin: 0 0 var(--s4); }
.empty.small { padding: var(--s5); }
.empty.small p { margin: 0; font-size: var(--fs-sm); }
.section-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-3); }

/* ---- Buttons ---- */
.primary { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); background: var(--accent); color: var(--on-accent); border-radius: var(--r2); padding: var(--s3) var(--s5); font-weight: 600; min-height: 48px; }
.secondary { display: inline-flex; align-items: center; justify-content: center; font-weight: 600; padding: var(--s2) var(--s4); min-height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r2); background: var(--bg); }
.full { width: 100%; }
.back, .text-button { font-size: var(--fs-sm); color: var(--text-2); padding: var(--s2) 0; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.back { text-decoration: none; }
.text-button.inline { padding: 0; font-size: inherit; color: var(--accent); text-decoration-color: currentColor; }
.explore-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: var(--s2) var(--s4); border-radius: var(--r2); background: var(--orange); color: var(--on-orange); font-weight: 600; }
.danger-button { background: var(--danger); color: var(--on-accent); border-radius: var(--r2); padding: var(--s3) var(--s4); font-weight: 600; }
.close-button { font-size: var(--fs-2xl); line-height: 1; color: var(--text-3); width: 40px; height: 40px; }
.chip { font-size: var(--fs-sm); border: 1px solid var(--line-strong); border-radius: var(--r1); padding: var(--s1) var(--s3); background: var(--bg); min-height: 32px; }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.fb-btn { font-size: var(--fs-sm); border: 1px solid var(--line-strong); border-radius: var(--r1); padding: var(--s1) var(--s3); background: var(--bg); min-height: 32px; }
@media (hover: hover) {
  .primary:hover { background: var(--accent-strong); }
  .secondary:hover, .chip:hover, .fb-btn:hover { border-color: var(--text-2); }
  .theme-toggle:hover { background: var(--text-2); border-color: var(--text-2); }
  .explore-button:hover { background: var(--orange-strong); }
  .back:hover, .text-button:hover { color: var(--accent); }
  .thread-item:hover { background: var(--surface); }
}

/* ---- Tags ---- */
.pill { display: inline-flex; border-radius: var(--r1); padding: 2px var(--s2); font-size: var(--fs-sm); background: var(--surface-strong); color: var(--text-2); }
.pill.method { background: var(--surface); color: var(--text-3); }
.pill.neutral { background: var(--surface); color: var(--text-2); }
.tag-list { display: flex; gap: var(--s2); flex-wrap: wrap; }
.badge { background: var(--accent); color: var(--on-accent); border-radius: var(--r-full); font-size: var(--fs-sm); padding: 0 var(--s2); }

/* ---- Header and footer ---- */
.header { max-width: 1184px; padding: var(--s4) var(--s5); margin: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); border-bottom: 1px solid var(--line); }
.brand { flex: 0 0 auto; display: block; line-height: 0; }
.brand img { display: block; height: 30px; width: auto; }
.brand .logo-dark, [data-theme=dark] .brand .logo-light { display: none; }
[data-theme=dark] .brand .logo-dark { display: block; }
nav { display: flex; gap: var(--s5); align-items: center; font-size: var(--fs-sm); }
.nav-button { padding: var(--s2) 0; white-space: nowrap; }
.nav-button span { background: var(--surface-strong); display: inline-block; padding: 0 var(--s2); border-radius: var(--r-full); margin-left: var(--s1); }
.nav-button span.alert { background: var(--accent); color: var(--on-accent); }
/* Theme button: filled with the text colour, so it is black on the light theme and white on the dark one.
   The crescent moon (go dark) and the sun (go light) are the one place an icon is used, in orange. */
.nav-end { display: flex; align-items: center; gap: var(--s2); }
.theme-toggle { display: inline-flex; align-items: center; gap: var(--s2); border: 1px solid var(--text); border-radius: var(--r2); padding: var(--s2) var(--s3); white-space: nowrap; background: var(--text); color: var(--bg); font-weight: 600; }
.theme-toggle svg { flex: 0 0 16px; fill: var(--orange); stroke: var(--orange); stroke-width: 1.6; stroke-linecap: round; }
.theme-toggle .icon-moon { stroke: none; }
.theme-toggle .icon-sun, [data-theme=dark] .theme-toggle .icon-moon { display: none; }
[data-theme=dark] .theme-toggle .icon-sun { display: block; }
.account { border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s2) var(--s4); font-weight: 600; white-space: nowrap; }
main { max-width: 1184px; margin: auto; min-height: 70vh; padding: 0 var(--s5) var(--s8); }
main:focus { outline: none; }
footer { border-top: 1px solid var(--line); max-width: 1184px; margin: auto; padding: var(--s5); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); align-items: center; color: var(--text-3); font-size: var(--fs-sm); }
.footer-brand { color: var(--text); font-weight: 700; }
footer .footer-note { flex-basis: 100%; }

/* ---- Home ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s8); padding: var(--s7) 0 var(--s6); align-items: start; }
.hero-intro { margin-bottom: var(--s6); }
.hero-intro p { margin-top: var(--s3); color: var(--text-2); font-size: var(--fs-lg); }
.input-card textarea { min-height: 120px; }
.overseas-note { margin: var(--s2) 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0 var(--s5); }
.goal-set { border: 0; padding: 0; margin: 0 0 var(--s5); }
.goal-set legend { font-weight: 600; padding: 0; margin-bottom: var(--s2); }
.goal-row { display: flex; gap: var(--s2); }
.goal-row label { flex: 1; position: relative; }
.goal-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.goal-row span { display: block; text-align: center; font-size: var(--fs-sm); border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s3) var(--s2); cursor: pointer; font-weight: 400; }
.goal-row input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
.goal-row input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-aside { background: var(--surface); border-radius: var(--r2); padding: var(--s5); }
.hero-aside h2 { font-size: var(--fs-md); margin-bottom: var(--s3); }
.how-list { margin: 0 0 var(--s5); padding-left: 1.3em; display: grid; gap: var(--s3); color: var(--text-2); }
.how-list b { display: block; color: var(--text); font-weight: 600; }
.how-list li::marker { font-weight: 600; color: var(--text); }
.scope { border-top: 1px solid var(--line); padding-top: var(--s4); }

/* ---- Page top ---- */
.page-top { padding-top: var(--s5); display: flex; justify-content: space-between; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.steps { display: flex; gap: var(--s2); color: var(--text-3); font-size: var(--fs-sm); margin: 0; padding: 0; list-style: none; }
.steps li + li::before { content: "›"; margin-right: var(--s2); color: var(--line-strong); }
.steps [aria-current] { color: var(--text); font-weight: 600; box-shadow: inset 0 -3px 0 var(--orange); }
.page-heading { margin: 0 0 var(--s5); }
.page-heading:first-child { padding-top: var(--s6); }
.page-heading h1 { margin-bottom: var(--s2); }
.page-heading > p { color: var(--text-2); }
.interest-line { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin: var(--s4) 0; }
.query-echo { margin: var(--s4) 0 0; padding-left: var(--s4); border-left: 3px solid var(--gold); color: var(--text-2); max-width: 40em; }

/* ---- Results: two labs per row on a wide window (1000px and up), one per row below that ---- */
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding-bottom: var(--s4); border-bottom: 2px solid var(--text); }
.results-toolbar strong.num { background: var(--mark); border-radius: 2px; padding: 0 var(--s1); }
.results-toolbar input { max-width: 280px; font-size: var(--fs-sm); padding: var(--s2) var(--s3); }
.labs-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); margin-top: var(--s5); }
@media (min-width: 1000px) { .labs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Cards in one row share a height; the button row sits at the bottom of each. */
.lab-card { display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s5); }
.lab-main { min-width: 0; flex: 1; }
.lab-card h3 { margin-bottom: var(--s1); }
.lab-card h3 + .micro { color: var(--text-2); }
.lab-meta { color: var(--text-3); font-size: var(--fs-sm); margin-bottom: var(--s3); }
.professor { font-size: var(--fs-sm); color: var(--text-3); margin-bottom: var(--s3); }
.lab-card .reason { font-size: var(--fs-sm); color: var(--text-3); margin-top: var(--s3); }
.lab-main > .overview, .lab-main > .lab-evidence { margin-top: var(--s4); }
.lab-side { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); border-top: 1px solid var(--line); padding-top: var(--s4); margin-top: var(--s4); }
.lab-side a { font-size: var(--fs-sm); color: var(--text-2); }
.result-fb, .feedback { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-top: var(--s3); }
.feedback > .micro { flex-basis: 100%; }
.lab-card .result-fb { margin-top: var(--s3); }
.social { margin-top: var(--s2); }
.fb-reasons { display: flex; gap: var(--s2); flex-wrap: wrap; margin: var(--s2) 0; }
.search-fb { border-top: 1px solid var(--line); padding: var(--s5) 0 0; margin: var(--s5) 0; }
.fb-scale { display: flex; gap: var(--s2); flex-wrap: wrap; margin: var(--s3) 0; }
.fb-scale label { margin: 0; position: relative; }
.fb-scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fb-scale .star span { color: var(--orange-strong); letter-spacing: 1px; }
.fb-scale label span { display: inline-block; border: 1px solid var(--line-strong); border-radius: var(--r1); padding: var(--s2) var(--s3); cursor: pointer; font-weight: 400; }
.fb-scale input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.fb-scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Research overview and evidence ---- */
.overview { margin: var(--s2) 0 var(--s3); }
.overview ul { margin: 0 0 var(--s1); padding-left: 1.2em; }
.overview li { margin: 2px 0; overflow-wrap: anywhere; }
.overview li::marker { color: var(--line-strong); }
.overview li.matched { font-weight: 600; }
.overview li.matched .micro { font-weight: 600; color: var(--text); background: var(--mark); border-radius: var(--r1); padding: 1px var(--s2); margin-left: var(--s1); white-space: nowrap; }
.evidence { border-left: 3px solid var(--gold); padding-left: var(--s4); margin: var(--s3) 0; font-size: var(--fs-sm); color: var(--text-2); overflow-wrap: anywhere; max-width: 44em; }
.evidence p { white-space: pre-line; max-height: 170px; overflow: auto; }
.ev-kind { display: block; font-size: var(--fs-sm); color: var(--text-3); margin-bottom: 2px; }
.evidence .ev-title { font-weight: 600; color: var(--text); }
.evidence .ev-snippet { max-height: none; }
.evidence .ev-tags { color: var(--text); }
.ev-full { margin: var(--s2) 0 0; }
.ev-full p { margin-top: var(--s2); }
.evidence a { display: inline-block; margin: var(--s2) var(--s3) 0 0; color: var(--accent); }

/* ---- Lab detail ---- */
.detail-layout { display: grid; grid-template-columns: clamp(300px, 32vw, 380px) minmax(0, 1fr); gap: var(--s7); }
.lab-sidebar { align-self: start; position: sticky; top: var(--s5); padding: var(--s5); background: var(--surface); border-radius: var(--r2); max-height: calc(100vh - var(--sidebar-top, var(--s5)) - var(--s5)); max-height: calc(100dvh - var(--sidebar-top, var(--s5)) - var(--s5)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-gutter: stable; }
.lab-sidebar h2 { font-size: var(--fs-xl); margin-bottom: var(--s1); }
.lab-sidebar .small-link, .small-link { font-size: var(--fs-sm); color: var(--accent); display: inline-block; margin: var(--s3) 0; }
.lab-sidebar details { border-top: 1px solid var(--line); padding-top: var(--s3); }
.lab-sidebar .tag-list { margin-top: var(--s2); }
.lab-tools { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2); margin: var(--s2) 0; font-size: var(--fs-sm); }
.lab-tools .on { color: var(--accent); }
.new-papers { margin-top: var(--s2); }
.new-papers a { display: block; font-size: var(--fs-sm); color: var(--accent); margin: var(--s1) 0; }
.easy-summary { border-top: 1px solid var(--line); padding-top: var(--s3); }
.easy-summary .oneliner { color: var(--text); margin: var(--s2) 0; }
.easy-summary .lab-subject { color: var(--accent); font-weight: 700; }
.easy-paper { border-top: 1px solid var(--line); padding: var(--s2) 0; }
.terms { margin: var(--s2) 0; font-size: var(--fs-sm); }
.terms div { margin-top: var(--s2); }
.terms dt { font-weight: 600; overflow-wrap: anywhere; }
.terms dd { margin: 0; color: var(--text-3); overflow-wrap: anywhere; }
.easy-summary .easy-basis { margin: var(--s2) 0 0; }
.easy-paper .ev-title { margin-bottom: 0; font-weight: 600; color: var(--text); }
.easy-paper .easy-venue { margin: 0 0 var(--s2); }
.lab-sidebar { min-width: 0; overflow-wrap: anywhere; }
.easy-focus { border-top: 1px solid var(--line); padding: var(--s2) 0; }
.easy-focus p { margin: var(--s1) 0; }
.cited-papers { border-top: 1px solid var(--line); padding-top: var(--s3); margin-top: var(--s3); }
.cited-papers p { font-size: var(--fs-sm); margin: var(--s1) 0; }
/* Section titles are red, bold and large under a heavy rule; links are small and underlined. */
.detail-main h2, .community > h2, .settings h2, .hero-aside h2, .save-panel h3 { color: var(--accent); }
.detail-main h2 { margin-bottom: var(--s2); }
.detail-main > .sub { margin-bottom: var(--s5); }
.selection-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); margin-bottom: var(--s2); }
.selection-head input { font-size: var(--fs-sm); max-width: 340px; padding: var(--s2) var(--s3); }
.selection-count { font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap; }
.selection-count b { color: var(--accent); }
.course-list { border: 1px solid var(--line-strong); border-radius: var(--r2); max-height: 570px; overflow: auto; margin-top: var(--s2); }
.course-item { padding: var(--s4); border-bottom: 1px solid var(--line); }
.course-item:has(> label input:checked) { background: var(--accent-soft); }
.course-item:last-child { border-bottom: 0; }
.course-item > label { display: flex; gap: var(--s3); align-items: flex-start; cursor: pointer; font-weight: 400; }
.course-item input[type=checkbox] { width: 20px; height: 20px; flex: 0 0 20px; margin: 2px 0 0; padding: 0; accent-color: var(--accent); }
.course-name { font-weight: 600; }
.course-code { font-size: var(--fs-sm); color: var(--text-3); margin-left: var(--s2); }
.course-reason { font-size: var(--fs-sm); color: var(--text-2); margin-top: var(--s1); }
.course-item details { margin: var(--s2) 0 0 32px; }
.selection-actions { margin-top: var(--s4); display: flex; justify-content: space-between; align-items: center; gap: var(--s4); }
.selection-actions p { font-size: var(--fs-sm); color: var(--text-3); }
.research-papers { margin-bottom: var(--s6); }

/* ---- Guide ---- */
.guide { margin-top: var(--s8); padding-top: var(--s6); border-top: 2px solid var(--text); }
.guide-columns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); margin-top: var(--s5); }
.guide-column > h3 { font-size: var(--fs-lg); padding: var(--s3) var(--s4); background: var(--surface-strong); border-radius: var(--r2); }
.topic-card { padding: var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r2); margin-top: var(--s3); background: var(--bg); }
.topic-card h4 { margin: var(--s2) 0; }
.topic-card p, .topic-card li { font-size: var(--fs-sm); color: var(--text-2); }
.topic-card ol { padding-left: 1.3em; margin: var(--s2) 0; }
.topic-card .course-mini { margin-top: var(--s2); }
.topic-card.ai .question { font-weight: 600; color: var(--text); }
.ai-guide { background: var(--gold-soft); border-radius: var(--r2); padding: var(--s5); margin: var(--s4) 0; }
.ai-guide.muted { background: var(--surface); color: var(--text-2); }
.ai-head { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; flex-wrap: wrap; margin-bottom: var(--s2); }
.ai-head h3 { font-size: var(--fs-lg); }
.ai-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s4); }
.first-step { background: var(--bg); border-radius: var(--r1); padding: var(--s2) var(--s3); margin-top: var(--s2); }
.ai-next { margin-top: var(--s4); }
.ai-next h4 { margin-bottom: var(--s1); }
.ai-next p { font-size: var(--fs-sm); }
.ai-retry { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.basic-guide { margin-top: var(--s4); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -2px; margin-right: var(--s2); }
@keyframes spin { to { transform: rotate(360deg); } }
.save-panel { padding: var(--s5); border: 1px solid var(--line-strong); border-radius: var(--r2); margin-top: var(--s8); background: var(--surface); }
.save-panel h3 { font-size: var(--fs-lg); margin-bottom: var(--s1); }
.save-panel p { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--s4); }
.save-panel textarea { min-height: 96px; }
.save-actions { margin-top: var(--s3); display: flex; justify-content: space-between; align-items: center; gap: var(--s4); }

/* ---- Saved ---- */
.saved-grid { display: grid; gap: var(--s4); }
.saved-card { padding: var(--s5); border: 1px solid var(--line-strong); border-radius: var(--r2); }
.saved-card .note { max-width: 44em; background: var(--surface); padding: var(--s3); margin: var(--s4) 0; border-radius: var(--r1); font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.saved-card h3 { margin: 0 0 var(--s1); }
.saved-card .micro { margin-bottom: var(--s3); }
.saved-card .actions { display: flex; gap: var(--s5); align-items: center; }
.saved-guide { margin: 0 0 var(--s3); }
.saved-guide p { font-size: var(--fs-sm); margin: var(--s2) 0; }

/* ---- Dialogs, toast ---- */
dialog { border: 1px solid var(--line); border-radius: var(--r2); background: var(--bg); padding: var(--s6); width: min(440px, calc(100% - 32px)); max-height: calc(100vh - 40px); overflow: auto; color: var(--text); box-shadow: var(--shadow-2); }
dialog.wide { width: min(660px, calc(100% - 32px)); }
dialog::backdrop { background: rgb(31 30 28 / .5); }
dialog .close-button { position: absolute; right: var(--s2); top: var(--s2); }
dialog h2 { margin-bottom: var(--s3); padding-right: var(--s6); }
dialog > p { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--s5); }
dialog label { margin: var(--s4) 0; }
dialog .text-button { display: block; margin: var(--s3) auto; }
dialog .micro { margin: var(--s4) 0 0; }
dialog .tag-option, dialog .rating-input label, dialog .check { margin: 0; }
.sheet-sub { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--s3); }
#sheet-dialog form > label, #sheet-dialog .form-grid label { margin: var(--s4) 0; }
#toast { position: fixed; bottom: var(--s5); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--text); color: var(--bg); padding: var(--s3) var(--s5); border-radius: var(--r2); box-shadow: var(--shadow-1); font-size: var(--fs-sm); z-index: 20; }
.service-pop { position: fixed; right: var(--s5); bottom: var(--s5); width: min(340px, calc(100% - 40px)); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s4); box-shadow: var(--shadow-2); z-index: 25; }
.service-pop .close-button { position: absolute; right: var(--s1); top: var(--s1); }
.service-pop textarea { min-height: 60px; font-size: var(--fs-sm); margin: var(--s2) 0 var(--s3); }

/* ---- Forms: profile, tags, consent ---- */
.form-section { border: 0; padding: 0; margin: 0; }
.form-section legend, .rating-set legend { font-size: var(--fs-sm); color: var(--text-3); font-weight: 600; padding: 0; margin: var(--s2) 0 var(--s1); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s4); }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.field { margin: var(--s4) 0; }
.field-label { display: block; font-weight: 600; margin-bottom: var(--s2); }
.tag-filter { font-size: var(--fs-sm); padding: var(--s2) var(--s3); }
.tag-picker { display: flex; flex-wrap: wrap; gap: var(--s2); max-height: 168px; overflow: auto; padding: var(--s3); margin-top: var(--s2); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.tag-option { display: inline-flex; position: relative; font-weight: 400; }
.tag-option input, .rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.tag-option span { font-size: var(--fs-sm); border: 1px solid var(--line-strong); border-radius: var(--r1); padding: var(--s1) var(--s3); background: var(--bg); cursor: pointer; }
.tag-option input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
.tag-option input:focus-visible + span, .rating-input input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sub-label { font-size: var(--fs-sm); margin-top: var(--s3) !important; }
details.optional { border-top: 1px solid var(--line); padding-top: var(--s3); margin: var(--s5) 0 var(--s2); font-size: var(--fs-md); }
details.optional > summary { font-weight: 600; color: var(--text); }
.profile-form { max-width: 720px; border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s6); }
.profile-form.narrow { max-width: 420px; }
.profile-form > label { margin: 0 0 var(--s4); }
.profile-form label { margin-bottom: var(--s4); }
.profile-form .form-grid label, .profile-form details label { margin-top: var(--s4); }
.profile-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); margin-top: var(--s5); border-top: 1px solid var(--line); padding-top: var(--s5); }
.check { display: flex !important; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r2); margin: var(--s3) 0 !important; font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 0; padding: 0; accent-color: var(--accent); flex: 0 0 20px; }
.consent { margin-top: var(--s3); }
.consent legend { font-size: var(--fs-sm); font-weight: 600; }
.consent .check span { font-weight: 400; font-size: var(--fs-sm); }
.policy section { border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s4) var(--s5); margin-bottom: var(--s3); }
.policy h3 { font-size: var(--fs-md); margin-bottom: var(--s2); }
.policy li { font-size: var(--fs-sm); color: var(--text-2); }
.settings { margin-top: var(--s8); border-top: 2px solid var(--text); padding-top: var(--s6); }
.settings h2 { font-size: var(--fs-xl); margin-bottom: var(--s3); }
.settings-block { border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s4) var(--s5); margin-bottom: var(--s3); }
.settings-block h3 { font-size: var(--fs-md); margin-bottom: var(--s2); }
.settings-block h3 small { font-size: var(--fs-sm); color: var(--text-3); font-weight: 400; }
.settings-block p { font-size: var(--fs-sm); }
.settings-block .ok { color: var(--text); font-weight: 600; }
.check-list { display: grid; gap: var(--s1); }
.inline-form { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-top: var(--s3); }
.inline-form input { max-width: 200px; }
.danger summary { color: var(--danger); }

/* ---- Community: reviews, seniors, Q&A ---- */
.community { margin-top: var(--s8); padding-top: var(--s6); border-top: 2px solid var(--text); }
.community:empty { display: none; }
.community > h2 { margin-bottom: var(--s2); }
.community > .sub { margin-bottom: var(--s5); }
.community-block { margin: var(--s6) 0; }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.block-head h3 { font-size: var(--fs-lg); }
.count { font-size: var(--fs-sm); color: var(--text-3); margin-left: var(--s1); font-weight: 400; }
.stars { color: var(--orange-strong); letter-spacing: 1px; font-size: var(--fs-sm); white-space: nowrap; }
.stars-off { color: var(--line-strong); }
.review-summary { display: grid; grid-template-columns: 150px 1fr; gap: var(--s5); align-items: center; padding: var(--s4) var(--s5); background: var(--surface); border-radius: var(--r2); margin-bottom: var(--s3); }
.overall { display: flex; flex-direction: column; gap: var(--s1); }
.overall b { font-size: var(--fs-3xl); line-height: 1; }
.review-ratings { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s5); margin: 0; }
.review-ratings div { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); font-size: var(--fs-sm); }
.review-ratings dt { color: var(--text-3); }
.review-ratings dd { margin: 0; }
.review-list { display: grid; gap: var(--s3); }
.review-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4); align-items: start; }
.review-card { border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s5); }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); font-size: var(--fs-sm); margin-bottom: var(--s3); }
.review-score { font-weight: 600; }
.review-lab { font-weight: 700; margin-bottom: var(--s3); }
.review-lab span { font-size: var(--fs-sm); color: var(--text-3); font-weight: 400; margin-left: var(--s2); }
.review-card .review-ratings { margin: var(--s3) 0; padding: var(--s3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.review-body h5 { font-size: var(--fs-sm); color: var(--text-3); margin: var(--s3) 0 var(--s1); font-weight: 600; }
.review-body p { font-size: var(--fs-sm); color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.review-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-top: var(--s3); }
.senior-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.senior-card { display: flex; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r2); }
.avatar { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--surface-strong); color: var(--text-2); display: grid; place-items: center; font-weight: 700; }
.senior-info { min-width: 0; display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; }
.senior-info h4 span { font-size: var(--fs-sm); color: var(--text-3); font-weight: 400; margin-left: var(--s1); }
.senior-info .research, .senior-info .headline { font-size: var(--fs-sm); color: var(--text-2); }
.senior-info .email { overflow-wrap: anywhere; }
.rating-set { border: 0; padding: 0; margin: var(--s3) 0; }
.rating-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 600; }
.rating-input { display: flex; gap: var(--s1); }
.rating-input label { position: relative; }
.rating-input span { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: var(--r1); font-size: var(--fs-sm); font-weight: 400; cursor: pointer; background: var(--bg); }
.rating-input input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.share-preview { background: var(--surface); border-radius: var(--r2); padding: var(--s3) var(--s4); margin: var(--s1) 0 var(--s3); }
.share-preview p:not(.micro) { font-size: var(--fs-sm); }
.share-preview .text-button { display: inline; margin: var(--s1) 0 0; padding: 0; }
.board-labs { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: var(--s3); margin-bottom: var(--s3); }
.lab-chip { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s2) var(--s3); background: var(--bg); font-size: var(--fs-sm); }
.lab-chip[aria-pressed=true] { border-color: var(--accent); background: var(--accent-soft); }
.board-filters { display: flex; gap: var(--s2); }
.board-filters select { font-size: var(--fs-sm); width: auto; padding: var(--s2) var(--s3); }
.board-filters input { font-size: var(--fs-sm); max-width: 260px; padding: var(--s2) var(--s3); }
.qna-form { display: flex; flex-direction: column; gap: var(--s2); margin: var(--s3) 0 var(--s4); }
.qna-form textarea { min-height: 72px; }
.qna-form button { align-self: flex-end; }
.qna-item { border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s4); margin-top: var(--s3); }
.qna-a { margin: var(--s2) 0 0 var(--s4); padding-left: var(--s3); border-left: 3px solid var(--gold); }
.qna-a p { font-size: var(--fs-sm); }

/* ---- Inbox and meetings ---- */
.inbox-layout { display: grid; grid-template-columns: 320px 1fr; border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; min-height: 520px; }
.thread-list { border-right: 1px solid var(--line); overflow: auto; max-height: 680px; }
.thread-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: var(--s4); border-bottom: 1px solid var(--line); }
.thread-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.thread-title { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.thread-title b span { font-weight: 400; color: var(--text-3); font-size: var(--fs-sm); margin-left: var(--s1); }
.thread-subject { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.thread-preview { font-size: var(--fs-sm); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-tools { font-size: var(--fs-sm); color: var(--text-3); margin-top: var(--s1); }
.thread-view { display: flex; flex-direction: column; min-width: 0; }
.thread-view > .empty { margin: auto; }
.thread-head { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.thread-head h2 { font-size: var(--fs-xl); margin-bottom: var(--s1); }
.thread-contact { font-size: var(--fs-sm); margin-top: var(--s2); }
.sender-profile { margin: var(--s3) 0 0; background: var(--surface); border-radius: var(--r2); padding: var(--s3) var(--s4); }
.sender-profile dl { margin: var(--s2) 0 0; display: grid; gap: var(--s1); }
.sender-profile dl div { display: grid; grid-template-columns: 76px 1fr; gap: var(--s3); font-size: var(--fs-sm); }
.sender-profile dt { color: var(--text-3); }
.sender-profile dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.meeting-panel { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.meeting-panel > div:first-child { min-width: 0; }
.meeting-panel .micro { margin-top: var(--s1); }
.meeting-panel.confirmed { background: var(--surface); }
.meeting-panel.request { background: var(--accent-soft); flex-direction: column; align-items: stretch; }
.meeting-panel .text-button { margin: 0; flex: 0 0 auto; }
.meeting-when { margin-top: var(--s2); }
.meeting-link { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s2); }
.meeting-link .micro { margin: 0; overflow-wrap: anywhere; }
.meeting-slots { margin: var(--s2) 0 0; padding: 0 0 0 var(--s4); border: 0; display: grid; gap: var(--s2); }
fieldset.meeting-slots { padding: 0; }
.meeting-slots legend, .meeting-mode legend { font-size: var(--fs-sm); color: var(--text-3); margin-bottom: var(--s2); }
.meeting-panel .check { margin: 0 !important; padding: var(--s2) var(--s3); }
.meeting-panel label:not(.check) { display: block; margin-top: var(--s3); }
.meeting-actions { display: flex; align-items: center; gap: var(--s4); }
.meeting-mode { border: 0; padding: 0; margin: 0 0 var(--s1); display: grid; gap: var(--s2); }
.meeting-mode .check { margin: 0 !important; }
.meeting-fields { border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s3); margin: var(--s2) 0 var(--s3); }
.meeting-fb { background: var(--surface); border-radius: var(--r2); padding: var(--s3) var(--s4); margin: var(--s3) 0; display: grid; gap: var(--s2); }
.meeting-fb p, .meeting-fb input[name=comment] { font-size: var(--fs-sm); }
.meeting-fb .secondary { justify-self: start; }
.messages { flex: 1; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); overflow: auto; max-height: 440px; background: var(--surface); }
.message { max-width: 78%; align-self: flex-start; }
.message p { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s3) var(--s4); font-size: var(--fs-sm); white-space: pre-line; overflow-wrap: anywhere; }
.message.mine { align-self: flex-end; text-align: right; }
.message.mine p { background: var(--accent-soft); border-color: var(--accent-soft); text-align: left; }
.message .micro { display: block; margin-top: var(--s1); }
.reply-form { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); align-items: flex-end; }
.reply-form textarea { min-height: 52px; height: 52px; font-size: var(--fs-sm); }
.reply-form .primary { flex: 0 0 auto; white-space: nowrap; }
.mobile-only { display: none; }

/* ---- Mirror (what the service understood) ---- */
/* One row per dimension: a bold name on the left, what the student wrote on the right, a rule between rows. */
.mirror { border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s4) var(--s5); margin: var(--s4) 0; max-width: 52em; }
.mirror summary { font-weight: 700; color: var(--text); font-size: var(--fs-md); }
.mirror ul { list-style: none; margin: var(--s3) 0 var(--s4); padding: 0; border-bottom: 1px solid var(--line); }
.mirror li { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: var(--s2) var(--s4); padding: var(--s4) 0; border-top: 1px solid var(--line); align-items: start; }
.mirror li > * { grid-column: 2; }
.mirror-label { grid-column: 1 !important; grid-row: 1 / span 3; font-weight: 700; color: var(--text); padding-top: 2px; }
.mirror-values { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; min-height: 28px; }
.mirror-values .micro { color: var(--text-3); }
.mirror-values .pill { background: var(--mark); color: var(--text); padding: 2px var(--s2); }
.mirror-quote { font-size: var(--fs-sm); color: var(--text-2); border-left: 3px solid var(--gold); padding-left: var(--s3); quotes: "“" "”"; }
.mirror-x { margin-left: var(--s1); font-size: var(--fs-sm); line-height: 1; color: var(--text-3); padding: 0 2px; }
.mirror-add { display: flex; gap: var(--s2); align-items: center; }
.mirror-input { max-width: 220px; padding: var(--s1) var(--s3); font-size: var(--fs-sm); margin: 0; }
.mirror-add .secondary { padding: var(--s1) var(--s3); font-size: var(--fs-sm); min-height: 32px; }
.mirror-actions { margin: var(--s2) 0 var(--s3); }

/* ---- Narrower screens ---- */
/* 홈 화면에 추가 안내 (install.js): not modal, so it sits at the top and leaves the browser bar and the pointer free */
dialog.install { position: fixed; inset: max(12px, env(safe-area-inset-top, 0px)) 0 auto; margin: 0 auto; z-index: 50; }
.install-steps { list-style: none; padding: 0; margin: var(--s4) 0; display: grid; gap: var(--s3); }
.install-steps li { display: grid; grid-template-columns: 28px 1fr; gap: var(--s3); align-items: start; padding: var(--s3); border-radius: var(--r2); color: var(--text-3); }
.install-steps li.current { background: var(--accent-soft); color: var(--text); }
.install-steps li.done { color: var(--text-2); }
.install-num { width: 28px; height: 28px; border-radius: var(--r-full); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); background: var(--surface-strong); color: var(--text-2); }
.install-steps li.current .install-num { background: var(--accent); color: var(--on-accent); }
.install-step-title { font-weight: 600; line-height: var(--lh-tight); margin: 3px 0 0; }
.install-step-body { font-size: var(--fs-sm); color: var(--text-2); margin: var(--s2) 0 0; line-height: var(--lh-body); }
.install-icon { width: 1.35em; height: 1.35em; vertical-align: -.3em; color: var(--accent); fill: currentColor; }
.install-icon path[fill="none"], .install-icon rect[fill="none"] { fill: none; }
.install-action { margin-top: var(--s3); margin-right: var(--s2); }
.install-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
dialog.install .text-button { margin: var(--s3) auto 0; }
.install-banner { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r2); background: var(--bg); box-shadow: var(--shadow-2); max-width: 440px; margin: 0 auto; }
.install-banner-open { flex: 1; display: flex; align-items: center; gap: var(--s3); text-align: left; color: var(--text); min-height: 44px; }
.install-banner-open img { border-radius: 8px; }
.install-banner-open span { display: grid; }
.install-banner-open small { color: var(--text-2); font-size: var(--fs-sm); }
.install-banner-x { width: 44px; height: 44px; font-size: var(--fs-lg); color: var(--text-3); }
.install-pointer { position: fixed; left: 50%; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; font-size: 40px; line-height: 1; color: var(--accent); animation: install-bounce 1s ease-in-out infinite; pointer-events: none; }
@keyframes install-bounce { 50% { transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .install-pointer { animation: none; } }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; gap: var(--s6); padding-top: var(--s6); }
  .detail-layout { grid-template-columns: 1fr; gap: var(--s6); }
  .lab-sidebar { position: static; max-height: none; overflow-y: visible; }
  .guide-columns { grid-template-columns: 1fr; }
  .inbox-layout { grid-template-columns: 1fr; }
  .inbox-layout.has-thread .thread-list { display: none; }
  .inbox-layout:not(.has-thread) .thread-view { display: none; }
  .thread-list { border-right: 0; max-height: none; }
  .mobile-only { display: inline-block; }
  .senior-grid, .review-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  :root { --fs-3xl: 1.75rem; --fs-2xl: 1.5rem; }
  .header { padding: var(--s3) var(--s4); gap: var(--s3); }
  .brand img { height: 28px; }
  nav { gap: var(--s2) var(--s3); flex-wrap: wrap; justify-content: flex-end; }
  .account, .theme-toggle { padding: var(--s1) var(--s2); }
  main { padding: 0 var(--s4) var(--s7); }
  footer { padding: var(--s5) var(--s4); }
  .page-top { flex-direction: column; align-items: flex-start; gap: var(--s2); }
  .results-toolbar { align-items: stretch; flex-direction: column; gap: var(--s2); }
  .results-toolbar input { max-width: none; }
  .selection-head { flex-direction: column; align-items: stretch; gap: var(--s2); }
  .selection-head input { max-width: none; }
  .selection-actions, .save-actions { align-items: stretch; flex-direction: column; gap: var(--s3); }
  .course-code { display: block; margin: 2px 0 0; }
  .ai-topics, .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .mirror { padding: var(--s4); }
  .mirror li { grid-template-columns: 1fr; }
  .mirror li > *, .mirror-label { grid-column: 1 !important; grid-row: auto; }
  .review-summary { grid-template-columns: 1fr; gap: var(--s3); }
  .review-ratings { grid-template-columns: 1fr; }
  .board-filters { flex-direction: column; width: 100%; }
  .board-filters select, .board-filters input { width: 100%; max-width: none; }
  .profile-form, .save-panel, .ai-guide { padding: var(--s4); }
  .rating-row { flex-direction: column; align-items: flex-start; }
  .block-head { flex-wrap: wrap; }
  dialog { padding: var(--s5) var(--s4); }
  .reply-form { flex-direction: column; align-items: stretch; }
  .meeting-panel { flex-direction: column; align-items: stretch; padding: var(--s3) var(--s4); }
  .meeting-actions { flex-direction: column; align-items: stretch; }
  .inbox-layout, .thread-view { min-height: 0; }
  .inline-form input { max-width: none; flex: 1; }
  .qna-a { margin-left: var(--s2); }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--line-strong); }
  * { scroll-behavior: auto !important; }
}
