/* This stylesheet deliberately scopes every rule to the resource hall. */
/* Long smooth scrolling can move a focused card between pointer down and up in WebKit. */
html:has(body.auth-dashboard) { scroll-behavior:auto; }
body.auth-dashboard .learning-library { margin:0 0 24px; padding:18px; border:1px solid var(--lab-line); border-radius:16px; background:var(--color-panel); }
body.auth-dashboard .learning-library-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; }
body.auth-dashboard .learning-library h2 { margin:0; font-size:20px; line-height:1.5; }
body.auth-dashboard .learning-library p { margin:8px 0 12px; font-size:12px; line-height:1.7; color:var(--color-muted); }
body.auth-dashboard .learning-library button,body.auth-dashboard [data-learning-favorite] { min-height:44px; padding:8px 14px; border:1px solid var(--lab-line); border-radius:10px; color:var(--color-copy); background:transparent; }
body.auth-dashboard .learning-library [role="tablist"] { display:flex; gap:8px; }
body.auth-dashboard .learning-library [aria-selected="true"],body.auth-dashboard [data-learning-favorite][aria-pressed="true"] { color:var(--color-cyan); border-color:var(--color-cyan); background:#75f4c80c; }
body.auth-dashboard .learning-library ul { list-style:none; margin:12px 0 0; padding:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr)); gap:8px; }
body.auth-dashboard .learning-library li { min-width:0; padding:10px 12px; border:1px solid var(--lab-line); border-radius:10px; }
body.auth-dashboard .learning-library li a { min-height:44px; display:flex; align-items:center; font-size:15px; line-height:1.5; color:var(--color-copy); overflow-wrap:anywhere; }
body.auth-dashboard .learning-library li span,body.auth-dashboard .learning-empty { color:var(--color-muted); font-size:12px; line-height:1.7; }
body.auth-dashboard .learning-status { margin:0; color:var(--color-cyan); font-size:14px; }
body.auth-dashboard .learning-status:not(:empty) { position:fixed; left:50%; bottom:20px; transform:translateX(-50%); z-index:110; width:max-content; max-width:calc(100vw - 32px); padding:12px 16px; background:var(--color-panel); border:1px solid var(--color-cyan); border-radius:12px; pointer-events:none; }
body.auth-dashboard #library .resource-item { display:flex; flex-direction:column; }
body.auth-dashboard #library .resource-item .archive-entry { flex:1; height:auto!important; }
body.auth-dashboard .resource-save-row { position:relative; z-index:2; padding:4px 16px 12px; }
body.auth-dashboard .resource-save-row:has(button[hidden]) { display:none; }
body.auth-dashboard #library .archive-entry.is-locked { opacity:1; filter:none; }
body.auth-dashboard #library .archive-entry.is-locked .entry-copy { opacity:1; filter:none; }
body.auth-dashboard { --bg:var(--color-ink); --text:var(--color-copy); --muted:var(--color-muted); --accent:var(--color-cyan); background:var(--color-ink); color:var(--color-copy); font-family:"Microsoft YaHei","PingFang SC",sans-serif; margin:0; }
body.auth-dashboard *,body.auth-dashboard *::before,body.auth-dashboard *::after { box-sizing:border-box; }
body.auth-dashboard a:focus-visible,body.auth-dashboard button:focus-visible,body.auth-dashboard summary:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
body.auth-dashboard button { font:inherit; color:inherit; cursor:pointer; }
body.auth-dashboard [hidden] { display:none!important; }
body.auth-dashboard .workspace { width:auto; max-width:1440px; margin:0 auto; padding:0 max(20px,env(safe-area-inset-right)) 32px max(20px,env(safe-area-inset-left)); }
body.auth-dashboard .workspace-header { position:relative; inset:auto; height:auto; min-height:80px; margin:0; padding:16px 0; display:flex; flex-wrap:nowrap; align-items:center; justify-content:space-between; gap:16px; background:transparent; border-bottom:1px solid var(--lab-line); backdrop-filter:none; }
body.auth-dashboard .top-brand { flex-shrink:0; }
body.auth-dashboard .top-brand strong { font-family:inherit; font-size:18px; }
body.auth-dashboard .top-brand small { display:block; font:11px/1.5 inherit; letter-spacing:.04em; color:var(--muted); margin-top:4px; }
body.auth-dashboard .resource-top-nav { display:none; }
body.auth-dashboard .resource-account-links { display:flex; align-items:center; gap:8px; }
body.auth-dashboard .resource-account-links a,body.auth-dashboard .resource-account-links button,body.auth-dashboard .resource-toolbar button,body.auth-dashboard .resource-close { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:8px 12px; background:var(--color-panel); border:1px solid var(--lab-line); border-radius:12px; font-size:14px; }
body.auth-dashboard .resource-intro { padding:32px 0 24px; }
body.auth-dashboard .resource-intro .kicker { margin:0 0 12px; font-size:10px; color:var(--accent); letter-spacing:.14em; }
body.auth-dashboard .resource-intro h1 { margin:0; font-size:36px; line-height:1.25; font-weight:650; letter-spacing:-.03em; }
body.auth-dashboard .resource-intro>div>p:not(.kicker) { margin:12px 0 18px; font-size:16px; color:var(--muted); line-height:1.7; }
body.auth-dashboard .resource-summary { display:flex; align-items:center; flex-wrap:wrap; column-gap:14px; row-gap:0; color:var(--muted); font-size:14px; line-height:1.8; }
body.auth-dashboard .resource-summary strong { color:var(--text); font-weight:500; }
body.auth-dashboard .resource-summary a { color:var(--accent); min-height:44px; display:inline-flex; align-items:center; }
body.auth-dashboard .resource-toolbar { display:flex; align-items:center; gap:12px; margin-top:14px; }
body.auth-dashboard .resource-toolbar button { color:var(--accent); border-color:#75f4c840; flex-shrink:0; }
body.auth-dashboard .resource-toolbar>span { font-size:12px; color:var(--muted); }
body.auth-dashboard .resource-finder { position:sticky; top:0; z-index:8; display:grid; gap:10px; padding:14px 0; margin-bottom:18px; background:var(--color-ink); border-bottom:1px solid var(--lab-line); }
body.auth-dashboard .resource-finder-fields { display:grid; grid-template-columns:minmax(200px,2fr) repeat(3,minmax(130px,1fr)); gap:10px; }
body.auth-dashboard .resource-finder label { display:grid; gap:4px; color:var(--muted); font-size:12px; }
body.auth-dashboard .resource-finder input,body.auth-dashboard .resource-finder select { width:100%; min-width:0; min-height:44px; padding:9px 12px; border:1px solid var(--lab-line); border-radius:10px; background:var(--color-panel); color:var(--text); font:inherit; font-size:15px; }
body.auth-dashboard .resource-finder input:focus-visible,body.auth-dashboard .resource-finder select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
body.auth-dashboard .resource-finder-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--muted); font-size:13px; }
body.auth-dashboard .resource-finder-summary button { min-height:44px; padding:6px 12px; border:1px solid var(--lab-line); border-radius:10px; background:transparent; color:var(--accent); }
body.auth-dashboard .round1-card .round2-visual picture { display:block; width:100%; height:100%; min-width:0; }
body.auth-dashboard [data-resource-no-results] { margin:8px 0; padding:14px; border:1px solid var(--lab-line); border-radius:10px; color:var(--text); }
body.auth-dashboard [data-filter-section],body.auth-dashboard [data-filter-group] { scroll-margin-top:155px; }
@media(max-width:860px) { body.auth-dashboard .resource-finder-fields { grid-template-columns:repeat(3,minmax(0,1fr)); } body.auth-dashboard .resource-query-label { grid-column:1/-1; } }
@media(max-width:540px) { body.auth-dashboard .resource-finder { position:relative; gap:6px; padding:8px 0; margin-bottom:12px; } body.auth-dashboard .resource-finder-fields { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; } body.auth-dashboard .resource-finder-fields label:last-child { grid-column:1/-1; } }
body.auth-dashboard .library { padding:20px 0 0; margin:0; border-top:1px solid var(--lab-line); }
body.auth-dashboard .section-heading { display:flex; align-items:center; flex-wrap:wrap; gap:10px; justify-content:space-between; margin:0 0 20px; }
body.auth-dashboard .section-heading .kicker { display:none; }
body.auth-dashboard .section-heading h2 { margin:0; font-family:inherit; font-size:22px; font-weight:600; }
body.auth-dashboard .section-heading>p { margin:0; font-size:12px; gap:6px; }
body.auth-dashboard .section-heading>p strong { font-size:18px; }
body.auth-dashboard .catalog-group { scroll-margin-top:24px; margin:0 0 32px; }
body.auth-dashboard .catalog-group-heading { margin:0 0 12px; }
body.auth-dashboard .catalog-group-heading h3 { font-size:16px; font-family:inherit; }
body.auth-dashboard .catalog-group-heading small { font-size:11px; }
body.auth-dashboard .archive-list { display:grid; grid-template-columns:1fr; gap:12px; }
body.auth-dashboard .resource-item { position:relative; min-width:0; border:1px solid var(--lab-line); background:var(--color-panel); border-radius:16px; overflow:clip; }
body.auth-dashboard .resource-item .archive-entry { position:relative; display:grid; grid-template-columns:104px minmax(0,1fr); gap:16px; width:100%; min-height:132px; height:auto; padding:16px; border:0; border-radius:0; background:transparent; box-shadow:none; isolation:auto; overflow:visible; }
body.auth-dashboard .resource-item .archive-entry::before,body.auth-dashboard .resource-item .archive-entry::after { display:none; }
body.auth-dashboard .resource-item .archive-entry:hover { transform:none; background:#75f4c806; }
body.auth-dashboard .resource-item .entry-visual { position:relative; inset:auto; z-index:0; width:104px; height:88px; opacity:1; filter:none; grid-row:1/3; overflow:hidden; border-radius:10px; background:#080f18; }
body.auth-dashboard .resource-item .entry-visual img { width:100%; height:100%; object-fit:cover; opacity:1; filter:none; transform:none; }
body.auth-dashboard .resource-item .entry-visual .boundary-field-card-art,
body.auth-dashboard .resource-item .entry-visual .dynamic-equilibrium-card-art,
body.auth-dashboard .resource-item .entry-visual .simple-pendulum-card-art,
body.auth-dashboard .resource-item .entry-visual .circular-motion-card-art,
body.auth-dashboard .resource-item .entry-visual .car-power-card-art { position:absolute; inset:0; width:100%; height:100%; }
body.auth-dashboard .resource-item .entry-index,body.auth-dashboard .resource-item .entry-en { display:none; }
body.auth-dashboard .resource-item .entry-copy { position:static; inset:auto; padding:0; width:auto; min-width:0; opacity:1; filter:none; align-self:start; }
body.auth-dashboard .resource-item .entry-copy h3 { margin:0; font-family:inherit; font-size:18px; line-height:1.5; color:var(--text); overflow-wrap:anywhere; }
body.auth-dashboard .resource-card-teaser { display:none; }
body.auth-dashboard .resource-item .entry-tags { display:flex; flex-wrap:wrap; margin:8px 0 0; gap:5px; }
body.auth-dashboard .resource-item .entry-tags span { font-size:11px; padding:2px 6px; color:var(--muted); line-height:1.6; }
body.auth-dashboard .resource-item .entry-open { position:static; inset:auto; display:flex; align-items:center; justify-content:flex-start; gap:8px; padding:0; width:auto; grid-column:2; opacity:1; filter:none; color:var(--accent); }
body.auth-dashboard .resource-item .entry-open span { font-size:14px; }
body.auth-dashboard .resource-item .entry-open small { display:none; }
body.auth-dashboard .resource-item .quality-badge { width:44px; height:auto; top:6px; left:6px; right:auto; }
body.auth-dashboard .resource-description,body.auth-dashboard .resource-short-description { position:relative; margin:0; padding:0 16px 12px; color:var(--muted); font-size:14px; line-height:1.8; }
body.auth-dashboard .resource-description summary { min-height:44px; width:fit-content; display:list-item; align-content:center; cursor:pointer; color:var(--accent); }
body.auth-dashboard .resource-description p { margin:0 0 4px; }
body.auth-dashboard .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
body.auth-dashboard .history-entry-card { margin:32px 0; padding:24px; border:1px solid var(--lab-line); border-radius:16px; background:var(--color-panel); box-shadow:none; gap:16px; }
body.auth-dashboard .history-entry-card h2 { font:600 22px/1.5 "Microsoft YaHei",sans-serif; margin:8px 0; color:var(--text); }
body.auth-dashboard .history-entry-card small { color:var(--accent); }
body.auth-dashboard .history-entry-card strong { background:transparent; color:var(--accent); border-color:var(--lab-line); border-radius:12px; font-size:14px; }
body.auth-dashboard .history-entry-card:hover { transform:translateY(-2px); }
body.auth-dashboard .control-rail { position:fixed; inset:0 auto 0 0; display:flex; flex-direction:column; width:min(320px,calc(100% - 32px)); height:100dvh; padding:20px; overflow-y:auto; background:var(--color-panel); border:0; border-right:1px solid var(--lab-line); transform:translateX(-105%); transition:transform 200ms; z-index:100; visibility:hidden; opacity:1; pointer-events:none; }
body.auth-dashboard .control-rail.is-open { transform:none; visibility:visible; pointer-events:auto; }
body.auth-dashboard .rail-content { display:flex; flex-direction:column; flex:1; opacity:1; visibility:visible; transform:none; padding:0; min-height:0; }
body.auth-dashboard .resource-close { align-self:flex-end; margin-bottom:16px; }
body.auth-dashboard .rail-brand { margin-bottom:24px; }
body.auth-dashboard .rail-label { margin:12px 0; }
body.auth-dashboard .rail-link,body.auth-dashboard .rail-subnav a { min-height:44px; font-size:14px; padding:12px 10px; }
body.auth-dashboard .rail-subnav a[aria-current] { color:var(--accent); background:#75f4c80a; border-radius:8px; }
body.auth-dashboard .resource-backdrop { position:fixed; inset:0; width:100%; height:100%; border:0; background:#030a13b3; z-index:99; }
body.auth-dashboard.resource-menu-open { overflow:hidden; }
body.auth-dashboard #round1,body.auth-dashboard #round2,body.auth-dashboard #games { scroll-margin-top:24px; }
@media(min-width:1200px) {
  body.auth-dashboard .workspace { margin-left:224px; padding-inline:40px; }
  body.auth-dashboard .control-rail { width:224px; transform:none; visibility:visible; pointer-events:auto; padding:28px 16px; }
  body.auth-dashboard .resource-close,body.auth-dashboard [data-resource-menu] { display:none; }
  body.auth-dashboard .resource-top-nav { display:flex; flex-wrap:wrap; gap:16px; font-size:13px; }
  body.auth-dashboard .resource-top-nav a { min-height:44px; display:inline-flex; align-items:center; }
  body.auth-dashboard .resource-top-nav a[aria-current] { color:var(--accent); }
  body.auth-dashboard .resource-intro { padding:36px 0 24px; }.auth-dashboard .resource-intro h1{font-size:40px}
  body.auth-dashboard .resource-item .archive-entry { grid-template-columns:144px minmax(0,1fr) 120px; min-height:132px; padding:20px; gap:20px; }
  body.auth-dashboard .resource-item .entry-visual { width:144px; height:90px; grid-row:1; }
  body.auth-dashboard .resource-item .entry-open { grid-column:3; }
  body.auth-dashboard .resource-description,body.auth-dashboard .resource-short-description { padding-left:184px; padding-right:20px; }
}
@media(max-width:767px) {
  body.auth-dashboard .workspace { padding-inline:max(16px,env(safe-area-inset-left)); }
  body.auth-dashboard .workspace-header { min-height:76px; gap:10px; padding:14px 0; }.auth-dashboard .top-brand strong{font-size:16px}
  body.auth-dashboard .resource-intro { padding:24px 0 20px; }
  body.auth-dashboard .resource-intro h1 { font-size:32px; }
  body.auth-dashboard .resource-account-links { gap:6px; }.auth-dashboard .resource-account-links a{font-size:12px;max-width:86px;text-align:center}
  body.auth-dashboard .resource-intro .kicker { font-size:10px; }
  body.auth-dashboard .resource-item .archive-entry { grid-template-columns:82px minmax(0,1fr); gap:10px 12px; padding:14px; }
  body.auth-dashboard .resource-item .entry-visual { width:82px; height:82px; }
  body.auth-dashboard .archive-entry[data-demo-slug="boat-river-crossing"] .entry-visual img { object-position:85% center; }
  body.auth-dashboard .resource-item .entry-copy h3 { font-size:16px; }
  body.auth-dashboard .resource-item .entry-tags { margin-top:5px; gap:4px; }
  body.auth-dashboard .resource-item .entry-open span { font-size:13px; }
  body.auth-dashboard .resource-item .quality-badge { width:36px; }
  body.auth-dashboard .history-entry-card { grid-template-columns:1fr; padding:20px; }.auth-dashboard .history-entry-card strong{justify-self:start;padding:0 14px}
  body.auth-dashboard .section-heading>p { display:none; }
  body.auth-dashboard .catalog-group-heading { gap:8px; }
}
@media(prefers-reduced-motion:reduce) { body.auth-dashboard .control-rail,body.auth-dashboard .archive-entry,body.auth-dashboard .history-entry-card { transition:none; } }

body.auth-dashboard .top-brand { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; }
body.auth-dashboard .top-brand small { font-family:inherit; font-size:10px; line-height:1.5; }
body.auth-dashboard .library::before,body.auth-dashboard .library::after,body.auth-dashboard .section-heading::before,body.auth-dashboard .section-heading::after,body.auth-dashboard .archive-group-heading::after { display:none; }
body.auth-dashboard .section-heading { padding:0; min-height:0; background:none; border:0; justify-content:space-between; text-align:left; }
body.auth-dashboard .archive-sections { gap:28px; }
body.auth-dashboard .archive-group { scroll-margin-top:24px; }
body.auth-dashboard .archive-group-heading { display:flex; flex-direction:row; align-items:center; justify-content:space-between; padding:0; min-height:0; margin:0 0 12px; border:0; background:none; }
body.auth-dashboard .archive-group-heading h3 { margin:0; font:600 16px/1.5 "Microsoft YaHei",sans-serif; }
body.auth-dashboard .archive-group-heading small { font-size:10px; color:var(--muted); }
body.auth-dashboard .resource-item .entry-open { border:0; min-height:24px; }
body.auth-dashboard .resource-item .entry-open span::after { display:none; }
body.auth-dashboard .resource-item .entry-copy h3 { max-width:none; }
body.auth-dashboard .resource-item .archive-entry { grid-template-rows:auto auto; }
body.auth-dashboard .resource-item .is-locked .entry-open span { color:var(--muted); }
@media(min-width:1200px){body.auth-dashboard .resource-item .archive-entry{grid-template-rows:auto;}}

/* A stretched link keeps the entire row clickable; disclosure remains independent. */
body.auth-dashboard .resource-item .archive-entry {
  position: static;
  background: linear-gradient(135deg, rgba(17, 29, 41, .98), rgba(11, 24, 34, .98));
}
body.auth-dashboard .resource-item .archive-entry::after { content:""; display:block; position:absolute; inset:0; z-index:1; background:none; opacity:1; transform:none; pointer-events:auto; }
body.auth-dashboard .resource-description { z-index:2; }
body.auth-dashboard .resource-item:focus-within { outline:2px solid var(--accent); outline-offset:2px; }

body.auth-dashboard .control-rail { border-radius:0; overflow-x:hidden; box-shadow:none; }
body.auth-dashboard .rail-content { pointer-events:auto; height:auto; overflow:visible; flex:none; }
body.auth-dashboard .rail-brand,body.auth-dashboard .rail-label,body.auth-dashboard .rail-guide,body.auth-dashboard .system-state { display:block; }
body.auth-dashboard .rail-guide { display:flex; margin-top:20px; }
body.auth-dashboard .rail-nav { display:flex; flex-direction:column; gap:4px; overflow:visible; padding:0; }
body.auth-dashboard .rail-group { width:100%; min-width:0; }
body.auth-dashboard .rail-group>.rail-link { width:100%; min-width:0; }
body.auth-dashboard .rail-subnav { display:grid; }
body.auth-dashboard .section-heading { flex-direction:row; align-items:center; }
body.auth-dashboard .resource-item { min-height:0; }

body.auth-dashboard #library .archive-list { grid-auto-rows:auto; align-items:start; }
@media(min-width:1200px) {
  body.auth-dashboard .resource-account-links [data-resource-menu],body.auth-dashboard .resource-toolbar [data-resource-menu] { display:none; }
}

body.auth-dashboard .top-brand,body.auth-dashboard .workspace-footer .icp-link { min-height:44px; }

body.auth-dashboard .resource-item .archive-entry { will-change:auto; }
body.auth-dashboard .control-rail { padding-top:max(20px,env(safe-area-inset-top)); padding-bottom:max(20px,env(safe-area-inset-bottom)); }
body.auth-dashboard .workspace { padding-bottom:max(32px,env(safe-area-inset-bottom)); }
body.auth-dashboard .workspace-header { padding-top:max(16px,env(safe-area-inset-top)); }

/* The archive becomes an image-led card grid once there is room for it. */
@media(min-width:768px) {
  body.auth-dashboard #library .archive-list {
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-auto-rows:280px;
    align-items:stretch;
    gap:14px;
  }
  body.auth-dashboard #library .resource-item {
    min-height:280px;
    height:280px;
    isolation:isolate;
    overflow:hidden;
    border-radius:10px;
    background:#0b1722;
    box-shadow:inset 0 0 0 1px rgba(117,244,200,.02);
    transform:translateY(0);
    transition:border-color 220ms ease,box-shadow 280ms ease,transform 280ms cubic-bezier(.16,1,.3,1);
  }
  body.auth-dashboard #library .resource-item .archive-entry {
    position:relative;
    z-index:2;
    display:grid;
    grid-template-columns:1fr;
    grid-template-rows:auto minmax(0,1fr) auto;
    align-content:stretch;
    gap:12px;
    width:100%;
    height:100%;
    min-height:0;
    padding:18px;
    color:var(--text);
    background:
      linear-gradient(180deg,rgba(8,15,24,.18),rgba(8,15,24,.3) 34%,rgba(8,15,24,.93)),
      linear-gradient(90deg,rgba(8,15,24,.82),rgba(8,15,24,.18) 72%);
    overflow:hidden;
  }
  body.auth-dashboard #library .resource-item .archive-entry::after { display:none; }
  body.auth-dashboard #library .resource-item .catalog-entry::before { display:block; }
  body.auth-dashboard #library .resource-item .entry-visual {
    position:absolute;
    inset:0;
    z-index:-1;
    width:100%;
    height:100%;
    grid-row:auto;
    border-radius:0;
    background:#080f18;
  }
  body.auth-dashboard #library .resource-item .entry-visual img {
    width:100%;
    height:100%;
    object-fit:cover;
    opacity:.72;
    filter:saturate(1.06) contrast(1.12) brightness(.88);
    transform:scale(1.005);
    transition:transform 300ms cubic-bezier(.16,1,.3,1),filter 280ms ease,opacity 280ms ease;
  }
  body.auth-dashboard #library .resource-item .entry-visual .boundary-field-card-art,
  body.auth-dashboard #library .resource-item .entry-visual .dynamic-equilibrium-card-art,
  body.auth-dashboard #library .resource-item .entry-visual .simple-pendulum-card-art {
    transform:scale(1.005);
    transition:transform 300ms cubic-bezier(.16,1,.3,1);
  }
  body.auth-dashboard #library .resource-item .entry-index {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    color:var(--muted);
    font-size:10px;
    letter-spacing:.12em;
  }
  body.auth-dashboard #library .resource-item .entry-index small { color:var(--accent); font-size:10px; }
  body.auth-dashboard #library .resource-item .entry-copy {
    position:relative;
    align-self:end;
    padding-top:24px;
    text-shadow:0 2px 18px rgba(0,0,0,.72);
  }
  body.auth-dashboard #library .resource-item .entry-copy h3 {
    max-width:calc(100% - 34px);
    font-size:clamp(19px,2vw,25px);
    line-height:1.3;
    display:-webkit-box;
    overflow:hidden;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
  }
  body.auth-dashboard #library .resource-item .entry-en { display:block; margin-top:6px; color:var(--muted); font-size:9px; letter-spacing:.12em; }
  body.auth-dashboard #library .resource-item .entry-tags { margin-top:8px; max-height:24px; overflow:hidden; }
  body.auth-dashboard #library .resource-item .entry-tags span { color:rgba(237,244,242,.76); background:rgba(8,15,24,.5); border-color:rgba(237,244,242,.12); }
  body.auth-dashboard #library .resource-card-teaser {
    display:-webkit-box;
    margin:10px 0 0;
    overflow:hidden;
    color:rgba(237,244,242,.74);
    font-size:12px;
    line-height:1.65;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
  }
  body.auth-dashboard #library .resource-item .entry-open {
    position:relative;
    z-index:2;
    display:flex;
    grid-column:1;
    align-items:center;
    min-height:32px;
    padding:10px 0 0;
    border-top:1px solid rgba(237,244,242,.13);
    color:var(--accent);
  }
  body.auth-dashboard #library .resource-item .entry-open span::after {
    content:"→";
    display:inline-block;
    position:static;
    width:auto;
    height:auto;
    margin-left:8px;
    background:none;
    transform:translateX(0);
    transition:transform 220ms ease;
  }
  body.auth-dashboard #library .resource-short-description { display:none; }
  body.auth-dashboard #library .resource-description {
    position:absolute;
    right:12px;
    bottom:8px;
    z-index:5;
    width:auto;
    margin:0;
    padding:0;
    color:var(--muted);
  }
  body.auth-dashboard #library .resource-description summary {
    min-height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 10px;
    border-radius:8px;
    color:rgba(237,244,242,.76);
    background:rgba(8,15,24,.76);
    backdrop-filter:blur(8px);
    font-size:11px;
    list-style:none;
  }
  body.auth-dashboard #library .resource-description summary::-webkit-details-marker { display:none; }
  body.auth-dashboard #library .resource-description[open] {
    left:12px;
    right:12px;
    bottom:12px;
    max-height:calc(100% - 24px);
    padding:12px;
    overflow:auto;
    border:1px solid rgba(117,244,200,.3);
    border-radius:10px;
    background:rgba(8,15,24,.96);
    box-shadow:0 18px 44px rgba(0,0,0,.38);
  }
  body.auth-dashboard #library .resource-description[open] summary { width:max-content; min-height:36px; margin-left:auto; color:var(--accent); background:rgba(117,244,200,.08); }
  body.auth-dashboard #library .resource-description[open] p { margin:8px 0 0; color:var(--text); font-size:13px; line-height:1.75; }
  body.auth-dashboard #library .resource-item .quality-badge { top:12px; right:12px; left:auto; width:64px; }
}

@media(min-width:1200px) {
  body.auth-dashboard #library .archive-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media(min-width:768px) {
  body.auth-dashboard #library .archive-list { grid-auto-rows:auto; align-items:stretch; }
  body.auth-dashboard #library .resource-item { height:auto; min-height:300px; }
  body.auth-dashboard #library .resource-item .archive-entry { min-height:300px; height:100%; }
  body.auth-dashboard #library .resource-item .entry-copy h3 { display:block; max-width:none; overflow:visible; }
  body.auth-dashboard #library .resource-item .entry-tags { max-height:none; overflow:visible; flex-wrap:wrap; }
  body.auth-dashboard .public-preview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(min-width:1200px) { body.auth-dashboard .public-preview-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }

@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  body.auth-dashboard #library .resource-item:hover,
  body.auth-dashboard #library .resource-item:focus-within {
    border-color:rgba(117,244,200,.62);
    box-shadow:0 16px 38px rgba(0,0,0,.3),0 0 28px rgba(117,244,200,.09);
    transform:translateY(-3px);
  }
  body.auth-dashboard #library .resource-item:hover .entry-visual img,
  body.auth-dashboard #library .resource-item:focus-within .entry-visual img,
  body.auth-dashboard #library .resource-item:hover .boundary-field-card-art,
  body.auth-dashboard #library .resource-item:focus-within .boundary-field-card-art,
  body.auth-dashboard #library .resource-item:hover .dynamic-equilibrium-card-art,
  body.auth-dashboard #library .resource-item:focus-within .dynamic-equilibrium-card-art,
  body.auth-dashboard #library .resource-item:hover .simple-pendulum-card-art,
  body.auth-dashboard #library .resource-item:focus-within .simple-pendulum-card-art { transform:scale(1.025); }
  body.auth-dashboard #library .resource-item:hover .entry-open span::after,
  body.auth-dashboard #library .resource-item:focus-within .entry-open span::after { transform:translateX(2px); }
}

@media(prefers-reduced-motion:reduce) {
  body.auth-dashboard #library .resource-item,
  body.auth-dashboard #library .resource-item .entry-visual img,
  body.auth-dashboard #library .resource-item .boundary-field-card-art,
  body.auth-dashboard #library .resource-item .dynamic-equilibrium-card-art,
  body.auth-dashboard #library .resource-item .simple-pendulum-card-art,
  body.auth-dashboard #library .resource-item .entry-open span::after { transition:none; transform:none; }
}

/* A compact desktop entry keeps complete archive cards reachable on a classroom screen. */
.resource-finder-compact{display:none}
body.auth-dashboard #resourceFilters{display:grid;gap:10px}
body.auth-dashboard #resourceFilters[hidden]{display:none}
@media(max-width:540px){
  body.auth-dashboard .resource-intro .resource-toolbar{display:none}
  body.auth-dashboard .resource-finder{position:sticky;top:0;z-index:9}
  body.auth-dashboard .resource-finder-compact{display:flex;gap:8px}
  body.auth-dashboard .resource-finder-compact button{min-height:44px;padding:8px 12px;border:1px solid var(--lab-line);border-radius:10px;color:var(--accent);background:var(--color-panel);font:inherit;font-size:14px}
  body.auth-dashboard .resource-finder-compact [data-resource-toggle]{flex:1}
  body.auth-dashboard #resourceFilters{max-height:55dvh;overflow:auto;padding:2px}
  body.auth-dashboard .archive-group,body.auth-dashboard #round1,body.auth-dashboard #round2,body.auth-dashboard #games{scroll-margin-top:76px}
}
@media(min-width:1200px) and (hover:hover) and (pointer:fine) {
  body.auth-dashboard .workspace-header { min-height:68px; padding-block:10px; }
  body.auth-dashboard .resource-intro { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px 24px; padding:12px 0; }
  body.auth-dashboard .resource-intro>div:first-child { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:baseline; column-gap:14px; }
  body.auth-dashboard .resource-intro .kicker { margin-bottom:6px; }
  body.auth-dashboard .resource-intro>div:first-child .kicker { grid-column:1/-1; }
  body.auth-dashboard .resource-intro h1 { font-size:32px; }
  body.auth-dashboard .resource-intro>div>p:not(.kicker) { margin:0; font-size:14px; }
  body.auth-dashboard .resource-summary { justify-content:flex-end; font-size:13px; gap:10px; }
  body.auth-dashboard .resource-toolbar { grid-column:1/-1; margin-top:0; }
  body.auth-dashboard .resource-finder { gap:6px; padding:10px 0; margin-bottom:8px; }
  body.auth-dashboard .library { padding-top:14px; }
  body.auth-dashboard .section-heading { margin-bottom:10px; }
  body.auth-dashboard .learning-library { position:relative; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:3px 12px; padding:8px 12px; margin-bottom:12px; }
  body.auth-dashboard .learning-library-heading { display:contents; }
  body.auth-dashboard .learning-library h2 { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  body.auth-dashboard .learning-library [data-learning-clear] { grid-column:3; grid-row:1; }
  body.auth-dashboard .learning-library [role="tablist"] { grid-column:1; grid-row:1; }
  body.auth-dashboard .learning-library p { grid-column:1/-1; grid-row:2; margin:0; }
  body.auth-dashboard .learning-library ul { grid-column:2; grid-row:1; display:flex; min-width:0; gap:8px; overflow:auto; margin:0; }
  body.auth-dashboard .learning-library li { flex:0 0 auto; padding:0 10px; }
  body.auth-dashboard .learning-library li a { min-height:44px; font-size:13px; }
  body.auth-dashboard .learning-library li span { display:none; }
  body.auth-dashboard .public-preview-section { margin-block:16px; }
  body.auth-dashboard #library .resource-view-badge { color:var(--color-cyan); border-color:#75f4c840; }
}
