:root {
  color-scheme: light;
  --library-page: #f7f9fc;
  --library-surface: #ffffff;
  --library-surface-subtle: #f3f7f8;
  --library-text: #031d4a;
  --library-text-secondary: #5d6b7f;
  --library-muted: #8793a3;
  --library-line: rgba(3, 29, 74, 0.11);
  --library-divider: rgba(3, 29, 74, 0.08);
  --library-accent: #0caabd;
  --library-accent-soft: rgba(12, 170, 189, 0.09);
  --library-success: #3f7c5a;
  --library-danger: #bd574d;
  --library-shadow: 0 14px 40px rgba(3, 29, 74, 0.07);
  --library-radius-control: 8px;
  --library-radius-card: 16px;
  --library-radius-panel: 20px;
  --library-ease: cubic-bezier(.23, 1, .32, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --library-page: #0d131a;
  --library-surface: #141b23;
  --library-surface-subtle: #111c27;
  --library-text: #f1f5f8;
  --library-text-secondary: #9aa8b8;
  --library-muted: #718091;
  --library-line: rgba(241, 245, 248, 0.13);
  --library-divider: rgba(241, 245, 248, 0.09);
  --library-accent: #3ba9b7;
  --library-accent-soft: rgba(59, 169, 183, 0.1);
  --library-success: #8bc49e;
  --library-danger: #f08c80;
  --library-shadow: 0 16px 44px rgba(0, 0, 0, 0.26);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--library-page);
  color: var(--library-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
a { color: inherit; }
[hidden] { display: none !important; }

.web-library {
  min-height: 100vh;
  padding: 18px;
}

.web-library-topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(280px, 1.35fr) minmax(360px, auto);
  align-items: center;
  gap: 18px;
  min-height: 72px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--library-line);
  border-radius: var(--library-radius-panel);
  background: color-mix(in srgb, var(--library-surface) 96%, transparent);
  box-shadow: var(--library-shadow);
  backdrop-filter: blur(18px);
}

.web-library-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.web-library-brand img { width: 38px; height: 38px; object-fit: contain; }
.web-library-brand span { display: grid; gap: 1px; }
.web-library-brand strong { font-size: 15px; letter-spacing: -.01em; }
.web-library-brand small { color: var(--library-muted); font-size: 11px; }

.web-library-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--library-line);
  border-radius: 12px;
  background: var(--library-surface-subtle);
  transition: border-color .18s var(--library-ease), box-shadow .18s var(--library-ease), background .18s var(--library-ease);
}
.web-library-search:focus-within { border-color: color-mix(in srgb, var(--library-accent) 50%, transparent); box-shadow: 0 0 0 3px var(--library-accent-soft); background: var(--library-surface); }
.web-library-search > span { color: var(--library-muted); font-size: 18px; }
.web-library-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--library-text); }
.web-library-search input::placeholder { color: var(--library-muted); }

.web-library-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.icon-button, .text-button, .account-button, .primary-button, .link-button, .content-tabs button, .project-row, .knowledge-row, .mobile-back {
  border: 1px solid var(--library-line);
  border-radius: 10px;
  background: var(--library-surface);
  transition: transform .18s var(--library-ease), border-color .18s var(--library-ease), background .18s var(--library-ease), box-shadow .18s var(--library-ease);
}
.icon-button:hover, .text-button:hover, .account-button:hover, .content-tabs button:hover { border-color: color-mix(in srgb, var(--library-accent) 44%, var(--library-line)); background: var(--library-accent-soft); }
.icon-button:active, .text-button:active, .account-button:active, .content-tabs button:active { transform: translateY(1px); }
.icon-button { height: 36px; padding: 0 10px; }
.text-button { height: 36px; padding: 0 12px; }
.account-button { display: inline-flex; align-items: center; gap: 8px; height: 38px; max-width: 210px; padding: 0 10px 0 6px; }
.account-button > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--library-text-secondary); font-size: 12px; }
.avatar { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--library-accent-soft); color: var(--library-accent); font-weight: 700; }

.web-library-sync-state { display: inline-flex; align-items: center; gap: 7px; color: var(--library-text-secondary); font-size: 12px; white-space: nowrap; }
.web-library-sync-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--library-muted); box-shadow: 0 0 0 4px color-mix(in srgb, var(--library-muted) 12%, transparent); }
.web-library-sync-state[data-state="syncing"] i { background: var(--library-accent); animation: syncPulse 1.2s ease-in-out infinite; }
.web-library-sync-state[data-state="success"] i { background: var(--library-success); }
.web-library-sync-state[data-state="error"] i { background: var(--library-danger); }
@keyframes syncPulse { 50% { transform: scale(.68); opacity: .55; } }

.web-library-auth { display: grid; min-height: calc(100vh - 122px); place-items: center; padding: 40px 16px 70px; }
.auth-card { width: min(600px, 100%); padding: 34px; border: 1px solid var(--library-line); border-radius: 24px; background: var(--library-surface); box-shadow: var(--library-shadow); }
.auth-back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 28px; color: var(--library-text-secondary); text-decoration: none; font-size: 13px; }
.auth-mark { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 18px; border-radius: 17px; background: var(--library-surface-subtle); border: 1px solid var(--library-line); }
.auth-mark img { width: 34px; height: 34px; }
.eyebrow, .pane-kicker { margin: 0 0 6px; color: var(--library-accent); font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.auth-card h1 { max-width: 510px; margin: 0 0 14px; font-size: clamp(30px, 5vw, 46px); line-height: 1.08; letter-spacing: -.04em; }
.auth-lead { margin: 0 0 28px; color: var(--library-text-secondary); line-height: 1.72; font-size: 14px; }
.auth-card form { display: grid; gap: 12px; }
.auth-card label { display: grid; gap: 7px; color: var(--library-text-secondary); font-size: 12px; }
.auth-card input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--library-line); border-radius: 11px; outline: none; background: var(--library-surface-subtle); }
.auth-card input:focus { border-color: color-mix(in srgb, var(--library-accent) 50%, transparent); box-shadow: 0 0 0 3px var(--library-accent-soft); background: var(--library-surface); }
.primary-button { min-height: 46px; padding: 0 18px; border-color: var(--library-text); background: var(--library-text); color: var(--library-surface); font-weight: 700; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(3,29,74,.16); }
.link-button { width: max-content; padding: 4px 0; border: 0; background: transparent; color: var(--library-text-secondary); font-size: 12px; }
.auth-message { min-height: 20px; margin: 14px 0 0; color: var(--library-text-secondary); font-size: 12px; }
.auth-message[data-state="error"] { color: var(--library-danger); }
.read-only-note { display: grid; gap: 4px; margin-top: 24px; padding: 14px 15px; border-radius: 14px; background: var(--library-surface-subtle); color: var(--library-text-secondary); font-size: 12px; line-height: 1.55; }
.read-only-note strong { color: var(--library-text); font-size: 12px; }

.web-library-shell { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(350px, 1.08fr) minmax(420px, 1.35fr); gap: 14px; min-height: calc(100vh - 104px); }
.library-pane { min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--library-line); border-radius: var(--library-radius-panel); background: var(--library-surface); box-shadow: var(--library-shadow); }
.project-pane, .list-pane { display: flex; flex-direction: column; }
.pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 10px; }
.pane-head h1, .pane-head h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.pane-kicker { margin-bottom: 4px; color: var(--library-muted); }
.pane-meta { margin: 0; padding: 0 20px 12px; color: var(--library-muted); font-size: 11px; }
.count-badge { display: grid; min-width: 28px; height: 28px; place-items: center; padding: 0 8px; border-radius: 999px; background: var(--library-surface-subtle); color: var(--library-text-secondary); font-size: 11px; font-weight: 700; }
.project-list { flex: 1; overflow: auto; padding: 4px 10px 12px; }
.project-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; width: 100%; margin: 2px 0; padding: 10px 11px; border-color: transparent; background: transparent; text-align: left; }
.project-row:hover { background: var(--library-surface-subtle); }
.project-row.is-active { border-color: color-mix(in srgb, var(--library-accent) 24%, transparent); background: var(--library-accent-soft); }
.project-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.project-row small { color: var(--library-muted); font-size: 10px; }
.project-row[data-depth="1"] { padding-left: 24px; }
.project-row[data-depth="2"] { padding-left: 38px; }
.cloud-summary { display: grid; gap: 4px; margin: 8px 12px 12px; padding: 12px; border-radius: 14px; background: var(--library-surface-subtle); }
.cloud-summary p { display: flex; justify-content: space-between; gap: 12px; margin: 0; color: var(--library-muted); font-size: 10px; }
.cloud-summary strong { color: var(--library-text-secondary); font-weight: 650; }

.project-overview { margin: 0 14px 14px; padding: 14px; border: 1px solid var(--library-divider); border-radius: 16px; background: var(--library-surface-subtle); }
.project-overview-content { display: grid; gap: 10px; }
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.overview-block { min-width: 0; padding: 11px 12px; border: 1px solid var(--library-divider); border-radius: 12px; background: var(--library-surface); }
.overview-block.overview-next { grid-column: 1 / -1; }
.overview-label { display: block; margin-bottom: 6px; color: var(--library-muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.overview-block strong { display: block; color: var(--library-text); font-size: 12px; line-height: 1.55; text-wrap: pretty; }
.overview-block p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: 5px 0 0; color: var(--library-text-secondary); font-size: 10px; line-height: 1.55; }
.overview-next[data-ready="true"] { border-color: color-mix(in srgb, var(--library-accent) 24%, var(--library-divider)); background: color-mix(in srgb, var(--library-accent-soft) 64%, var(--library-surface)); }
.overview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
.overview-metrics > span { display: grid; gap: 2px; min-width: 0; padding: 8px 9px; border-radius: 10px; background: var(--library-surface); text-align: center; }
.overview-metrics strong { font-size: 13px; }
.overview-metrics small { overflow: hidden; color: var(--library-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.context-copy-button { width: 100%; min-height: 40px; margin-top: 10px; padding: 0 13px; border: 1px solid var(--library-line); border-radius: 10px; background: var(--library-surface); color: var(--library-text); font-weight: 700; font-size: 11px; transition: border-color .18s var(--library-ease), background .18s var(--library-ease), transform .18s var(--library-ease); }
.context-copy-button:hover { border-color: color-mix(in srgb, var(--library-accent) 40%, var(--library-line)); background: var(--library-accent-soft); }
.context-copy-button:active { transform: translateY(1px); }
.context-copy-note { min-height: 14px; margin: 7px 2px 0; color: var(--library-muted); font-size: 9px; line-height: 1.45; }
.overview-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 10px; }
.overview-actions .context-copy-button { margin-top: 0; }
.context-edit-button, .secondary-button, .primary-compact-button { min-height: 40px; padding: 0 12px; border: 1px solid var(--library-line); border-radius: 10px; background: var(--library-surface); color: var(--library-text); font-size: 10px; font-weight: 700; transition: border-color .18s var(--library-ease), background .18s var(--library-ease), transform .18s var(--library-ease); }
.context-edit-button:hover, .secondary-button:hover { border-color: color-mix(in srgb, var(--library-accent) 38%, var(--library-line)); background: var(--library-accent-soft); }
.context-edit-button:active, .secondary-button:active, .primary-compact-button:active { transform: translateY(1px); }
.primary-compact-button { border-color: var(--library-text); background: var(--library-text); color: var(--library-surface); }
.context-edit-button:disabled, .secondary-button:disabled, .primary-compact-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.context-edit-notice { min-height: 0; margin: 4px 2px 0; color: var(--library-success); font-size: 9px; line-height: 1.5; }
.context-edit-panel { margin-top: 10px; padding: 12px; border: 1px solid var(--library-line); border-radius: 13px; background: var(--library-surface); }
.context-edit-form, .context-edit-review { display: grid; gap: 10px; }
.context-edit-head strong, .context-edit-review > div:first-child strong { display: block; margin-bottom: 3px; font-size: 11px; }
.context-edit-head p, .context-edit-review > div:first-child p { margin: 0; color: var(--library-muted); font-size: 9px; line-height: 1.5; }
.context-edit-form label { display: grid; gap: 5px; color: var(--library-text-secondary); font-size: 9px; font-weight: 650; }
.context-edit-form textarea { width: 100%; min-height: 58px; resize: vertical; padding: 9px 10px; border: 1px solid var(--library-line); border-radius: 9px; outline: none; background: var(--library-surface-subtle); color: var(--library-text); font: inherit; font-size: 10px; line-height: 1.55; }
.context-edit-form textarea:focus { border-color: color-mix(in srgb, var(--library-accent) 50%, transparent); box-shadow: 0 0 0 3px var(--library-accent-soft); background: var(--library-surface); }
.context-edit-status { min-height: 14px; margin: 0; color: var(--library-muted); font-size: 9px; line-height: 1.45; }
.context-edit-status[data-state="error"] { color: var(--library-danger); }
.context-edit-controls { display: flex; justify-content: flex-end; gap: 7px; }
.context-edit-changes { display: grid; gap: 8px; }
.context-edit-change { padding: 10px; border: 1px solid var(--library-divider); border-radius: 10px; background: var(--library-surface-subtle); }
.context-edit-change > strong { display: block; margin-bottom: 7px; font-size: 10px; }
.context-edit-change > div { display: grid; gap: 6px; }
.context-edit-change p { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 7px; margin: 0; color: var(--library-text-secondary); font-size: 9px; line-height: 1.5; }
.context-edit-change p > span { color: var(--library-muted); }
.context-edit-change del, .context-edit-change ins { overflow-wrap: anywhere; text-decoration: none; }
.context-edit-change ins { color: var(--library-text); font-weight: 650; }
.context-edit-conflict { display: grid; gap: 6px; padding: 10px; border: 1px solid color-mix(in srgb, var(--library-danger) 38%, var(--library-line)); border-radius: 10px; background: color-mix(in srgb, var(--library-danger) 7%, var(--library-surface)); }
.context-edit-conflict strong { color: var(--library-danger); font-size: 10px; }
.context-edit-conflict p { margin: 0; color: var(--library-text-secondary); font-size: 9px; line-height: 1.5; }
.context-edit-conflict .secondary-button { justify-self: start; }

.content-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 12px; scrollbar-width: none; }
.content-tabs::-webkit-scrollbar { display: none; }
.content-tabs button { flex: 0 0 auto; height: 30px; padding: 0 10px; border-color: transparent; background: transparent; color: var(--library-text-secondary); font-size: 11px; }
.content-tabs button.is-active { border-color: var(--library-line); background: var(--library-surface-subtle); color: var(--library-text); font-weight: 700; }
.list-meta { padding: 10px 18px; border-top: 1px solid var(--library-divider); border-bottom: 1px solid var(--library-divider); color: var(--library-muted); font-size: 10px; }
.knowledge-list { flex: 1; overflow: auto; padding: 10px; }
.knowledge-row { display: grid; width: 100%; margin: 3px 0; padding: 12px; border-color: transparent; background: transparent; text-align: left; }
.knowledge-row:hover { background: var(--library-surface-subtle); }
.knowledge-row.is-active { border-color: color-mix(in srgb, var(--library-accent) 24%, transparent); background: var(--library-accent-soft); }
.knowledge-row header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.type-chip { padding: 3px 6px; border-radius: 999px; background: var(--library-surface-subtle); color: var(--library-text-secondary); font-size: 9px; font-weight: 700; }
.knowledge-row time { color: var(--library-muted); font-size: 9px; }
.knowledge-row strong { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 5px; font-size: 13px; line-height: 1.45; }
.knowledge-row p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: 0; color: var(--library-text-secondary); font-size: 11px; line-height: 1.55; }

.detail-pane { overflow: auto; }
.detail-empty { display: grid; min-height: 100%; place-content: center; justify-items: center; padding: 48px; text-align: center; }
.detail-empty img { width: 60px; height: 60px; margin-bottom: 18px; opacity: .16; }
.detail-empty h2 { margin: 0 0 8px; font-size: 18px; }
.detail-empty p { max-width: 360px; margin: 0; color: var(--library-muted); font-size: 12px; line-height: 1.65; }
.detail-content { padding: 26px 28px 42px; }
.detail-content .detail-type { display: inline-flex; margin-bottom: 14px; padding: 4px 8px; border-radius: 999px; background: var(--library-accent-soft); color: var(--library-accent); font-size: 10px; font-weight: 750; }
.detail-content h2 { margin: 0 0 8px; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.2; letter-spacing: -.035em; }
.detail-content .detail-meta { margin-bottom: 24px; color: var(--library-muted); font-size: 11px; }
.detail-content .detail-body { color: var(--library-text-secondary); font-size: 13px; line-height: 1.78; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-content .detail-body h3 { margin: 26px 0 8px; color: var(--library-text); font-size: 14px; }
.detail-content .detail-body p { margin: 0 0 12px; }
.detail-content .detail-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--library-divider); }
.detail-content .detail-section strong { display: block; margin-bottom: 7px; color: var(--library-text); font-size: 11px; }
.detail-content .detail-section p { margin: 0; color: var(--library-text-secondary); font-size: 12px; line-height: 1.7; white-space: pre-wrap; }

.account-popover { position: fixed; z-index: 60; top: 82px; right: 24px; display: grid; gap: 6px; width: min(280px, calc(100vw - 32px)); padding: 14px; border: 1px solid var(--library-line); border-radius: 14px; background: var(--library-surface); box-shadow: var(--library-shadow); }
.account-popover strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.account-popover > span { color: var(--library-muted); font-size: 10px; }
.account-cloud-trust { display: grid; gap: 10px; margin-top: 6px; padding: 12px; border: 1px solid var(--library-divider); border-radius: 12px; background: var(--library-surface-subtle); }
.cloud-trust-status { display: flex; align-items: center; gap: 7px; color: var(--library-text-secondary); font-size: 10px; }
.cloud-trust-status i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--library-success); }
.account-cloud-trust dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; }
.account-cloud-trust dl div { display: grid; gap: 2px; padding: 8px; border-radius: 9px; background: var(--library-surface); text-align: center; }
.account-cloud-trust dt { color: var(--library-muted); font-size: 8px; }
.account-cloud-trust dd { margin: 0; color: var(--library-text); font-size: 12px; font-weight: 750; }
.account-cloud-trust p { display: flex; justify-content: space-between; gap: 10px; margin: 0; color: var(--library-muted); font-size: 9px; }
.account-cloud-trust p strong { color: var(--library-text-secondary); font-size: 9px; font-weight: 650; }
.account-cloud-trust small { color: var(--library-muted); font-size: 9px; line-height: 1.5; text-wrap: pretty; }
.account-popover button { margin-top: 6px; padding: 9px 10px; border: 1px solid var(--library-line); border-radius: 9px; background: var(--library-surface-subtle); text-align: left; }
.mobile-back { display: none; }
.empty-list { padding: 42px 18px; color: var(--library-muted); text-align: center; font-size: 12px; line-height: 1.7; }

@media (max-width: 1120px) {
  .web-library-topbar { grid-template-columns: minmax(190px,.75fr) minmax(240px,1.2fr) auto; }
  .web-library-sync-state { display: none; }
  .web-library-shell { grid-template-columns: 220px minmax(320px, .9fr) minmax(360px, 1.15fr); }
}

@media (max-width: 760px) {
  .web-library { padding: 10px; }
  .web-library-topbar { position: relative; grid-template-columns: 1fr auto; min-height: auto; gap: 10px; margin-bottom: 10px; padding: 10px; border-radius: 16px; }
  .web-library-brand img { width: 34px; height: 34px; }
  .web-library-search { grid-column: 1 / -1; grid-row: 2; height: 40px; }
  .web-library-actions { gap: 5px; }
  .web-library-actions .text-button, .web-library-actions .account-button > span:last-child { display: none; }
  .web-library-auth { min-height: calc(100vh - 128px); padding: 18px 4px 40px; align-items: start; }
  .auth-card { padding: 24px 20px; border-radius: 18px; }
  .auth-card h1 { font-size: 32px; }
  .web-library-shell { position: relative; display: block; min-height: calc(100vh - 128px); }
  .library-pane { display: none; min-height: calc(100vh - 130px); border-radius: 16px; box-shadow: none; }
  .web-library[data-mobile-view="projects"] .project-pane,
  .web-library[data-mobile-view="items"] .list-pane,
  .web-library[data-mobile-view="detail"] .detail-pane { display: flex; }
  .web-library[data-mobile-view="detail"] .detail-pane { display: block; }
  .mobile-back { position: sticky; z-index: 10; top: 6px; display: inline-flex; align-items: center; gap: 7px; height: 34px; margin: 0 0 8px; padding: 0 11px; background: var(--library-surface); }
  .web-library[data-mobile-view="projects"] .mobile-back { display: none; }
  .project-overview { margin: 0 10px 12px; padding: 12px; }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-block.overview-next { grid-column: auto; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .overview-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .context-copy-button, .context-edit-button, .secondary-button, .primary-compact-button { min-height: 44px; }
  .context-edit-controls > button { flex: 1; }
  .detail-content { padding: 22px 20px 36px; }
  .account-popover { top: 72px; right: 12px; width: min(310px, calc(100vw - 24px)); }
}

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