/* Bean UI 1.0 — Fluent 2 clarity + Material 3 Expressive navigation and motion */
:root {
  color-scheme: light;
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #ecefe9;
  --surface-3: #e3e8e1;
  --nav-bg: #f8f9f6;
  --text: #1b211d;
  --muted: #667068;
  --line: #dce2dc;
  --line-strong: #c8d0c8;
  --accent: #276a52;
  --accent-hover: #1e5742;
  --on-accent: #ffffff;
  --accent-soft: #e1ede6;
  --danger: #a94646;
  --danger-soft: #f8e9e7;
  --success: #2f7355;
  --success-soft: #e2efe7;
  --warning: #88682f;
  --warning-soft: #f2ecdc;
  --info: #506f8d;
  --info-soft: #e5edf4;
  --blue: #506f8d;
  --blue-soft: #e5edf4;
  --shadow-2: 0 1px 2px rgba(20, 33, 25, .08), 0 2px 8px rgba(20, 33, 25, .05);
  --shadow-8: 0 2px 4px rgba(20, 33, 25, .10), 0 8px 24px rgba(20, 33, 25, .10);
  --shadow-64: 0 8px 16px rgba(20, 33, 25, .14), 0 32px 64px rgba(20, 33, 25, .18);
  --ease-standard: cubic-bezier(.2, 0, 0, 1);
  --ease-expressive: cubic-bezier(.39, 1.29, .35, .98);
  --radius-control: 14px;
  --radius-card: 20px;
  --radius-panel: 26px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111512;
  --surface: #181e1a;
  --surface-2: #222a24;
  --surface-3: #2a332c;
  --nav-bg: #141915;
  --text: #eef3ee;
  --muted: #a4afa7;
  --line: #303a32;
  --line-strong: #414d43;
  --accent: #8bc7a8;
  --accent-hover: #a2d8bb;
  --on-accent: #10241a;
  --accent-soft: #23382c;
  --danger: #e2a3a0;
  --danger-soft: #3d2424;
  --success: #8bc7a8;
  --success-soft: #23382c;
  --warning: #d7bb7f;
  --warning-soft: #3a3220;
  --info: #9bbbd8;
  --info-soft: #233444;
  --blue: #9bbbd8;
  --blue-soft: #233444;
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .24), 0 2px 8px rgba(0, 0, 0, .18);
  --shadow-8: 0 2px 4px rgba(0, 0, 0, .28), 0 8px 24px rgba(0, 0, 0, .24);
  --shadow-64: 0 8px 16px rgba(0, 0, 0, .36), 0 32px 64px rgba(0, 0, 0, .40);
}
/* Low-saturation module color: one dominant hue per route, never a multi-color wash. */
body[data-page="navigation"] { --accent: #506f8d; --accent-hover: #405d78; --accent-soft: #e5edf4; }
body[data-page="search"] { --accent: #397876; --accent-hover: #2d6361; --accent-soft: #e0efed; }
body[data-page="games"] { --accent: #88682f; --accent-hover: #6f5425; --accent-soft: #f2ecdc; }
body[data-page="apps"] { --accent: #93604d; --accent-hover: #794d3d; --accent-soft: #f3e8e2; }
body[data-page="fate"] { --accent: #875f6b; --accent-hover: #704c57; --accent-soft: #f2e7eb; }
:root[data-theme="dark"] body[data-page="navigation"] { --accent: #9bbbd8; --accent-hover: #b3cde3; --accent-soft: #233444; }
:root[data-theme="dark"] body[data-page="search"] { --accent: #91cbc5; --accent-hover: #abe0da; --accent-soft: #203a37; }
:root[data-theme="dark"] body[data-page="games"] { --accent: #d7bb7f; --accent-hover: #e7d09d; --accent-soft: #3a3220; }
:root[data-theme="dark"] body[data-page="apps"] { --accent: #d9a58e; --accent-hover: #ecc0ac; --accent-soft: #3d2b24; }
:root[data-theme="dark"] body[data-page="fate"] { --accent: #d3a7b5; --accent-hover: #e6bfca; --accent-soft: #3b2930; }
* { box-sizing: border-box; }
html { min-width: 0; scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.65 "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.28; letter-spacing: -.015em; }
h1 { margin-bottom: 10px; font-size: 32px; font-weight: 650; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 600; }
svg.lucide { width: 20px; height: 20px; flex: none; stroke-width: 1.8; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.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; }
.skip-link { position: fixed; z-index: 200; top: 8px; left: 8px; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); transform: translateY(-160%); }
.skip-link:focus { transform: none; }

/* Fluent application frame */
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 236px; display: flex; flex-direction: column; padding: 24px 14px 16px; background: var(--nav-bg); border-right: 1px solid var(--line); }
.brand { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px; width: fit-content; color: var(--text); font-size: 17px; font-weight: 700; letter-spacing: .09em; line-height: 1.2; }
.brand > span { color: var(--accent); }
.brand small { flex-basis: 100%; margin-top: 8px; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: .04em; }
.sidebar > .brand { margin: 0 12px 24px; }
.command-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin-bottom: 18px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); text-align: left; box-shadow: var(--shadow-2); transition: border-color 160ms var(--ease-standard), box-shadow 160ms var(--ease-standard); }
.command-button:hover { border-color: var(--line-strong); box-shadow: var(--shadow-8); }
.command-button span { flex: 1; font-size: 13px; }
kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--muted); font: 500 11px/1.5 inherit; white-space: nowrap; }
.side-nav { display: grid; gap: 4px; }
.side-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 500; text-align: left; transition: color 160ms var(--ease-standard), background-color 160ms var(--ease-standard); }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.side-link--minor { font-size: 13px; }
.sidebar-foot { display: grid; gap: 4px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.main { margin-left: 236px; padding: 40px 44px 64px; }
.main > * { width: min(100%, 1200px); margin-inline: auto; }
.mobile-header, .bottom-nav { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.page-head > div:first-child { max-width: 780px; }
.page-head h1 { margin-bottom: 8px; }
.kicker { margin-bottom: 8px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.page-description { margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-note, .result-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.text-button, .text-link { padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 600; }
.text-button:hover, .text-link:hover { text-decoration: underline; }
.fine-print { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.subheading { margin: 28px 0 14px; }

/* Material-shaped controls, Fluent elevation */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: background-color 160ms var(--ease-standard), border-color 160ms var(--ease-standard), box-shadow 160ms var(--ease-standard), transform 240ms var(--ease-expressive); }
.button:hover { border-color: var(--line-strong); background: var(--surface-2); box-shadow: var(--shadow-2); }
.button:active { transform: scale(.97); }
.button--primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.button--primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.button svg { width: 17px; height: 17px; }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); transition: background-color 160ms var(--ease-standard), color 160ms var(--ease-standard); }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
input, select { min-height: 42px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
input { padding: 0 12px; }
select { padding: 0 34px 0 12px; }
input::placeholder { color: var(--muted); opacity: .85; }
input:focus, select:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 20%, transparent); outline-offset: 0; }
.input-with-icon { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); transition: border-color 160ms var(--ease-standard), box-shadow 160ms var(--ease-standard); }
.input-with-icon:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.input-with-icon input { flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--text); }
.input-with-icon input:focus { outline: 0; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.select-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.chip-row { display: flex; gap: 8px; margin-bottom: 24px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500; transition: background-color 160ms var(--ease-standard), color 160ms var(--ease-standard); }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip[aria-pressed="true"] { border-color: transparent; background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.status-label { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; }

/* Home */
.home-search { position: relative; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow-2); }
.home-search > label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 650; }
.home-search-box { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); transition: border-color 160ms var(--ease-standard), box-shadow 160ms var(--ease-standard); }
.home-search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.home-search-box input { flex: 1; min-width: 0; height: 52px; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 17px; }
.home-search-box input:focus { outline: 0; }
.home-search-results { position: absolute; z-index: 15; top: calc(100% - 12px); left: 24px; right: 24px; max-height: 420px; padding: 8px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-64); }
.search-suggestion { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-radius: 12px; }
.search-suggestion:hover { background: var(--surface-2); }
.search-suggestion > span { min-width: 0; }
.search-suggestion b, .search-suggestion small { display: block; }
.search-suggestion small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-suggestion > svg:last-child { margin-left: auto; width: 16px; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.service-card { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 102px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); transition: border-color 160ms var(--ease-standard), box-shadow 160ms var(--ease-standard), transform 240ms var(--ease-expressive); }
.service-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-8); transform: translateY(-2px); }
.service-card[data-tone="blue"] { --item-accent: #506f8d; --item-soft: #e5edf4; }
.service-card[data-tone="teal"] { --item-accent: #397876; --item-soft: #e0efed; }
.service-card[data-tone="ochre"] { --item-accent: #88682f; --item-soft: #f2ecdc; }
.service-card[data-tone="clay"] { --item-accent: #93604d; --item-soft: #f3e8e2; }
.service-card[data-tone="rose"] { --item-accent: #875f6b; --item-soft: #f2e7eb; }
:root[data-theme="dark"] .service-card[data-tone="blue"] { --item-accent: #9bbbd8; --item-soft: #233444; }
:root[data-theme="dark"] .service-card[data-tone="teal"] { --item-accent: #91cbc5; --item-soft: #203a37; }
:root[data-theme="dark"] .service-card[data-tone="ochre"] { --item-accent: #d7bb7f; --item-soft: #3a3220; }
:root[data-theme="dark"] .service-card[data-tone="clay"] { --item-accent: #d9a58e; --item-soft: #3d2b24; }
:root[data-theme="dark"] .service-card[data-tone="rose"] { --item-accent: #d3a7b5; --item-soft: #3b2930; }
.service-card__icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 14px; background: var(--item-soft, var(--accent-soft)); color: var(--item-accent, var(--accent)); }
.service-card__copy { display: block; flex: 1; min-width: 0; padding-right: 24px; }
.service-card__copy::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.service-card__copy b { display: block; margin-bottom: 4px; font-size: 15px; }
.service-card__copy small { display: -webkit-box; color: var(--muted); font-size: 13px; line-height: 1.5; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.favorite-button { position: absolute; z-index: 2; right: 10px; bottom: 10px; width: 32px; height: 32px; opacity: 0; transition: opacity 160ms var(--ease-standard), background-color 160ms var(--ease-standard), color 160ms var(--ease-standard), transform 240ms var(--ease-expressive); }
.service-card:hover .favorite-button, .service-card:focus-within .favorite-button, .favorite-button[aria-pressed="true"], .campus-managing .favorite-button, .home-managing .favorite-button { opacity: 1; }
.favorite-button:active { transform: scale(.86); }
.favorite-button svg { width: 17px; height: 17px; }
.favorite-button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.favorite-button[aria-pressed="true"] svg { fill: currentColor; }
.app-teaser-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.app-teaser { display: flex; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.app-teaser:hover { box-shadow: var(--shadow-2); }
.app-teaser img { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; }
.app-teaser span { flex: 1; }
.app-teaser b, .app-teaser small { display: block; }
.app-teaser small { margin-top: 4px; color: var(--muted); }
.app-teaser > svg { color: var(--muted); }

/* Campus launcher and local management */
.campus-group { margin-top: 28px; }
.campus-group__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.campus-group__head h2 { margin: 0; font-size: 17px; }
.campus-group__head > span { color: var(--muted); font-size: 12px; }
.campus-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.service-card--campus { min-height: 112px; padding: 16px; }
.service-card--campus .service-card__copy { padding-right: 18px; }
.service-card--campus .service-card__copy small { font-size: 12px; }
.custom-badge { display: inline-flex; width: fit-content; margin-top: 7px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10px; }
.campus-delete { position: absolute; z-index: 3; top: 8px; right: 8px; width: 32px; height: 32px; color: var(--danger); opacity: 0; pointer-events: none; transition: opacity 160ms var(--ease-standard), background-color 160ms var(--ease-standard); }
.campus-delete:hover { background: var(--danger-soft); }
.campus-delete svg { width: 16px; height: 16px; }
.campus-managing .campus-delete, .home-managing .campus-delete { opacity: 1; pointer-events: auto; }
.management-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0 20px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.main > .management-note { margin: 16px auto 20px; }
.management-note > span { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; line-height: 1.6; }
.management-note > span > svg { flex: none; }
.management-note svg { width: 16px; height: 16px; }
.management-actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.management-actions .button { min-height: 34px; padding: 7px 12px; }
.management-actions .text-button { white-space: nowrap; }
.campus-dialog { width: min(560px, calc(100vw - 32px)); }
.campus-dialog .command-head b { flex: 1; color: var(--text); font-size: 15px; }
.campus-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; padding: 20px; }
.campus-form label { color: var(--text); font-size: 13px; font-weight: 600; }
.campus-form label:nth-child(-n+2) { grid-column: 1 / -1; }
.campus-form label > span { color: var(--muted); font-size: 11px; font-weight: 400; }
.campus-form input, .campus-form select { width: 100%; margin-top: 6px; }
.form-error { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; display: flex; align-items: center; gap: 20px; max-width: calc(100vw - 32px); padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-64); transform: translateX(-50%); font-size: 13px; }
.main > .toast { width: fit-content; margin: 0; }
.toast > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast .text-button { flex: none; }
.tool-list { display: grid; gap: 12px; }
.tool-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.tool-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.tool-icon svg { width: 24px; height: 24px; }
.tool-copy h2 { margin-bottom: 6px; font-size: 18px; }
.tool-copy p { margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.source-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 12px; font-weight: 600; }
.source-link svg { width: 14px; height: 14px; }

/* Games */
.game-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.game-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); transition: box-shadow 180ms var(--ease-standard), transform 260ms var(--ease-expressive), border-color 180ms var(--ease-standard); }
.game-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-8); transform: translateY(-3px); }
.game-card img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); }
.game-card__copy { padding: 12px 14px 14px; }
.game-card__copy b { display: block; margin-bottom: 3px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.game-card__copy small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Search */
.search-panel { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow-2); }
.search-main { display: flex; align-items: center; gap: 12px; }
.search-main > svg { margin-left: 4px; color: var(--muted); }
.search-main input { flex: 1; min-width: 0; height: 48px; font-size: 16px; }
.search-options { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.search-options label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.search-options select, .search-options input { min-height: 36px; font-size: 13px; }
.search-status { min-height: 40px; padding: 14px 2px 8px; color: var(--muted); font-size: 13px; }
.search-results { display: grid; gap: 10px; }
.result-card { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.result-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.result-site-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--muted); overflow: hidden; }
.result-site-icon img { width: 18px; height: 18px; }
.result-site-icon svg { width: 16px; height: 16px; }
.result-copy { min-width: 0; }
.result-copy h2 { margin-bottom: 6px; color: var(--accent); font-size: 17px; font-weight: 600; }
.result-copy p { display: -webkit-box; margin-bottom: 8px; color: var(--text); font-size: 14px; line-height: 1.65; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.result-meta { color: var(--muted); font-size: 12px; }
.result-score { align-self: start; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; white-space: nowrap; }
.skeleton { height: 126px; border-radius: var(--radius-card); background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 40%, var(--surface) 60%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }

/* Apps */
.app-list { display: grid; gap: 32px; }
.app-detail { scroll-margin-top: 24px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow-2); }
.app-summary { display: flex; align-items: center; gap: 22px; }
.app-icon { flex: none; width: 88px; height: 88px; border-radius: 22px; object-fit: contain; }
.app-title h2 { margin-bottom: 8px; font-size: 28px; }
.app-title > p:not(.kicker) { margin-bottom: 10px; color: var(--muted); }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; }
.meta-line span { position: relative; }
.meta-line span + span::before { content: "·"; position: absolute; left: -9px; }
.app-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
details { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
details summary { padding: 14px 16px; cursor: pointer; font-weight: 600; }
details p { margin: 0; padding: 0 16px 16px; color: var(--muted); font-size: 13px; }
details a { color: var(--accent); text-decoration: underline; }
.install-details { margin-top: 22px; }
.shot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shot-card { padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-align: left; transition: box-shadow 160ms var(--ease-standard); }
.shot-card:hover { box-shadow: var(--shadow-8); }
.shot-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--surface-2); }
.shot-card span { display: block; padding: 10px 12px; font-size: 12px; font-weight: 600; }
.shot-card--wide { width: 100%; margin-top: 22px; }
.shot-dialog { width: min(1200px, 92vw); max-width: none; padding: 0; overflow: visible; border: 0; border-radius: 18px; background: transparent; }
.shot-dialog img { width: 100%; max-height: 86vh; border-radius: 18px; object-fit: contain; box-shadow: var(--shadow-64); }
.shot-close { position: absolute; z-index: 2; top: 10px; right: 10px; background: var(--surface); box-shadow: var(--shadow-2); }
dialog::backdrop { background: rgba(10, 15, 11, .48); backdrop-filter: blur(5px); }
.command-dialog { width: min(640px, calc(100vw - 32px)); max-width: none; max-height: min(680px, 80vh); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-64); }
.command-dialog[open] { animation: dialog-in 300ms var(--ease-expressive); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.command-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.command-head input { flex: 1; min-width: 0; height: 42px; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 16px; }
.command-head input:focus { outline: 0; }
.command-results { max-height: 520px; padding: 8px; overflow-y: auto; }
.command-empty { padding: 32px 16px; color: var(--muted); text-align: center; }

/* Documentation */
.docs-section { margin-bottom: 28px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.docs-section > h2 { margin-bottom: 14px; }
.docs-section > p { margin-bottom: 0; color: var(--muted); }
.principle-list { margin: 0; padding-left: 22px; }
.principle-list li + li { margin-top: 10px; }
.token-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.token-grid > div { min-width: 0; }
.token-grid i { display: block; height: 64px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; }
.token-grid b, .token-grid code { display: block; font-size: 12px; }
.token-grid code { color: var(--muted); }
.docs-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.docs-columns p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.component-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
pre { padding: 16px; overflow-x: auto; border-radius: 12px; background: var(--surface-2); font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; }

/* Full Bean UI implementation manual */
.docs-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.docs-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow-2); scroll-margin-top: 24px; }
.docs-hero > div:first-child { max-width: 760px; }
.docs-hero h2 { margin-bottom: 10px; font-size: 26px; }
.docs-hero p:last-child { margin: 0; color: var(--muted); }
.docs-hero-actions { display: flex; flex: none; flex-direction: column; gap: 8px; }
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 24px; }
.docs-toc { position: sticky; top: 24px; display: grid; gap: 18px; max-height: calc(100vh - 48px); padding: 18px 16px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.docs-toc-group { display: grid; gap: 3px; }
.docs-toc-group b { margin-bottom: 5px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.docs-toc a { padding: 5px 8px; border-radius: 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.docs-toc a:hover, .docs-toc a:focus-visible { background: var(--accent-soft); color: var(--accent); }
.docs-content { min-width: 0; }
.docs-section { scroll-margin-top: 24px; }
.docs-section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.docs-section-heading > span { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.docs-section-heading h2 { margin: 0; }
.docs-section h3 { margin: 26px 0 12px; }
.docs-section h4 { margin: 18px 0 8px; font-size: 14px; }
.docs-section ul, .docs-section ol { color: var(--muted); }
.docs-section li + li { margin-top: 6px; }
.docs-lead { color: var(--text) !important; font-size: 15px; line-height: 1.75; }
.docs-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.docs-rule { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-2); }
.docs-rule h3:first-child, .docs-rule h4:first-child { margin-top: 0; }
.docs-rule ul { margin-bottom: 0; padding-left: 20px; }
.docs-callout { margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-control); background: var(--surface-2); color: var(--muted); }
.docs-callout--warning { border-left-color: var(--warning); background: var(--warning-soft); color: var(--text); }
.docs-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg); }
.docs-code { max-width: 100%; margin: 12px 0 18px; white-space: pre; tab-size: 2; }
.docs-checklist { display: grid; gap: 8px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-2); }
.docs-checklist p { margin: 0; color: var(--text); font-size: 13px; }
.docs-recipe { margin-bottom: 10px; background: var(--surface-2); }
.docs-recipe summary { color: var(--text); }
.docs-recipe > div { padding: 0 16px 16px; color: var(--muted); }
.docs-recipe > div > :last-child { margin-bottom: 0; }
.docs-recipe ol { margin-top: 0; padding-left: 22px; }
.docs-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 2px 28px; color: var(--muted); font-size: 12px; }
.docs-content .table-wrap { max-width: 100%; margin: 12px 0 18px; }
.docs-content table { min-width: 580px; }
.docs-content td { vertical-align: top; line-height: 1.55; }
.docs-content td code { overflow-wrap: anywhere; }
.docs-content p, .docs-content li { overflow-wrap: anywhere; }

/* Empty and system states */
.empty-state { padding: 48px 20px; color: var(--muted); text-align: center; }
.empty-state > svg { width: 32px; height: 32px; margin-bottom: 14px; color: var(--accent); }
.empty-state h2 { margin-bottom: 8px; color: var(--text); }
.empty-state p { margin-bottom: 16px; }
.empty-state--error > svg { color: var(--danger); }
.system-page { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.system-brand { position: fixed; top: 28px; left: 32px; font-size: 17px; font-weight: 700; letter-spacing: .09em; }
.system-brand span { color: var(--accent); }
.system-card { width: min(100%, 560px); padding: 36px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-8); }
.system-card h1 { font-size: 30px; }
.system-card > p:not(.kicker) { color: var(--muted); }

@media (max-width: 1199px) {
  .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .campus-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .token-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; grid-template-columns: repeat(4, minmax(0, 1fr)); max-height: none; }
}
@media (max-width: 999px) {
  .main { padding: 32px 28px 56px; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .campus-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 759px) {
  html { scroll-padding-top: 84px; }
  body { font-size: 14px; }
  h1 { font-size: 28px; }
  .sidebar { display: none; }
  .mobile-header { position: sticky; z-index: 25; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--nav-bg) 88%, transparent); backdrop-filter: blur(16px); }
  .header-actions { display: flex; gap: 4px; }
  .main { margin-left: 0; padding: 24px 16px calc(104px + env(safe-area-inset-bottom)); }
  .bottom-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--nav-bg) 94%, transparent); backdrop-filter: blur(18px); }
  .bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; min-height: 54px; padding: 5px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.2; overflow: hidden; }
  .bottom-nav a span { display: block; width: 100%; max-width: 100%; overflow: hidden; font-size: inherit; line-height: 1.2; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav a::before { content: ""; position: absolute; z-index: -1; top: 3px; width: 48px; height: 30px; border-radius: 999px; background: transparent; transition: background-color 180ms var(--ease-standard), transform 300ms var(--ease-expressive); }
  .bottom-nav a[aria-current="page"] { color: var(--accent); font-weight: 650; }
  .bottom-nav a[aria-current="page"]::before { background: var(--accent-soft); transform: scale(1.05); }
  .bottom-nav svg { width: 20px; height: 20px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 24px; }
  .page-description { font-size: 14px; }
  .home-search { padding: 16px; border-radius: 18px; }
  .home-search-box { height: 52px; padding: 0 14px; }
  .home-search-box input { font-size: 16px; }
  .home-search-box kbd { display: none; }
  .home-search-results { left: 16px; right: 16px; }
  .service-grid, .app-teaser-grid { grid-template-columns: 1fr; }
  .service-card { min-height: 94px; }
  .section { margin-top: 28px; }
  .section-note { display: none; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .input-with-icon { flex-basis: 100%; min-width: 0; }
  .toolbar .result-count { align-self: center; margin-left: auto; }
  .service-card--campus { flex-direction: column; gap: 10px; min-height: 142px; padding: 14px; }
  .service-card--campus .service-card__copy { width: 100%; padding-right: 0; }
  .service-card--campus .service-card__copy b { font-size: 14px; }
  .management-note { align-items: stretch; flex-direction: column; }
  .management-actions { justify-content: space-between; }
  .campus-form { grid-template-columns: 1fr; padding: 16px; }
  .campus-form label { grid-column: 1; }
  .dialog-actions { padding: 0 16px 16px; }
  .toast { bottom: calc(82px + env(safe-area-inset-bottom)); border-radius: 18px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .game-card__copy { padding: 10px 11px 12px; }
  .search-panel { padding: 14px; }
  .search-main { flex-wrap: wrap; }
  .search-main > svg { display: none; }
  .search-main input { flex-basis: 100%; }
  .search-main .button { width: 100%; }
  .search-options { display: grid; grid-template-columns: 1fr 1fr; }
  .search-options label { align-items: flex-start; flex-direction: column; gap: 4px; }
  .search-options label:last-child { grid-column: 1 / -1; }
  .search-options select, .search-options input { width: 100%; }
  .result-card { grid-template-columns: 28px minmax(0, 1fr); padding: 14px; }
  .result-score { grid-column: 2; width: fit-content; }
  .app-detail { padding: 20px 16px; }
  .app-summary { align-items: flex-start; gap: 14px; }
  .app-icon { width: 64px; height: 64px; border-radius: 16px; }
  .app-title h2 { font-size: 24px; }
  .app-actions .button { flex: 1 1 auto; }
  .details-grid, .shot-grid, .docs-columns { grid-template-columns: 1fr; }
  .tool-row { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 18px; }
  .tool-icon { width: 44px; height: 44px; border-radius: 14px; }
  .tool-row > .button { grid-column: 1 / -1; width: 100%; }
  .docs-section { padding: 18px; }
  .docs-hero { align-items: flex-start; flex-direction: column; padding: 22px 18px; }
  .docs-hero-actions { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .docs-grid-2 { grid-template-columns: 1fr; }
  .docs-toc { padding: 14px; }
  .docs-toc a { font-size: 11px; }
  .docs-section-heading { align-items: flex-start; }
  .docs-section-heading h2 { font-size: 19px; }
  .docs-content table { min-width: 540px; }
  .docs-footer { align-items: flex-start; flex-direction: column; }
  .token-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-dialog { width: 100%; max-height: 78dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .command-dialog[open] { animation-name: sheet-in; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(32px); } }
  .system-brand { top: 20px; left: 20px; }
  .system-card { padding: 26px 20px; }
}
@media (max-width: 359px) {
  .bottom-nav a { gap: 2px; font-size: 9px; }
  .bottom-nav svg { width: 18px; height: 18px; }
  .bottom-nav a::before { width: 42px; height: 28px; }
  .docs-toc { grid-template-columns: 1fr; }
  .docs-hero-actions .button { width: 100%; }
}
@media (hover: none) {
  .favorite-button { opacity: .62; }
  .favorite-button[aria-pressed="true"] { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* UI-10: mobile legibility, reachable controls and resilient feedback */
/* 02 — keep the 32px visual glyph while expanding its real hit area. */
.favorite-button::before, .campus-delete::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
/* 03–05 — readable supporting copy and less cramped controls. */
.chip, .management-actions .button, .search-options select, .search-options input { min-height: 40px; }
.custom-badge, .campus-form label > span, .docs-toc-group b { font-size: 12px; }
/* 06 — never hide the result of a destructive action behind an ellipsis. */
.toast { border-radius: 16px; }
.toast > span { overflow: visible; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
/* 07 — long game names get two lines instead of becoming unreadable fragments. */
.game-card__copy b { display: -webkit-box; min-height: 2.8em; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* 08 — the whole campus sheet scrolls when the keyboard shortens the viewport. */
.campus-dialog form { max-height: min(680px, 80dvh); overflow-y: auto; overscroll-behavior: contain; }
.campus-dialog .command-head, .campus-dialog .dialog-actions { flex: none; }
@media (max-width: 759px) {
  /* 01 — five labels remain legible down to 320px; do not solve overflow with 9px type. */
  .bottom-nav a { font-size: 11px; }
  .bottom-nav a span { letter-spacing: -.01em; }
  /* 02–04 — minimum 44px touch targets for card, filter, management and text actions. */
  .favorite-button, .campus-delete { width: 44px; height: 44px; }
  .favorite-button::before, .campus-delete::before { inset: 0; }
  .chip, .management-actions .button, .search-options select, .search-options input,
  .text-button, .text-link { min-height: 44px; }
  .text-button, .text-link { display: inline-flex; align-items: center; justify-content: center; }
  .management-actions { gap: 4px 10px; }
  /* 06 — the message and Undo action stay inside the visible area above the tab bar. */
  .toast { width: calc(100% - 32px); gap: 12px; justify-content: space-between; }
  /* 08 — matches the mobile bottom-sheet height, including the keyboard-reduced viewport. */
  .campus-dialog form { max-height: 78dvh; }
  /* 09 — documentation navigation is a list of real touch targets, not 27px text rows. */
  .docs-toc a { display: flex; align-items: center; min-height: 44px; font-size: 12px; }
  /* 10 — 16px form controls prevent iOS from zooming the whole layout on focus. */
  .campus-form input, .campus-form select, .search-options input, .search-options select { font-size: 16px; }
}
@media (max-width: 359px) {
  .bottom-nav a { font-size: 11px; }
}
@media (hover: none) {
  .favorite-button { opacity: 1; background: color-mix(in srgb, var(--surface-2) 80%, transparent); }
}
@media print {
  .sidebar, .mobile-header, .bottom-nav, .app-actions, .toolbar, .docs-toc, .docs-hero-actions { display: none !important; }
  .main { margin: 0; padding: 0; }
  .docs-layout { display: block; }
  .docs-section { border-color: #ccc; break-inside: auto; }
  .docs-section-heading, .docs-section h3 { break-after: avoid; }
  .docs-code, .table-wrap { overflow: visible; white-space: pre-wrap; }
  body { background: #fff; color: #000; }
}
