body { margin: 0; background: #fff8f0; }
.ege-picker {
  --ink: #26251f; --muted: #625a4f; --line: #e7ded1; --rust: #95391f;
  --coral: #fa754b; --paper: #fffdf8; --sage: #edf2e8;
  color: var(--ink);
  font: 500 1rem/1.58 Manrope, system-ui, sans-serif;
}
.ege-picker *, .ege-picker *::before, .ege-picker *::after { box-sizing: border-box; }
.ege-picker [hidden] { display: none !important; }
.ege-heading > a { display: inline-block; margin-top: 6px; padding-block: 8px; }
.ege-related { scroll-margin-top: 156px; }
.ege-picker a { color: var(--rust); text-underline-offset: .2em; }
.ege-picker :focus-visible { outline: 2px solid #944728; outline-offset: 3px; }
.ege-wrap { width: min(1200px, 100% - 48px); margin-inline: auto; padding: 26px 0 64px; }
.ege-crumbs { display: flex; gap: .75rem; align-items: center; font-size: .88rem; }
.ege-heading { margin: 20px 0 24px; }
.ege-heading h1 {
  font: 650 clamp(1.7rem, 3.5vw, 2.85rem)/1.16 Unbounded, Manrope, system-ui, sans-serif;
  letter-spacing: -.025em; max-width: 1000px; margin: 0 0 14px; text-wrap: pretty;
}
.ege-heading p, .ege-handbook p { max-width: 86ch; margin: 8px 0 0; }
.ege-notice {
  border: 1px solid #ded0b9; border-radius: 12px; background: #fff1db;
  padding: 13px 16px; max-width: 100%; margin: 0 0 24px;
}
.ege-layout { display: grid; grid-template-columns: minmax(0, 298px) minmax(0, 1fr); align-items: start; gap: 24px; }
.ege-filters, .ege-card, .ege-handbook, .ege-related {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; min-width: 0;
}
.ege-filters { padding: 16px; }
.ege-picker h2 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 9px; }
.ege-filters h2 { font-size: 1.1rem; }
.ege-filters p { color: var(--muted); font-size: .9rem; margin: 0 0 13px; }
.ege-filters fieldset { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.ege-filters legend { font-weight: 750; padding: 0 0 4px; }
.ege-field { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 44px; }
.ege-subject-label { padding-block: 10px; font-size: .91rem; line-height: 1.25; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.ege-field[data-fixed="1"] .ege-subject-label { cursor: auto; }
.ege-picker input[type=checkbox] { margin: 0; accent-color: var(--rust); width: 18px; height: 18px; flex: 0 0 auto; }
.ege-picker input[type=number], .ege-picker select {
  font: 600 .9rem Manrope, system-ui, sans-serif; color: var(--ink); border: 1px solid #d5c6b5;
  border-radius: 8px; padding: 6px; background: #fff; min-height: 38px; min-width: 0;
}
.ege-score input { width: 69px; text-align: center; }
.ege-score input:disabled { visibility: hidden; }
.ege-select, .ege-total { display: grid; gap: 4px; margin: 13px 0; font-size: .92rem; font-weight: 750; }
.ege-total small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.ege-shortfall { display: flex; gap: 8px; align-items: start; font-size: .87rem; line-height: 1.35; margin: 0 0 12px; }
.ege-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.ege-picker button { min-height: 44px; border: 1px solid #d5c6b5; border-radius: 8px; padding: 8px 11px; background: var(--paper); color: var(--ink); font: 750 .86rem Manrope, system-ui, sans-serif; cursor: pointer; }
.ege-picker button:hover { border-color: var(--rust); }
.ege-picker button[type=submit] { background: var(--coral); border-color: var(--coral); }
.ege-picker button[type=submit]:hover { background: #f88764; border-color: var(--rust); }
.ege-list > p { margin: 0 0 12px; color: var(--muted); }
.ege-list h2, .ege-card { scroll-margin-top: 156px; }
.ege-cards { display: grid; gap: 10px; }
.ege-card { padding: 14px 16px; overflow-wrap: anywhere; }
.ege-card-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; color: var(--muted); font-size: .81rem; font-weight: 700; }
.ege-card p { margin: 0; }
.ege-card h3 { margin: 4px 0; font-size: 1.12rem; line-height: 1.28; }
.ege-university { font-size: .9rem; }
.ege-card .ege-evaluation { padding: 7px 10px; margin-top: 10px; background: var(--sage); border-radius: 8px; font-size: .85rem; }
.ege-card-data { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 7px; margin-top: 10px; }
.ege-card-data > div { background: #f7f2eb; border-radius: 9px; padding: 8px 10px; font-size: .83rem; }
.ege-card-data h4 { margin: 0 0 4px; font-size: .84rem; }
.ege-exams { margin: 0; list-style: none; padding: 0; }
.ege-exams li + li { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 5px; }
.ege-pass { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ege-pass strong { font-size: 1rem; }
.ege-card-data p { color: var(--muted); }
.ege-sources { margin-top: 8px; font-size: .82rem; }
.ege-sources summary { width: fit-content; min-height: 30px; cursor: pointer; color: var(--rust); }
.ege-sources ul { margin: 1px 0 5px; padding-left: 18px; }
.ege-more { margin-top: 12px; }
.ege-handbook, .ege-related { margin: 22px 0; padding: 16px 18px; }
.ege-related ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 7px; list-style: none; padding: 0; margin: 10px 0 0; }
.ege-related a, .ege-prep a { display: block; min-height: 44px; padding: 8px 10px; background: #f7f2eb; border-radius: 8px; font-size: .89rem; }
.ege-prep { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.ege-sr { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
@media (max-width: 760px) {
  .ege-wrap { width: calc(100% - 28px); padding-top: 16px; }
  .ege-layout { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .ege-mobile-filters { width: 100%; text-align: left; }
  .ege-mobile-filters::after { content: "→"; float: right; }
  #ege-filter-dialog {
    width: 100%; max-width: none; max-height: 85dvh; margin: auto 0 0;
    border: 1px solid var(--line); border-radius: 16px 16px 0 0;
    padding: 14px max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-bottom));
    color: var(--ink); background: var(--paper); overflow-y: auto;
  }
  #ege-filter-dialog::backdrop { background: rgb(38 37 31 / .52); }
  .ege-dismiss { margin: 0 0 10px; }
  .ege-related { scroll-margin-top: 112px; }
  .ege-picker input[type=number], .ege-picker select { min-height: 44px; font-size: 1rem; }
  .ege-filters { padding: 12px; }
  .ege-list h2, .ege-card { scroll-margin-top: 112px; }
}
@media (max-width: 480px) {
  .ege-card-data { grid-template-columns: minmax(0, 1fr); }
  .ege-card { padding: 12px; }
  .ege-heading { margin-top: 14px; }
}
