/* Book 应用界面：内容紧凑分组，触控目标独立保持至少 48px。 */
:root {
    color-scheme: light;
    --bg: #f2f5f3;
    --surface: #fff;
    --text: #20352d;
    --muted: #586c61;
    --primary: #184e40;
    --primary-hover: #103d31;
    --border: #d9e3dc;
    --tint: #eaf3ed;
    --danger: #a3312b;
    --danger-bg: #fff0ed;
    --sidebar: 208px;
    --mobile-nav: 68px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 80px; scroll-padding-bottom: 180px; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; touch-action: manipulation; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 16px; border: 1px solid var(--primary); border-radius: 12px; background: var(--primary); color: #fff; font-weight: 600; line-height: 1.4; text-decoration: none; cursor: pointer; touch-action: manipulation; transition: background 160ms, border-color 160ms; }
button:hover, .button:hover { background: var(--primary-hover); text-decoration: none; }
button:active, .button:active { filter: brightness(.94); }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: var(--surface); border-color: var(--border); color: var(--primary); }
.secondary:hover { background: var(--tint); }
.danger { background: var(--danger); border-color: var(--danger); }
.danger:hover { background: #82251f; }
:focus-visible { outline: 3px solid #ab7827; outline-offset: 3px; }
.icon, .edit-pencil svg { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 12px; background: var(--surface); border: 2px solid var(--primary); border-radius: 8px; }
.skip-link:focus { top: 12px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid #b5c7bb; border-radius: 10px; background: var(--surface); color: var(--text); }
input[readonly] { background: var(--bg); }
textarea { resize: vertical; line-height: 1.6; }
input[type="file"] { font-size: 14px; }
input::file-selector-button { min-height: 32px; padding: 4px 12px; margin-right: 8px; border: 0; border-radius: 6px; color: var(--primary); background: var(--tint); }
label { display: block; margin-bottom: 12px; font-weight: 600; }
label > input, label > select, label > textarea, label > .password-field { margin-top: 6px; }
small { display: block; font-size: 13px; font-weight: 400; }
label small { margin-top: 6px; color: var(--muted); }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(23px, 2.4vw, 30px); line-height: 1.35; letter-spacing: -.4px; }
h2 { margin: 0 0 12px; font-size: 17px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
.required, .error-text { color: var(--danger); }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 1px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 23px; font-weight: 750; line-height: 1.3; min-height: 48px; }
.brand:hover { text-decoration: none; }
.brand-icon { display: grid; place-items: center; width: 42px; height: 44px; border-radius: 12px; background: var(--primary); color: #fff; font-size: 26px; }
.brand small { font-size: 12px; color: var(--muted); font-weight: 400; }
.app-shell .site-header { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 24px 16px; flex-direction: column; align-items: stretch; justify-content: flex-start; border-right: 1px solid var(--border); border-bottom: 0; z-index: 30; }
.app-nav { display: flex; flex-direction: column; gap: 8px; margin-top: 32px; }
.app-nav a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px; border-radius: 12px; color: var(--muted); font-weight: 600; }
.app-nav a:hover { background: var(--bg); text-decoration: none; }
.app-nav a[aria-current] { color: var(--primary); background: var(--tint); }
.header-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.account-name { font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.nav-button { padding: 10px; background: transparent; border-color: transparent; color: var(--muted); font-size: 14px; }
.nav-button:hover { background: var(--tint); }
.nav-button span { display: none; }
main { max-width: 1680px; margin: 0 auto; padding: 24px; min-height: calc(100vh - 130px); }
.app-shell main { margin-left: var(--sidebar); max-width: none; }
.has-actions main { padding-bottom: 110px; }
.page-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.heading-copy { min-width: 0; flex: 1; }
.heading-back { width: 48px; flex-shrink: 0; padding: 10px; }
.page-hint { font-size: 13px; color: var(--muted); }
.search-form { display: flex; gap: 12px; align-items: flex-end; padding: 16px; }
.search-form label { margin: 0; min-width: 140px; font-size: 13px; }
.search-form .search-input { flex: 1; min-width: 180px; }
.search-form .page-size-field { min-width: 100px; }
.search-form button { flex-shrink: 0; }
.list-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 12px; color: var(--muted); font-size: 14px; }
.list-caption strong { color: var(--text); font-size: 18px; }
.sort-hint { margin-left: 16px; font-size: 12px; }
.view-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.view-switch a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 12px; border-radius: 8px; color: var(--muted); }
.view-switch a[aria-current] { color: var(--primary); background: var(--tint); font-weight: 600; }
.view-switch a:hover { text-decoration: none; background: var(--bg); }
/* 原生链接覆盖卡片空白区域；标签和编辑按钮位于其上方，保持各自操作。 */
.record-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.record-card { position: relative; min-width: 0; padding: 16px; display: flex; flex-direction: column; transition: border-color 160ms, box-shadow 160ms; }
.record-card:hover, .record-card:focus-within { border-color: #82aa91; box-shadow: 0 4px 14px #184e4010; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-top h2 { margin: 0; }
.attachment-count { font-size: 12px; white-space: nowrap; }
.record-card h2 { font-size: 17px; line-height: 1.5; margin: 0 0 12px; }
.record-card h2 a { color: var(--text); }
.card-open::after { content: ''; position: absolute; inset: 0; border-radius: 16px; }
.card-open:hover { text-decoration: none; }
.card-open:focus-visible { outline: none; }
.card-open:focus-visible::after { outline: 3px solid #ab7827; outline-offset: 2px; }
.category-tag, .status-tag { display: inline-block; padding: 4px 9px; border-radius: 7px; background: var(--tint); color: var(--primary); font-size: 12px; font-weight: 600; }
a.category-tag { display: inline-flex; align-items: center; min-height: 48px; }
.inactive { background: var(--bg); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.tags span { color: var(--muted); background: var(--bg); padding: 4px 8px; font-size: 13px; border-radius: 6px; }
.keyword-link { display: inline-flex; align-items: center; min-height: 48px; max-width: 100%; padding: 8px 10px; gap: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--primary); border-radius: 9px; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.keyword-link:hover { background: var(--tint); text-decoration: none; }
.record-card .tags a, .card-edit { position: relative; z-index: 1; }
.tag-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; color: var(--muted); font-size: 12px; }
time { font-variant-numeric: tabular-nums; }
.card-edit { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 8px; border-radius: 9px; font-size: 13px; }
.card-edit:hover { background: var(--tint); text-decoration: none; }
.compact-list { grid-template-columns: 1fr; gap: 8px; }
.compact-list .record-card { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(120px, .6fr) minmax(220px, auto); gap: 8px 16px; align-items: center; padding: 8px 16px; }
.compact-list .record-card h2 { grid-column: 1; grid-row: 1; margin: 0; }
.compact-list .card-top { grid-column: 2; grid-row: 1; justify-content: flex-start; margin: 0; }
.compact-list .card-bottom { grid-column: 3; grid-row: 1; margin: 0; padding: 0; }
.compact-list .record-card > .tags { display: none; }
.compact-list .record-card > .tags:empty { display: none; }
.compact-list .keyword-link { min-height: 44px; padding-block: 6px; }
.tag-recommendations { margin: 12px 0; padding: 8px 16px; }
summary { cursor: pointer; touch-action: manipulation; }
.tag-recommendations > summary, .section-collapse > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 600; list-style: none; }
.tag-recommendations > summary::after, .section-collapse > summary::after, .record-times > summary::after { content: '+'; margin-left: auto; color: var(--primary); font-size: 20px; }
.tag-recommendations[open] > summary::after, .section-collapse[open] > summary::after, .record-times[open] > summary::after { content: '−'; }
summary::-webkit-details-marker { display: none; }
.tag-recommendations summary small, .section-collapse summary small { color: var(--muted); font-size: 12px; }
.tag-recommendations .tags { padding: 4px 0 8px; }
.active-tag { margin: 12px 0 0; }
.keyword-suggestions { margin: 0 0 8px; }
.keyword-suggestions > .tags { margin-top: 8px; }
.keyword-suggestions button { min-height: 44px; padding: 8px 12px; font-size: 13px; font-weight: 500; }
.keyword-suggestions small { margin-top: 6px; color: var(--muted); }
.empty-state { padding: 40px 20px; text-align: center; }
.empty-icon { display: block; color: var(--muted); font-size: 40px; margin-bottom: 12px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 24px; }
.form-panel { max-width: 1140px; padding: 24px; }
.narrow-panel { max-width: 660px; }
.form-grid, .attachment-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid label { min-width: 0; margin: 0; }
.wide-field { grid-column: 1 / -1; }
.section-divider { height: 1px; margin: 24px 0; background: var(--border); }
.attachment-slot { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.attachment-slot label { margin: 0; }
.upload-status { display: block; margin-top: 6px; font-size: 13px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
/* 操作栏与手机导航各自占位，避开屏幕安全区域。 */
.action-dock { position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; width: max-content; max-width: min(640px, calc(100% - var(--sidebar) - 48px)); margin: 0; padding: 8px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 6px 28px #173e291a; }
.action-dock .notice, .dock-status { flex-basis: 100%; margin: 0; max-height: 24vh; overflow-y: auto; }
.edit-state { flex-basis: 100%; color: var(--muted); font-size: 12px; padding-inline: 4px; }
.action-dock button, .action-dock .button { flex-shrink: 0; }
.action-menu { position: relative; }
.action-menu summary { list-style: none; }
.menu-panel { position: absolute; bottom: calc(100% + 12px); right: 0; width: 208px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 32px #20352d26; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; min-height: 48px; justify-content: flex-start; padding: 12px; border: 0; border-radius: 8px; font-size: 14px; font-weight: 500; }
.menu-panel a:hover { background: var(--tint); text-decoration: none; }
.menu-panel .danger { background: var(--danger-bg); color: var(--danger); }
.menu-panel .danger:hover { background: #ffddd6; }
.notice { padding: 12px 16px; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow-wrap: anywhere; font-size: 14px; }
.success { background: #edf7ee; color: #24552e; border-color: #bad6bf; }
.error { background: var(--danger-bg); color: #873228; border-color: #e5bcb4; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.detail-panel { min-width: 0; padding: 20px; }
.quick-field { min-width: 0; margin-bottom: 12px; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-weight: 600; }
.field-heading h2 { margin: 0; }
.edit-pencil { width: 48px; min-width: 48px; height: 48px; padding: 12px; background: var(--tint); border-color: transparent; }
.record-fields .quick-field { display: grid; grid-template-columns: 64px minmax(0, 1fr) 48px; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.record-fields .field-heading { display: contents; }
.field-label { grid-column: 1; grid-row: 1; min-height: 48px; padding: 0; justify-content: flex-start; border: 0; background: transparent; color: var(--muted); font-size: 14px; }
.field-label:hover, .field-value:hover { color: var(--primary); background: var(--tint); }
.field-value { width: 100%; min-height: 48px; padding: 8px; justify-content: flex-start; text-align: left; border: 0; background: transparent; color: var(--text); font-size: 16px; overflow-wrap: anywhere; }
.record-fields .edit-pencil { grid-column: 3; grid-row: 1; }
.record-fields [data-field-display] { grid-column: 2; grid-row: 1; min-width: 0; }
.record-fields .quick-edit, .record-fields [data-field-status] { grid-column: 1 / -1; min-width: 0; }
.copy-field { display: flex; align-items: center; gap: 8px; }
.copy-field input { font-variant-numeric: tabular-nums; }
.copy-field button { padding-inline: 12px; flex-shrink: 0; }
[data-copy-status]:empty { display: none; }
.quick-field [data-field-status] { margin-top: 8px; font-size: 14px; }
.quick-field [data-field-display] p { margin-bottom: 0; }
.record-times { margin-top: 12px; }
.record-times > summary { display: flex; align-items: center; min-height: 48px; color: var(--muted); font-size: 14px; list-style: none; }
dl { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; margin: 8px 0 0; font-size: 13px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
pre { max-width: 100%; padding: 16px; border-radius: 12px; background: var(--bg); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font: inherit; }
.attachment-panel { margin-top: 16px; }
.section-collapse { padding-top: 8px; padding-bottom: 8px; }
.section-collapse[open] { padding-bottom: 20px; }
.section-collapse[open] > summary { margin-bottom: 12px; }
.attachment-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.attachment-quick { margin: 0; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.attachment-row { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.attachment-row > div:first-child { min-width: 0; }
.file-name { margin: 4px 0; font-size: 15px; }
.attachment-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.share-dialog { width: min(460px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); overflow-y: auto; overscroll-behavior: contain; }
.share-dialog::backdrop { background: #10291fd0; }
.share-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.share-heading h2 { margin: 0; }
.share-dialog [data-share-status] { font-size: 14px; }
.share-image { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; }
.share-actions { display: flex; justify-content: center; margin-top: 16px; }
body:has(.share-dialog[open]) { overflow: hidden; }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.history-table th, .history-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.history-table th { color: var(--muted); font-weight: 500; }
.history-table th:first-child { width: 35%; }
.history-table input { min-width: 100px; }
.related-layout { margin-top: 16px; }
.related-keywords { margin-bottom: 12px; }
.related-record { display: block; min-height: 64px; padding: 12px; margin-top: 8px; border: 1px solid var(--border); border-radius: 12px; overflow-wrap: anywhere; }
.related-record:hover { background: var(--tint); text-decoration: none; }
.related-record strong { font-size: 15px; font-weight: 600; }
.related-record small { margin-top: 4px; color: var(--muted); }
.back-link { display: inline-block; min-height: 48px; padding: 12px 0; }
.management-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.management-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; min-width: 0; }
.management-card > div:first-child { min-width: 0; }
.management-card h2 { margin-bottom: 4px; }
.management-card p { margin-bottom: 4px; }
.management-actions { display: flex; align-items: center; gap: 8px; }
.login-main { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.login-panel { width: 100%; max-width: 440px; min-width: 0; flex-shrink: 0; padding: 32px; box-shadow: 0 10px 40px #173e2910; }
.login-panel h1 { margin-bottom: 8px; }
.login-panel .notice { margin: 16px 0 0; }
.login-panel form { margin-top: 24px; }
.password-field { display: flex; gap: 8px; }
.password-field input { min-width: 0; }
.password-field button { flex-shrink: 0; }
.captcha-field { margin-bottom: 20px; }
.captcha-field label { margin-bottom: 8px; }
.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-row input { min-width: 0; text-transform: uppercase; }
.captcha-row button { width: 152px; height: 50px; flex-shrink: 0; padding: 0; overflow: hidden; }
.captcha-row img { display: block; }
.captcha-field small { margin-top: 6px; color: var(--muted); }
.captcha-field .error-text { color: var(--danger); }
.full-width { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
footer { padding: 16px 24px; text-align: center; color: var(--muted); font-size: 12px; }
.app-shell footer { margin-left: var(--sidebar); }
@media (min-width: 1600px) {
    :root { --sidebar: 224px; }
    .app-shell main { padding-inline: 32px; }
    .record-grid:not(.compact-list) { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
    .detail-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}
@media (max-width: 1100px) and (min-width: 761px) {
    :root { --sidebar: 172px; }
    .app-shell .site-header { padding-inline: 12px; }
    .search-form { flex-wrap: wrap; }
    .search-form .search-input { flex-basis: 100%; }
    .detail-layout { grid-template-columns: 1fr; }
    .compact-list .record-card { grid-template-columns: minmax(0, 1fr) auto; }
    .compact-list .card-top { grid-column: 1; grid-row: 2; }
    .compact-list .card-bottom { grid-column: 2; grid-row: 1 / 3; }
}
@media (max-width: 760px) {
    html { scroll-padding-top: 84px; scroll-padding-bottom: 210px; }
    .app-shell { padding-bottom: calc(var(--mobile-nav) + env(safe-area-inset-bottom)); }
    .site-header, .app-shell .site-header { position: sticky; top: 0; width: auto; height: auto; min-height: 68px; flex-direction: row; align-items: center; justify-content: space-between; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
    .brand { font-size: 21px; }
    .brand-icon { width: 38px; height: 40px; }
    .brand small { font-size: 11px; }
    .header-tools { padding: 0; margin: 0; border: 0; }
    .account-name { max-width: 96px; font-size: 12px; }
    .app-nav { position: fixed; inset: auto 0 0; z-index: 50; height: calc(var(--mobile-nav) + env(safe-area-inset-bottom)); flex-direction: row; justify-content: space-around; align-items: stretch; gap: 8px; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); margin: 0; background: var(--surface); border-top: 1px solid var(--border); }
    .app-nav a { flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 5px 8px; min-height: 52px; font-size: 12px; }
    .app-nav .icon { width: 22px; height: 22px; }
    main, .app-shell main { margin: 0; padding: 16px; min-height: calc(100dvh - 160px); }
    .has-actions main { padding-bottom: 112px; }
    .page-heading { gap: 10px; margin-bottom: 16px; }
    .page-hint { display: none; }
    .search-form { flex-wrap: wrap; padding: 12px; gap: 8px; }
    .search-form .search-input { flex-basis: 100%; }
    .search-form label { flex: 1; min-width: 100px; }
    .search-form .page-size-field { flex: 0 0 88px; min-width: 88px; }
    .search-form button { padding-inline: 12px; }
    .sort-hint { display: block; margin-left: 0; }
    .view-switch a { padding: 8px; font-size: 13px; }
    .view-switch .icon { width: 18px; height: 18px; }
    .record-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
    .record-card { padding: 14px; }
    .compact-list { grid-template-columns: 1fr; }
    .compact-list .record-card { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 10px 12px; }
    .compact-list .record-card h2 { grid-column: 1; grid-row: 1; }
    .compact-list .card-top { grid-column: 1; grid-row: 2; }
    .compact-list .card-bottom { grid-column: 1 / -1; grid-row: 3; }
    .compact-list .record-card > .tags { display: none; }
    .compact-list .card-edit { min-height: 48px; }
    .tag-recommendations { padding-inline: 12px; }
    .tag-recommendations summary small { font-size: 12px; }
    .form-panel, .detail-panel { padding: 16px; }
    .detail-layout { grid-template-columns: 1fr; gap: 12px; }
    .form-grid, .attachment-list { grid-template-columns: 1fr; gap: 12px; }
    .attachment-detail-grid { grid-template-columns: 1fr; }
    .section-collapse { padding-block: 8px; }
    .record-fields .quick-field { grid-template-columns: 48px minmax(0, 1fr) 48px; padding: 6px; gap: 6px; }
    .field-label { font-size: 13px; }
    .copy-field { flex-wrap: wrap; }
    .copy-field input { flex: 1 1 100px; }
    .action-dock { right: max(12px, env(safe-area-inset-right)); bottom: calc(var(--mobile-nav) + env(safe-area-inset-bottom) + 12px); max-width: calc(100% - 24px); padding: 8px; border-radius: 14px; }
    .action-dock button, .action-dock .button { padding-inline: 12px; font-size: 14px; }
    .menu-panel { left: 0; right: auto; }
    .management-card { padding: 14px; }
    .management-actions { flex-direction: column; }
    .login-panel { padding: 24px; }
    .login-main { justify-content: flex-start; padding-block: 16px; }
    .app-shell footer { margin-left: 0; }
}
@media (max-width: 380px) {
    main, .app-shell main { padding-inline: 12px; }
    .search-form .page-size-field { flex: 1; }
    .search-form button { flex: 1; }
    .tag-recommendations summary { flex-wrap: wrap; gap: 4px 8px; }
    .account-name { display: none; }
    .action-dock button, .action-dock .button { padding-inline: 10px; gap: 5px; }
    .action-dock .icon { width: 18px; height: 18px; }
}
.security-panel { margin-top: 20px; padding: 20px; }
.security-panel > form + form { margin-top: 12px; }
.security-panel h2 .status-tag { display: inline-flex; margin-left: 8px; font-size: 12px; vertical-align: middle; }
.totp-qr { max-width: 260px; margin: 12px auto; background: #fff; }
.totp-qr svg { display: block; width: 100%; height: auto; }
.recovery-box { margin: 16px 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.recovery-box textarea { font-family: ui-monospace, Consolas, monospace; font-size: 16px; line-height: 1.6; margin-bottom: 12px; }
.recovery-box form { margin-top: 12px; }
.security-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.security-checkbox { display: flex; align-items: center; gap: 8px; }
.security-checkbox input { width: 24px; min-height: 24px; flex: 0 0 24px; margin: 0; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
