/*
  YUKI CLASS · Pastel Call & Chat portal system
  Type: 44 / 34 / 26 / 20 / 16 / 14 / 12
  Space: 4 / 8 / 12 / 16 / 24 / 32 / 48
  Surfaces: paper + white with role-aware sky, mint and coral accents
  Pattern: soft role rail + pastel page hero + rounded work surfaces
*/
@layer reset, tokens, base, shell, components, pages, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body, h1, h2, h3, p, ul, ol, dl, dd, fieldset, blockquote { margin: 0; }
  ul, ol { padding: 0; list-style: none; }
  button, input, select, textarea { font: inherit; }
  button, a { -webkit-tap-highlight-color: transparent; }
  button { cursor: pointer; }
  img { display: block; max-width: 100%; }
  a { color: inherit; text-decoration: none; }
  [hidden] { display: none !important; }
}

@layer tokens {
  :root {
    --paper: #f7f8fa;
    --white: #ffffff;
    --ink: #102c34;
    --muted: #687b82;
    --line: #dce4e6;
    --yellow: #ffbd1a;
    --yellow-soft: #fff0b7;
    --green: #167d74;
    --green-deep: #0d5f58;
    --mint: #d8eee8;
    --sky: #beddf2;
    --coral: #f7ddde;
    --danger: #b94d52;
    --radius-xl: 36px;
    --radius-lg: 30px;
    --radius: 24px;
    --radius-sm: 16px;
    --radius-xs: 12px;
    --shadow: 0 24px 60px rgb(31 57 66 / 12%);
    --shadow-soft: 0 12px 32px rgb(31 57 66 / 8%);
    --sans: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    --rail: 248px;
    --header: 76px;
    --content: 1120px;
    --role-soft: var(--sky);
    --role-tint: #eaf5fb;
  }
}

@layer base {
  body { min-width: 320px; overflow-x: clip; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.6; }
  h1, h2, h3, strong, b { line-height: 1.2; letter-spacing: -.035em; }
  p { text-wrap: pretty; }
  button, input, select, textarea { color: var(--ink); }
  :focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
  ::selection { background: var(--yellow-soft); color: var(--ink); }
  .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .skip-link { position: fixed; z-index: 100; left: 12px; top: -70px; padding: 11px 17px; border-radius: 999px; background: var(--ink); color: var(--white); font-weight: 800; }
  .skip-link:focus { top: 12px; }
}

@layer shell {
  .portal-layout { min-height: 100vh; padding-left: var(--rail); }
  .portal-rail { position: fixed; z-index: 20; inset: 0 auto 0 0; width: var(--rail); display: flex; flex-direction: column; border-right: 1px solid rgb(16 44 52 / 8%); background: var(--white); box-shadow: 12px 0 40px rgb(31 57 66 / 4%); }
  .portal-brand { min-height: var(--header); display: flex; align-items: center; gap: 10px; padding: 0 24px; border-bottom: 1px solid var(--line); }
  .portal-brand-mark { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 50% 50% 46% 54%; background: var(--yellow); font-size: 1.05rem; font-weight: 900; transform: rotate(-4deg); }
  .portal-brand span:last-child { display: flex; flex-direction: column; font-size: .9rem; font-weight: 900; letter-spacing: -.03em; }
  .portal-brand b { color: var(--green); }
  .portal-brand small { margin-top: 2px; color: var(--muted); font-size: .62rem; letter-spacing: .07em; }
  .role-chip { margin: 24px 18px 14px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--role-tint); }
  .role-chip small { display: block; color: var(--green); font-size: .67rem; font-weight: 900; letter-spacing: .12em; }
  .role-chip b { display: block; margin-top: 4px; font-size: .95rem; }
  .rail-nav { display: grid; gap: 5px; padding: 0 14px; }
  .rail-nav a { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 999px; color: #40575e; font-size: .82rem; font-weight: 800; transition: background .18s ease, transform .18s ease; }
  .rail-nav a span { width: 26px; height: 26px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--paper); color: var(--muted); font-size: .62rem; letter-spacing: .04em; }
  .rail-nav a:hover { background: var(--paper); color: var(--ink); transform: translateX(2px); }
  .rail-nav a[aria-current="page"] { background: var(--role-soft); color: var(--ink); }
  .rail-nav a[aria-current="page"] span { background: rgb(255 255 255 / 72%); color: var(--green-deep); }
  .rail-foot { margin-top: auto; padding: 20px 24px 25px; border-top: 1px solid var(--line); }
  .rail-foot a { min-height: 44px; display: inline-flex; align-items: center; color: var(--green); font-size: .76rem; font-weight: 900; }
  .rail-foot p { margin-top: 7px; color: var(--muted); font-size: .66rem; }
  .portal-header { position: sticky; z-index: 15; top: 0; min-height: var(--header); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 max(24px, calc((100vw - var(--rail) - var(--content)) / 2)); border-bottom: 1px solid rgb(16 44 52 / 7%); background: rgb(247 248 250 / 90%); backdrop-filter: blur(18px); }
  .header-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
  .header-actions a, .header-actions button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 17px; border: 0; border-radius: 999px; background: var(--white); font-size: .74rem; font-weight: 900; box-shadow: var(--shadow-soft); }
  .header-actions .header-primary { background: var(--yellow); box-shadow: none; }
  .portal-main { width: min(calc(100% - 48px), var(--content)); margin: 0 auto; padding: 32px 0 80px; }
  .mobile-role-nav { display: none; }

  .flow-shell { min-height: 100vh; }
  .flow-header { width: min(calc(100% - 40px), 1080px); min-height: var(--header); display: flex; align-items: center; justify-content: space-between; margin: 0 auto; border-bottom: 1px solid var(--line); }
  .flow-header .portal-brand { min-height: var(--header); padding: 0; border: 0; }
  .flow-header > a:last-child { min-height: 44px; display: inline-flex; align-items: center; color: var(--green); font-size: .75rem; font-weight: 900; }
  .shell-flow .portal-main { width: min(calc(100% - 40px), 940px); padding-top: 28px; }
  .shell-flow .portal-main > .breadcrumb { display: flex; }
  .shell-flow .page-intro { grid-template-columns: 1fr; }
  .shell-flow .selection-summary { width: 100%; }
  .shell-flow .success-stage { min-height: 430px; }
}

@layer components {
  .portal-main > .breadcrumb { margin-bottom: 18px; }
  .portal-header > .breadcrumb { margin: 0; }
  .breadcrumb { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .74rem; font-weight: 800; }
  .breadcrumb > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .breadcrumb > * + *::before { content: "/"; margin-right: 8px; color: #aab7bb; }
  .breadcrumb a:hover { color: var(--green); }
  .breadcrumb span[aria-current="page"] { color: var(--ink); }
  .portal-header .breadcrumb + .header-actions { flex: none; }
  .portal-layout > .portal-main > .breadcrumb { display: flex; }

  .journey-strip { display: grid; grid-template-columns: auto minmax(180px, 340px) auto; align-items: center; gap: 18px; margin-bottom: 24px; padding: 14px 17px; border-radius: 999px; background: var(--white); box-shadow: var(--shadow-soft); }
  .journey-strip > div:first-child { display: flex; align-items: baseline; gap: 9px; }
  .journey-strip small { color: var(--green); font-size: .68rem; font-weight: 900; }
  .journey-strip b { font-size: .78rem; }
  .journey-strip > span { color: var(--muted); font-size: .7rem; }
  .journey-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e6ecee; }
  .journey-track i { display: block; height: 100%; border-radius: inherit; background: var(--green); }

  .page-intro { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding: clamp(24px, 3vw, 34px); border-radius: var(--radius-xl); background: var(--role-tint); }
  .page-intro::after { content: ""; position: absolute; width: 180px; height: 180px; right: -82px; top: -92px; border: 34px solid rgb(255 255 255 / 38%); border-radius: 50%; pointer-events: none; }
  .page-intro-copy { position: relative; z-index: 1; min-width: 0; }
  .page-kicker { color: var(--green); font-size: .72rem; font-weight: 900; letter-spacing: .13em; }
  .page-intro h1 { max-width: 780px; margin-top: 7px; font-size: clamp(1.85rem, 3vw, 2.65rem); text-wrap: balance; }
  .page-intro p { max-width: 720px; margin-top: 9px; color: #536970; font-size: .88rem; text-wrap: pretty; }
  .context-note { max-width: 720px; display: flex; gap: 9px; margin-top: 20px; padding: 12px 15px; border-radius: var(--radius-xs); background: rgb(255 255 255 / 68%); color: #536970; font-size: .76rem; }
  .context-note b { flex: none; color: var(--ink); }
  .selection-summary { position: relative; z-index: 1; width: min(100%, 320px); padding: 19px; border-radius: var(--radius); background: rgb(255 255 255 / 84%); box-shadow: var(--shadow-soft); }
  .selection-summary > small { display: block; margin-bottom: 8px; color: var(--green); font-size: .66rem; font-weight: 900; letter-spacing: .08em; }
  .selection-summary dl { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid rgb(16 44 52 / 12%); font-size: .74rem; }
  .selection-summary dt { color: var(--muted); }
  .selection-summary dd { font-weight: 900; text-align: right; }

  .workspace { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; margin-top: 20px; align-items: start; }
  .workspace.single { grid-template-columns: 1fr; }
  .workspace-main, .workspace-side { display: grid; gap: 16px; min-width: 0; }
  .panel, .section-block { overflow: hidden; border: 1px solid rgb(16 44 52 / 7%); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-soft); }
  .panel-head, .section-head { min-height: 64px; padding: 16px 19px; border-bottom: 1px solid var(--line); }
  .panel-head.split, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
  .panel-head small, .section-head span, .catalog-toolbar small, .schedule-head small, .time-section small { color: var(--green); font-size: .66rem; font-weight: 900; letter-spacing: .1em; }
  .panel-head h2, .section-head h2, .catalog-toolbar h2, .schedule-head h2 { margin-top: 4px; font-size: 1.16rem; }
  .section-head > b { color: var(--muted); font-size: .7rem; }
  .section-body { padding: 22px; }
  .panel > .field-grid, .panel > form.field-grid, .panel > .detail-columns, .panel > .metric-strip { padding: 18px; }
  .panel > .tabs { padding: 18px 22px; }
  .panel > .action-bar { padding: 18px; }

  .auth-form { width: min(100%, 620px); margin: 0 auto; }
  .auth-card { overflow: visible; }
  .auth-card > .field-grid { grid-template-columns: 1fr; }
  .auth-card .action-bar { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .social-login, .demo-account-panel { margin: 0 18px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
  .social-login summary, .demo-account-panel summary { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; color: var(--green-deep); font-size: .75rem; font-weight: 900; cursor: pointer; list-style: none; }
  .social-login summary::-webkit-details-marker, .demo-account-panel summary::-webkit-details-marker { display: none; }
  .social-login summary::after, .demo-account-panel summary::after { content: "+"; font-size: 1rem; }
  .social-login[open] summary::after, .demo-account-panel[open] summary::after { content: "−"; }
  .social-login .payment-options, .demo-account-body { padding: 0 14px 14px; }
  .demo-account-body p { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
  .demo-account-body p span { padding: 5px 9px; border-radius: 999px; background: var(--white); color: var(--muted); font-size: .69rem; }
  .demo-account-body .action-bar { padding: 0; }
  .demo-account-list { display: grid; gap: 8px; margin-bottom: 12px; }
  .demo-account-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); color: var(--ink); text-align: left; cursor: pointer; }
  .demo-account-item:hover, .demo-account-item:focus-visible { border-color: var(--green); box-shadow: 0 8px 20px rgb(16 44 52 / 8%); }
  .demo-account-item span { display: grid; gap: 2px; }
  .demo-account-item small, .demo-account-item i { color: var(--muted); font-size: .72rem; font-style: normal; }
  .demo-account-item i { color: var(--green-deep); font-weight: 800; white-space: nowrap; }
  .auth-role-note { margin: 0 18px 16px; }
  .legacy-login-forward { max-width: 620px; margin-inline: auto; }
  body[data-page-id="n9"] .portal-main,
  body[data-page-id="n61"] .portal-main,
  body[data-page-id="n77"] .portal-main { width: min(calc(100% - 32px), 620px); padding-top: 18px; }
  body[data-page-id="n9"] .portal-main > .breadcrumb,
  body[data-page-id="n61"] .portal-main > .breadcrumb,
  body[data-page-id="n77"] .portal-main > .breadcrumb { display: none; }
  body[data-page-id="n9"] .page-intro,
  body[data-page-id="n61"] .page-intro,
  body[data-page-id="n77"] .page-intro { padding: 18px 4px 12px; background: transparent; }
  body[data-page-id="n9"] .page-intro::after,
  body[data-page-id="n61"] .page-intro::after,
  body[data-page-id="n77"] .page-intro::after { display: none; }
  body[data-page-id="n9"] .page-kicker,
  body[data-page-id="n61"] .page-kicker,
  body[data-page-id="n77"] .page-kicker { display: none; }
  body[data-page-id="n40"] .page-intro,
  body[data-page-id="n63"] .page-intro,
  body[data-page-id="n79"] .page-intro { padding: 18px 20px; }
  body[data-page-id="n40"] .page-intro h1,
  body[data-page-id="n63"] .page-intro h1,
  body[data-page-id="n79"] .page-intro h1 { font-size: clamp(1.55rem, 3vw, 2rem); }
  .section-list { display: grid; }
  .section-list li { min-height: 57px; display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 12px; align-items: center; border-bottom: 1px solid var(--line); font-size: .82rem; }
  .section-list li:last-child { border-bottom: 0; }
  .section-list li::before { content: counter(list-item, decimal-leading-zero); color: var(--green); font-size: .64rem; font-weight: 900; }

  .product-form { display: grid; gap: 20px; }
  .form-group { min-width: 0; overflow: hidden; padding: 0; border: 1px solid rgb(16 44 52 / 7%); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-soft); }
  .form-group legend { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--role-tint); }
  .form-group legend small { color: var(--green); font-size: .66rem; font-weight: 900; letter-spacing: .09em; }
  .form-group legend b { font-size: 1rem; }
  .form-group .field-grid { padding: 22px; }
  .field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .field { display: grid; gap: 8px; min-width: 0; }
  .field.full { grid-column: 1 / -1; }
  .field span { font-size: .76rem; font-weight: 900; }
  .field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--paper); font-size: .8rem; transition: border-color .15s, background .15s, box-shadow .15s; }
  .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); background: var(--white); box-shadow: 0 0 0 4px rgb(22 125 116 / 10%); outline: 0; }
  .field span:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 9px; }
  .field input[type="checkbox"] { width: 19px; height: 19px; min-height: 19px; flex: none; padding: 0; accent-color: var(--green); }
  .field textarea { min-height: 120px; resize: vertical; }
  .field.compact input, .field.compact select { min-height: 44px; }
  .check-field { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; color: #40575e; font-size: .78rem; font-weight: 800; }
  .check-field input { width: 19px; height: 19px; flex: none; accent-color: var(--green); }

  .action-bar { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 22px; }
  .action { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 21px; border: 0; border-radius: 999px; background: var(--white); color: var(--ink); font-size: .8rem; font-weight: 900; box-shadow: inset 0 0 0 1px var(--line); transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
  .action::after { content: "→"; }
  .action:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
  .action.primary { background: var(--yellow); box-shadow: 0 8px 18px rgb(200 143 0 / 14%); }
  .action.secondary { background: var(--mint); box-shadow: none; }
  .action.danger { color: var(--danger); box-shadow: inset 0 0 0 1px rgb(185 77 82 / 30%); }
  button.action[disabled] { cursor: not-allowed; background: var(--paper); color: var(--muted); box-shadow: none; }
  button.action[disabled]::after { content: "준비 중"; font-size: .64rem; }

  .choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .choice { position: relative; min-height: 94px; display: flex; flex-direction: column; justify-content: flex-end; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
  .choice:hover, .choice.selected { border-color: transparent; background: var(--yellow-soft); box-shadow: var(--shadow-soft); }
  .choice small { color: var(--green); font-size: .62rem; font-weight: 900; }
  .choice b { margin-top: 5px; font-size: .95rem; }
  .payment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 22px; }
  .payment-options .choice { min-height: 70px; justify-content: center; border-radius: var(--radius-sm); background: var(--paper); font-size: .78rem; font-weight: 900; }
  .payment-options .choice.selected { background: var(--yellow-soft); }
  .payment-options + .check-field { margin: 0 22px 20px; }

  .catalog-layout { display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 24px; align-items: start; }
  .filter-panel { position: sticky; top: 96px; display: grid; gap: 18px; padding: 23px; border-radius: var(--radius); background: var(--mint); }
  .filter-panel > small { color: var(--green); font-size: .66rem; font-weight: 900; letter-spacing: .1em; }
  .filter-panel h2 { font-size: 1.2rem; }
  .catalog-toolbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; padding: 5px 2px 18px; border-bottom: 1px solid var(--line); }
  .catalog-toolbar input { width: 220px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
  .product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .product-card.data-row { min-height: 292px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px; border: 0; border-radius: var(--radius); background: var(--sky); box-shadow: none; }
  .product-card.data-row:nth-child(4n + 2) { background: var(--yellow-soft); }
  .product-card.data-row:nth-child(4n + 3) { background: var(--mint); }
  .product-card.data-row:nth-child(4n) { background: var(--coral); }
  .product-card > small { color: var(--muted); font-size: .68rem; }
  .product-card h3 { margin-top: 7px; font-size: 1.28rem; }
  .product-card p { min-height: 44px; color: #526970; font-size: .78rem; }
  .product-card dl { width: 100%; display: flex; justify-content: space-between; margin-top: auto; padding-top: 14px; border-top: 1px solid rgb(16 44 52 / 12%); font-size: .76rem; }
  .product-card dd { font-weight: 900; }
  .product-card .action { width: 100%; margin-top: 4px; }

  .teacher-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .teacher-card { overflow: hidden; border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-soft); }
  .teacher-card > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 24%; background: var(--mint); }
  .teacher-card > div { padding: 20px; }
  .teacher-card h3 { margin-top: 12px; font-size: 1.3rem; }
  .teacher-card p { margin-top: 5px; color: var(--green); font-size: .76rem; font-weight: 800; }
  .teacher-card blockquote { min-height: 46px; margin-top: 13px; color: #526970; font-size: .78rem; }
  .availability { display: flex; align-items: center; gap: 7px; margin-top: 13px; color: var(--muted); font-size: .72rem; }
  .availability i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
  .teacher-card .action { width: 100%; margin-top: 17px; }

  .schedule-shell { overflow: hidden; border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-soft); }
  .schedule-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px; border-bottom: 1px solid var(--line); background: var(--sky); }
  .week-switch { display: flex; align-items: center; gap: 12px; }
  .week-switch button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 72%); }
  .week-switch b { font-size: .78rem; }
  .date-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; padding: 18px; border-bottom: 1px solid var(--line); }
  .date-chip { min-height: 92px; border: 0; border-radius: var(--radius-sm); background: var(--paper); }
  .date-chip small, .date-chip span { display: block; color: var(--muted); font-size: .64rem; }
  .date-chip b { display: block; margin: 7px 0; font-size: 1.25rem; }
  .date-chip.selected { background: var(--yellow); box-shadow: var(--shadow-soft); }
  .time-section { padding: 24px; }
  .time-section h3 { margin-top: 4px; }
  .time-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
  .time-chip { min-height: 66px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-weight: 900; }
  .time-chip small { display: block; margin-top: 3px; color: var(--muted); letter-spacing: 0; }
  .time-chip.selected { border-color: transparent; background: var(--mint); box-shadow: var(--shadow-soft); }

  .checkout-grid, .detail-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .receipt { padding: 8px 22px 20px; }
  .receipt > div, .confirmation-card > div { display: flex; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .78rem; }
  .receipt dt { color: var(--muted); }
  .receipt dd, .confirmation-card dd { font-weight: 900; text-align: right; }
  .receipt .total { margin-top: 8px; border-bottom: 0; font-size: .9rem; }
  .confirmation-card { width: min(100%, 530px); margin: 28px auto 0; padding: 9px 22px; border-radius: var(--radius); background: var(--white); text-align: left; box-shadow: var(--shadow-soft); }
  .confirmation-card > div:last-child { border-bottom: 0; }

  .quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; padding: 22px; }
  .quick-grid a, .quick-grid button { min-height: 110px; display: flex; flex-direction: column; justify-content: space-between; padding: 17px; border: 0; border-radius: var(--radius-sm); background: var(--paper); color: inherit; text-align: left; font: inherit; cursor: pointer; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
  .quick-grid a:nth-child(4n + 1), .quick-grid button:nth-child(4n + 1) { background: var(--sky); }
  .quick-grid a:nth-child(4n + 2), .quick-grid button:nth-child(4n + 2) { background: var(--mint); }
  .quick-grid a:nth-child(4n + 3), .quick-grid button:nth-child(4n + 3) { background: var(--yellow-soft); }
  .quick-grid a:nth-child(4n), .quick-grid button:nth-child(4n) { background: var(--coral); }
  .quick-grid a:hover, .quick-grid button:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
  .quick-grid b { font-size: .9rem; }
  .quick-grid span { color: var(--green); font-size: .69rem; font-weight: 900; }

  .activity-list, .lesson-list { display: grid; }
  .activity-list article, .lesson-row { min-height: 82px; display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); }
  .activity-list article:last-child, .lesson-row:last-child { border-bottom: 0; }
  .activity-list time, .lesson-row time { color: var(--green); font-size: .72rem; font-weight: 900; }
  .activity-list b, .lesson-row b { font-size: .82rem; }
  .activity-list p, .lesson-row p { margin-top: 4px; color: var(--muted); font-size: .72rem; }
  .tabs { display: flex; flex-wrap: wrap; gap: 6px; }
  .tabs button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--paper); font-size: .7rem; font-weight: 900; }
  .tabs button.active { background: var(--yellow); }
  .lesson-row { grid-template-columns: 128px minmax(0, 1fr) auto 74px; }
  .lesson-row > i { color: var(--green); font-size: .71rem; font-style: normal; font-weight: 900; text-align: right; }

  .detail-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 28px; align-items: center; padding: clamp(28px, 4vw, 42px); border-radius: var(--radius-xl); background: var(--mint); }
  .detail-hero::after { content: ""; position: absolute; width: 160px; height: 160px; right: -70px; bottom: -74px; border: 30px solid rgb(255 255 255 / 34%); border-radius: 50%; }
  .detail-hero > * { position: relative; z-index: 1; }
  .detail-hero > div:first-child > small { display: block; margin-top: 16px; color: var(--green); font-size: .72rem; font-weight: 900; }
  .detail-hero h2 { margin-top: 9px; font-size: clamp(1.65rem, 3vw, 2.35rem); }
  .detail-hero p { max-width: 660px; margin-top: 12px; color: #526970; font-size: .84rem; }
  .score-ring { width: 130px; height: 130px; display: grid; place-content: center; justify-self: end; border: 12px solid var(--yellow); border-radius: 50%; background: var(--white); text-align: center; box-shadow: var(--shadow-soft); }
  .score-ring b { font-size: 1.8rem; }
  .score-ring span { color: var(--muted); font-size: .64rem; }
  .feedback-note { padding: 22px; border-radius: var(--radius-sm); background: var(--role-tint); }
  .linked-note { display: block; color: inherit; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
  .linked-note:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
  .linked-note:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
  .feedback-note p { color: #40575e; font-size: .82rem; line-height: 1.8; }
  .feedback-note > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
  .feedback-note span { padding: 7px 11px; border-radius: 99px; background: var(--white); color: var(--green); font-size: .68rem; font-weight: 900; }
  .resource-list { padding: 8px 22px; }
  .resource-list li { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: .76rem; }
  .resource-list li:last-child { border-bottom: 0; }
  .resource-list span { color: var(--muted); }
  .definition-list { padding: 9px 22px; }
  .definition-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .76rem; }
  .definition-list > div:last-child { border-bottom: 0; }
  .definition-list dt { color: var(--muted); }
  .definition-list dd { font-weight: 900; text-align: right; }

  .summary-panel { padding: 24px; border-radius: var(--radius); background: var(--yellow-soft); }
  .summary-panel small { color: var(--green); font-size: .66rem; font-weight: 900; letter-spacing: .1em; }
  .summary-panel h2 { margin-top: 9px; font-size: 1.35rem; }
  .summary-panel p { margin-top: 10px; color: #526970; font-size: .8rem; }
  .summary-panel dl { margin-top: 18px; border-top: 1px solid rgb(16 44 52 / 14%); }
  .summary-panel dl div { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid rgb(16 44 52 / 10%); font-size: .76rem; }
  .summary-panel dt { color: var(--muted); }
  .summary-panel dd { font-weight: 900; text-align: right; }

  .metric-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
  .metric-strip article { min-height: 126px; padding: 21px; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-soft); }
  .metric-strip article:nth-child(4n + 1) { background: var(--sky); }
  .metric-strip article:nth-child(4n + 2) { background: var(--mint); }
  .metric-strip article:nth-child(4n + 3) { background: var(--yellow-soft); }
  .metric-strip article:nth-child(4n) { background: var(--coral); }
  .metric-strip small { color: #536970; font-size: .64rem; font-weight: 900; letter-spacing: .08em; }
  .metric-strip b { display: block; margin-top: 13px; font-size: 1.4rem; }
  .metric-strip span { display: block; margin-top: 7px; color: var(--green-deep); font-size: .72rem; font-weight: 800; }

  .data-list { overflow: hidden; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-soft); }
  .data-row { min-height: 74px; display: grid; grid-template-columns: 92px minmax(180px, 1.3fr) minmax(150px, 1fr) 110px; gap: 18px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); }
  .data-row:last-child { border-bottom: 0; }
  .data-row small { color: var(--muted); font-size: .66rem; }
  .data-row b { font-size: .82rem; }
  .data-row p { color: #536970; font-size: .76rem; }
  .data-row a { justify-self: end; color: var(--green); font-size: .74rem; font-weight: 900; }
  .status { display: inline-flex; width: fit-content; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 99px; background: var(--mint); color: var(--green-deep); font-size: .65rem; font-weight: 900; }
  .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
  .status.wait { background: var(--yellow-soft); color: #7a5a00; }
  .status.alert { background: var(--coral); color: var(--danger); }

  .table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
  table { width: 100%; border-collapse: collapse; font-size: .76rem; }
  th { padding: 13px 16px; background: var(--role-tint); color: var(--muted); text-align: left; }
  tr.data-row { display: table-row; }
  td { padding: 16px; border-bottom: 1px solid var(--line); }
  td:last-child { text-align: right; }
  td a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding-inline: 8px; color: var(--green); font-weight: 900; }
  td select, td input { min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--paper); }

  .timeline { position: relative; display: grid; gap: 2px; padding: 8px 18px; }
  .timeline::before { content: ""; position: absolute; left: 31px; top: 28px; bottom: 28px; width: 2px; background: var(--line); }
  .timeline li { position: relative; min-height: 76px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 13px 8px; border-radius: var(--radius-sm); }
  .timeline li::before { content: ""; z-index: 1; width: 27px; height: 27px; border: 7px solid var(--white); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--line); }
  .timeline li.current { background: var(--yellow-soft); }
  .timeline li.current::before { background: var(--yellow); box-shadow: 0 0 0 4px rgb(255 189 26 / 22%); }
  .timeline b { font-size: .82rem; }
  .timeline p { margin-top: 5px; color: var(--muted); font-size: .73rem; }
  .calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; padding: 5px; }
  .calendar span { min-height: 66px; padding: 9px; border-radius: var(--radius-xs); background: var(--paper); color: var(--muted); font-size: .68rem; }
  .calendar span.available { background: var(--mint); color: var(--green-deep); font-weight: 900; }
  .calendar span.selected { background: var(--yellow); color: var(--ink); font-weight: 900; }
  .teacher-block { display: grid; grid-template-columns: 90px 1fr; gap: 18px; align-items: center; }
  .teacher-block img { width: 90px; height: 90px; border: 7px solid var(--white); border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-soft); }
  .teacher-block small { color: var(--green); font-size: .64rem; font-weight: 900; letter-spacing: .1em; }
  .teacher-block h2 { margin-top: 5px; font-size: 1.35rem; }
  .teacher-block p { margin-top: 7px; color: var(--muted); font-size: .76rem; }

  .success-stage { position: relative; overflow: hidden; min-height: 470px; display: grid; place-items: center; padding: 54px 24px; border-radius: var(--radius-xl); background: var(--sky); text-align: center; }
  .success-stage::after { content: ""; position: absolute; width: 220px; height: 220px; right: -80px; bottom: -100px; border: 44px solid rgb(255 255 255 / 28%); border-radius: 50%; }
  .success-stage > * { position: relative; z-index: 1; }
  .success-mark { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; background: var(--yellow); font-size: 1.6rem; font-weight: 900; box-shadow: var(--shadow-soft); }
  .success-stage small { display: block; margin-top: 22px; color: var(--green); font-size: .68rem; font-weight: 900; letter-spacing: .13em; }
  .success-stage h2 { max-width: 620px; margin: 10px auto 0; font-size: clamp(1.9rem, 4vw, 3.1rem); }
  .success-stage p { max-width: 560px; margin: 14px auto 0; color: #526970; font-size: .86rem; }

  .flow-footer { position: sticky; z-index: 10; bottom: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 38px; padding: 10px; border-radius: 999px; background: rgb(255 255 255 / 92%); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
  .flow-footer a { min-height: 60px; display: flex; flex-direction: column; justify-content: center; padding: 10px 18px; border-radius: 999px; }
  .flow-footer small { color: var(--muted); font-size: .64rem; font-weight: 900; }
  .flow-footer b { margin-top: 3px; font-size: .8rem; }
  .flow-next { align-items: flex-end; background: var(--yellow); text-align: right; }
  .flow-back { background: var(--paper); }

  .call-chat-signature { position: relative; width: 190px; min-height: 250px; justify-self: end; }
  .mini-call-card { position: absolute; z-index: 1; inset: 0 22px 20px 0; display: flex; flex-direction: column; align-items: center; padding: 18px 14px; border-radius: 28px; background: var(--white); box-shadow: var(--shadow); text-align: center; transform: rotate(-3deg); }
  .mini-call-card img { width: 76px; height: 76px; margin: 15px auto 9px; border: 6px solid var(--sky); border-radius: 50%; object-fit: cover; }
  .mini-call-card > b { font-size: .84rem; }
  .mini-call-card > small { margin-top: 3px; color: var(--muted); font-size: .62rem; }
  .live-pill { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; padding: 5px 8px; border-radius: 999px; background: var(--coral); color: var(--danger); font-size: .58rem; font-weight: 900; }
  .live-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .mini-wave { height: 28px; display: flex; align-items: center; justify-content: center; gap: 3px; }
  .mini-wave i { width: 3px; height: 9px; border-radius: 3px; background: var(--green); }
  .mini-wave i:nth-child(2), .mini-wave i:nth-child(4) { height: 19px; }
  .mini-wave i:nth-child(3) { height: 13px; }
  .mini-chat-card { position: absolute; z-index: 2; right: -28px; bottom: 0; width: 150px; padding: 13px; border-radius: 18px; background: var(--yellow-soft); box-shadow: var(--shadow-soft); transform: rotate(3deg); }
  .mini-chat-card small { color: var(--green); font-size: .58rem; font-weight: 900; }
  .mini-chat-card p { width: fit-content; margin-top: 7px; padding: 7px 9px; border-radius: 4px 12px 12px 12px; background: var(--mint); color: var(--ink); font-size: .58rem; }
  .mini-chat-card .student-bubble { margin-left: auto; border-radius: 12px 4px 12px 12px; background: var(--yellow); }
  .next-call-card { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 22px; align-items: center; margin: 22px; padding: 22px; border-radius: var(--radius); background: var(--sky); }
  .next-call-card > img { width: 112px; height: 112px; border: 7px solid var(--white); border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-soft); }
  .connection-method { margin-top: 7px; color: var(--green); font-size: .7rem; font-weight: 900; }
  .next-call-copy > small { display: block; margin-top: 12px; color: var(--green); font-size: .7rem; font-weight: 900; }
  .next-call-copy h3 { margin-top: 5px; font-size: 1.24rem; }
  .next-call-copy p { margin-top: 7px; color: #526970; font-size: .78rem; }
  .next-call-ready { min-width: 160px; padding: 15px; border-radius: var(--radius-sm); background: rgb(255 255 255 / 66%); text-align: center; }
  .next-call-ready .mini-wave { margin-bottom: 4px; }
  .next-call-ready b { display: block; font-size: .69rem; }
  .next-call-ready .action { width: 100%; margin-top: 12px; }
  .student-home-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booking-complete { min-height: 0; }
  .booking-primary-action { width: min(100%, 460px); margin-inline: auto; }
  .booking-primary-action .action { width: 100%; }
  .booking-support { width: min(100%, 620px); margin: 8px auto 0; padding: 0; border: 1px solid rgb(0 0 0 / 8%); border-radius: var(--radius-sm); background: rgb(255 255 255 / 70%); text-align: left; }
  .booking-support summary { min-height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; cursor: pointer; color: var(--green-deep); font-size: .76rem; font-weight: 900; }
  .booking-support summary::after { content: "+"; font-size: 1.1rem; }
  .booking-support[open] summary::after { content: "−"; }
  .booking-support-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 12px 12px; }
  .booking-support-links a { min-height: 46px; display: grid; place-items: center; padding: 8px; border-radius: var(--radius-xs); background: var(--white); color: var(--green-deep); font-size: .7rem; font-weight: 900; text-align: center; }

  .lesson-call-room { width: min(calc(100% - 28px), 680px); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 30px; background: transparent; box-shadow: var(--shadow); color: var(--ink); }
  .lesson-call-room::backdrop { background: rgb(14 34 38 / 72%); backdrop-filter: blur(8px); }
  .call-room-shell { overflow: auto; max-height: calc(100dvh - 32px); padding: 18px; border-radius: 30px; background: var(--paper); }
  .call-room-shell > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
  .call-room-shell > header > div { display: flex; align-items: center; gap: 9px; }
  .call-room-shell > header small { color: var(--muted); font-size: .68rem; font-weight: 800; }
  .call-room-close { width: 44px; height: 44px; border-radius: 50%; background: var(--white); color: var(--ink); font-size: 1.4rem; }
  .call-room-stage { display: grid; justify-items: center; padding: 20px 16px 16px; text-align: center; }
  .call-room-stage > img { width: 126px; height: 126px; border: 7px solid var(--white); border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-soft); }
  .call-avatar { width: 126px; height: 126px; display: grid; place-items: center; border: 7px solid var(--white); border-radius: 50%; background: var(--mint); color: var(--green-deep); font-size: 2.4rem; font-weight: 900; box-shadow: var(--shadow-soft); }
  .call-room-stage h2 { margin-top: 12px; font-size: 1.35rem; }
  .call-room-stage p { margin-top: 4px; color: var(--muted); font-size: .76rem; }
  .call-room-stage strong { margin-top: 14px; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
  .call-room-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .call-room-tools button { min-height: 62px; display: grid; place-items: center; align-content: center; gap: 3px; border-radius: var(--radius-sm); background: var(--white); color: var(--ink); }
  .call-room-tools button[aria-pressed="true"] { background: var(--yellow-soft); color: var(--green-deep); }
  .call-room-tools b { font-size: .72rem; }
  .call-room-tools span { color: var(--muted); font-size: .62rem; }
  .call-room-chat { margin-top: 10px; padding: 14px; border-radius: var(--radius-sm); background: var(--white); }
  .call-room-chat [data-call-messages] { max-height: 116px; overflow-y: auto; }
  .call-room-chat p { width: fit-content; max-width: 88%; margin-bottom: 7px; padding: 8px 10px; border-radius: 4px 13px 13px 13px; background: var(--mint); font-size: .7rem; }
  .call-room-chat p.student-bubble { margin-left: auto; border-radius: 13px 4px 13px 13px; background: var(--yellow-soft); }
  .call-room-chat form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
  .call-room-chat input { min-width: 0; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
  .call-room-chat button { min-width: 62px; min-height: 46px; padding: 0 14px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-weight: 900; }
  .call-end-confirm { margin-top: 10px; padding: 14px; border: 1px solid rgb(202 86 86 / 18%); border-radius: var(--radius-sm); background: #fff5f5; }
  .call-end-confirm p { margin-bottom: 10px; font-weight: 900; text-align: center; }
  .call-end-confirm > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .call-room-end { width: 100%; margin-top: 10px; }
  .inline-call-entry { min-height: 38px; margin-top: 8px; padding: 0 13px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: .68rem; font-weight: 900; }
  .compact-home-heading { margin-bottom: 16px; }
  .dashboard-more { overflow: hidden; }
  .dashboard-more > summary { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; cursor: pointer; list-style: none; }
  .dashboard-more > summary::-webkit-details-marker { display: none; }
  .dashboard-more > summary span { display: grid; gap: 4px; }
  .dashboard-more > summary small { color: var(--green); font-size: .62rem; font-weight: 900; letter-spacing: .1em; }
  .dashboard-more > summary b { font-size: .95rem; }
  .dashboard-more > summary i { color: var(--green-deep); font-size: .68rem; font-style: normal; font-weight: 900; }
  .dashboard-more[open] > summary i { font-size: 0; }
  .dashboard-more[open] > summary i::after { content: "닫기"; font-size: .68rem; }

  .admin-filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: var(--role-tint); }
  .admin-filter-bar > :first-child { grid-column: span 2; }
  .admin-form-note { grid-column: 1 / -1; padding: 12px 14px; border-radius: var(--radius-xs); background: var(--coral); color: #6b5558; font-size: .74rem; }
  .admin-login-form { width: min(100%, 620px); margin-inline: auto; }
  .admin-detail-hero { grid-template-columns: minmax(0, 1fr) auto; }
  .admin-detail-hero .action-bar { justify-content: flex-end; padding-top: 0; }

  .toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; max-width: calc(100% - 32px); padding: 14px 19px; border-radius: 999px; background: var(--ink); color: var(--white); font-size: .76rem; font-weight: 800; opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: .2s ease; }
  .toast.show { opacity: 1; transform: translate(-50%, 0); }
}

@layer pages {
  .role-public { --role-soft: var(--sky); --role-tint: #eaf5fb; }
  .role-student { --role-soft: var(--sky); --role-tint: #eaf5fb; }
  .role-teacher { --role-soft: var(--mint); --role-tint: #eaf6f2; }
  .role-admin { --role-soft: var(--coral); --role-tint: #fcedee; }
  .role-teacher .page-intro { background: var(--mint); }
  .role-admin .page-intro { background: var(--coral); }
  .role-public .role-chip, .role-student .role-chip { background: #eaf5fb; }
  .role-teacher .role-chip { background: #eaf6f2; }
  .role-admin .role-chip { background: #fcedee; }
  .kind-success .workspace, .kind-dashboard .workspace, .kind-list .workspace { grid-template-columns: 1fr; }
}

@layer responsive {
  @media (max-width: 1040px) {
    :root { --rail: 216px; }
    .portal-main { width: min(calc(100% - 36px), var(--content)); }
    .workspace { grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
    .data-row { grid-template-columns: 75px minmax(150px, 1.3fr) minmax(130px, 1fr) 90px; gap: 12px; }
    .admin-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  @media (max-width: 900px) {
    .catalog-layout { grid-template-columns: 1fr; }
    .filter-panel { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-panel > small, .filter-panel h2 { grid-column: 1 / -1; }
    .teacher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }

  @media (max-width: 760px) {
    :root { --header: 64px; --radius-xl: 28px; --radius-lg: 25px; --radius: 21px; }
    body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    .portal-layout { padding-left: 0; }
    .portal-rail { display: none; }
    .portal-header { display: none; }
    .portal-header > .breadcrumb { display: none; }
    .portal-layout > .portal-main > .breadcrumb { display: flex; }
    body:is([data-page-id="n40"], [data-page-id="n63"], [data-page-id="n79"]) .portal-main > .breadcrumb { display: none; }
    .breadcrumb a, .breadcrumb span { min-height: 44px; display: inline-flex; align-items: center; }
    .header-actions a:not(.header-primary), .header-actions button { display: none; }
    .header-actions .header-primary { min-height: 44px; padding: 0 13px; }
    .portal-main { width: calc(100% - 28px); padding: 22px 0 54px; }
    .journey-strip { grid-template-columns: 1fr auto; gap: 9px 14px; margin-bottom: 20px; border-radius: var(--radius-sm); }
    .journey-track { grid-column: 1 / -1; grid-row: 2; }
    .journey-strip > span { grid-column: 2; grid-row: 1; text-align: right; }
    .page-intro { grid-template-columns: 1fr; gap: 16px; padding: 21px 18px; }
    .page-intro h1 { font-size: clamp(1.75rem, 8vw, 2.25rem); line-height: 1.08; }
    .page-intro p { font-size: .84rem; }
    body:is([data-page-id="n40"], [data-page-id="n63"], [data-page-id="n79"]) .page-intro { padding: 16px 18px; }
    .selection-summary { width: 100%; }
    .context-note { display: grid; }
    .workspace, .kind-dashboard .workspace { grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
    .workspace-side { order: -1; }
    .catalog-layout, .product-grid, .teacher-grid, .checkout-grid, .detail-columns { grid-template-columns: 1fr; }
    .filter-panel { grid-template-columns: 1fr; }
    .filter-panel > small, .filter-panel h2 { grid-column: auto; }
    .catalog-toolbar, .schedule-head, .panel-head.split { align-items: stretch; flex-direction: column; }
    .catalog-toolbar input { width: 100%; }
    .teacher-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
    .teacher-card > img { width: 112px; height: 100%; min-height: 250px; aspect-ratio: auto; }
    .date-strip { overflow-x: auto; padding: 10px; }
    .date-chip { min-width: 64px; min-height: 80px; }
    .time-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 15px; }
    .activity-list article { grid-template-columns: 60px minmax(0, 1fr); gap: 10px; padding: 13px 15px; }
    .activity-list .status { grid-column: 2; }
    .activity-list article > .action { width: 100%; grid-column: 1 / -1; }
    .lesson-row { grid-template-columns: 1fr auto; gap: 8px; padding: 15px; }
    .lesson-row time { grid-column: 1; }
    .lesson-row > div { grid-column: 1; }
    .lesson-row .status { grid-column: 2; grid-row: 1; }
    .lesson-row > i { grid-column: 2; grid-row: 2; }
    .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
    .tabs button { flex: none; }
    .detail-hero { grid-template-columns: 1fr; padding: 24px 21px; }
    .score-ring { width: 100px; height: 100px; justify-self: start; border-width: 9px; }
    .call-chat-signature { width: min(230px, 100%); min-height: 250px; justify-self: start; }
    .next-call-card { grid-template-columns: 76px minmax(0, 1fr); gap: 14px; margin: 15px; padding: 17px; }
    .next-call-card > img { width: 76px; height: 76px; border-width: 5px; }
    .next-call-ready { grid-column: 1 / -1; min-width: 0; }
    .booking-support-links { grid-template-columns: 1fr; }
    .call-room-shell { padding: 14px; }
    .call-room-shell > header > div { align-items: flex-start; flex-direction: column; gap: 4px; }
    .call-room-stage { padding-block: 14px 10px; }
    .call-room-stage > img { width: 96px; height: 96px; }
    .call-avatar { width: 96px; height: 96px; font-size: 1.8rem; }
    .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-strip article { min-height: 108px; padding: 18px; }
    .field-grid, .choice-grid, .admin-filter-bar { grid-template-columns: 1fr; }
    .admin-filter-bar > :first-child { grid-column: auto; }
    .field.full { grid-column: auto; }
    .data-row { grid-template-columns: 68px minmax(0, 1fr) auto; gap: 9px; padding: 12px; }
    .data-row p { grid-column: 2 / -1; }
    .data-row a { grid-column: 3; grid-row: 1; }
    .section-head, .section-body { padding-inline: 16px; }
    .action-bar { display: grid; grid-template-columns: 1fr; }
    .action { width: 100%; }
    .calendar span { min-height: 54px; padding: 6px; font-size: .6rem; }
    .teacher-block { grid-template-columns: 70px 1fr; }
    .teacher-block img { width: 70px; height: 70px; }
    .table-wrap { margin-bottom: -1px; }
    table { min-width: 680px; }
    .admin-detail-hero { grid-template-columns: 1fr; }
    .admin-detail-hero .action-bar { justify-content: stretch; }
    .flow-footer { bottom: calc(76px + env(safe-area-inset-bottom)); grid-template-columns: 1fr 1.2fr; margin-top: 28px; border-radius: var(--radius-sm); }
    .flow-footer a { min-width: 0; padding: 9px 11px; border-radius: var(--radius-xs); }
    .flow-footer b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .shell-flow { padding-bottom: 0; }
    .shell-flow .flow-footer { bottom: 10px; }
    .flow-header { width: calc(100% - 28px); min-height: 64px; }
    .flow-header .portal-brand { min-height: 64px; }
    .flow-header > a:last-child { display: none; }
    .shell-flow .portal-main { width: calc(100% - 28px); }
    .role-admin.shell-portal { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    .mobile-role-nav { position: fixed; z-index: 50; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgb(255 255 255 / 94%); backdrop-filter: blur(18px); }
    .mobile-role-nav a { min-width: 0; min-height: 50px; display: grid; place-items: center; padding: 4px 2px; border-radius: 999px; color: var(--muted); font-size: .62rem; font-weight: 900; text-align: center; }
    .mobile-role-nav a[aria-current="page"] { background: var(--yellow); color: var(--ink); }
    .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  }

  @media (max-width: 430px) {
    .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .teacher-card { grid-template-columns: 96px minmax(0, 1fr); }
    .teacher-card > img { width: 96px; }
    .quick-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .quick-grid a, .quick-grid button { min-height: 100px; padding: 14px; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
  }
}
