/* Working layout: 4px spacing scale, readable data, touch-sized mobile controls. */
:root {
  color-scheme: light;
  --ink: #283238;
  --muted: #58656d;
  --blue: #426881;
  --focus: #226596;
  --green: #326448;
  --danger: #854d45;
  --bg: #edf0f1;
  --surface: #f8f9f8;
  --field: #fcfdfb;
  --line: #d6dcde;
  --frame: #aebac0;
  --sidebar-width: 208px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  font: 14px/1.6 "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.4; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.muted, .fine, .hint { color: var(--muted); }
.fine, .hint { font-size: 12px; line-height: 1.7; }
.hint { font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
::selection { background: #cbdde8; color: #172c3b; }
input, textarea { caret-color: var(--blue); }
button, input, textarea, a, summary { outline-offset: 3px; }
button:focus-visible, a:focus-visible, summary:focus-visible, #jobs:focus-visible { outline: 2px solid var(--focus); }
button:disabled { cursor: not-allowed; opacity: .5; }
button:active:not(:disabled) { filter: brightness(.95); }

/* Navigation and a single page heading. */
.topbar { min-height: 64px; padding: 12px 28px; display: flex; align-items: center; gap: 24px; background: #f7f8f7; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.brand:hover, .sidebar-brand:hover { text-decoration: none; }
.brand > span:last-child { display: flex; align-items: center; gap: 12px; }
.brand small { font-size: 13px; font-weight: 400; color: var(--muted); }
.brand-divider { color: #65737b; font-weight: 400; }
.brand-icon, .sidebar-mark { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 6px; }
.brand-icon { color: #f7f8f7; background: #343e45; }
.brand-icon svg, .sidebar-mark svg { width: 20px; height: 20px; }
.public-link { margin-left: auto; font-size: 13px; }
.context-title { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.context-title strong { font-weight: 500; color: var(--ink); }
.is-signed-in .topbar { min-height: 56px; margin-left: var(--sidebar-width); padding: 6px 32px; }
.is-signed-in .topbar > .brand, .is-signed-in .public-link { display: none; }
.account-menu { margin-left: auto; position: relative; z-index: 15; }
.account-menu summary { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 8px; list-style: none; font-size: 13px; color: var(--muted); border-radius: 4px; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { background: #e8edef; color: var(--ink); }
.account-menu svg { width: 18px; height: 18px; }
.account-menu .menu-chevron { width: 14px; height: 14px; }
.account-menu nav { position: absolute; top: calc(100% + 4px); right: 0; min-width: 180px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--frame); border-radius: 6px; background: var(--surface); color: var(--ink); }
.account-menu nav > * { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; text-align: left; font-size: 14px; border-radius: 3px; }
.account-menu nav > *:hover { background: #e8edef; text-decoration: none; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 24px 16px; background: #252f36; color: #d6dee2; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 4px; font-size: 14px; font-weight: 600; color: #f3f5f4; line-height: 1.5; }
.sidebar-brand small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: #a6b4bc; }
.sidebar-mark { border: 1px solid #61727c; }
.sidebar-nav { display: grid; gap: 4px; margin-top: 40px; }
.sidebar-nav a, .sidebar-bottom > a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; font-size: 14px; color: #bdc9d0; border-radius: 4px; }
.sidebar-nav svg, .sidebar-bottom svg { flex-shrink: 0; width: 18px; height: 18px; }
.sidebar-nav a:hover, .sidebar-bottom > a:hover { color: #f3f6f7; background: #303d45; text-decoration: none; }
.sidebar-nav .current { color: #f2f5f6; background: #3b4d59; }
.app-sidebar a:focus-visible { outline-color: #a5c5da; }
.sidebar-bottom { margin-top: auto; padding-top: 32px; }
.sidebar-bottom > a { padding: 10px 4px; font-size: 12px; gap: 8px; }
.sidebar-bottom p { padding: 12px 4px 0; color: #a6b4bc; font-size: 12px; }
main { padding: 28px; }
.is-signed-in main { max-width: 1640px; margin-left: var(--sidebar-width); padding: 28px 32px 40px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading .muted { margin-top: 4px; font-size: 14px; }
.primary, .secondary, .danger-outline, .danger-solid { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid transparent; border-radius: 4px; line-height: 1.5; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.primary:hover { background: #254c68; border-color: #254c68; }
.secondary { color: #36434b; background: var(--field); border-color: #afbbc1; }
.secondary:hover { background: #edf0ef; border-color: #7c8a92; }
.plain { padding: 8px 0; color: var(--muted); background: none; border: 0; font-size: 13px; }
.plain:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.full { width: 100%; }

.download-settings { margin-bottom: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.download-settings summary { min-height: 44px; padding: 11px 2px; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.download-settings summary .muted { margin-inline-start: 12px; font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; }
.download-settings-form { padding: 4px 2px 16px; }
.download-settings-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.download-settings-controls label { width: 136px; min-width: 0; }
.download-settings-controls :is(input,button) { min-height: 44px; }
.download-settings-form .fine { margin-top: 8px; }
.download-settings-form [role="status"]:empty { display: none; }
.download-settings-form [data-error="true"] { color: var(--danger); }

/* Search, status filters and data belong to one working surface. */
.workspace { display: block; min-width: 0; }
.library { background: var(--surface); border: 1px solid var(--frame); border-radius: 6px; }
.library-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.library .library-top { padding: 16px 20px 4px; }
.search { flex: 1; max-width: 400px; }
.search input { margin: 0 !important; }
#refresh { flex-shrink: 0; min-height: 40px; min-width: 44px; }
.tabs { display: flex; gap: 24px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 48px; padding: 8px 0; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 14px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.selected { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.filter-count { font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.table-scroll { width: 100%; }
.project-table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; font-size: 14px; }
.project-table th { padding: 10px 16px; color: var(--muted); background: #eef1f2; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; }
.project-table th:first-child { padding-left: 20px; }
.project-table th.table-category { width: 16%; }
.project-table th.table-version { width: 20%; }
.project-table th:nth-last-child(2) { width: 100px; }
.project-table th:last-child { width: 76px; padding-right: 20px; }
.project-table td { padding: 14px 16px; border-bottom: 1px solid #dfe4e5; vertical-align: middle; overflow-wrap: anywhere; color: #4d5b64; }
.project-table td:first-child { padding-left: 20px; }
.project-table td:last-child { padding-right: 20px; text-align: right; }
.project-table tr:last-child td { border-bottom: 0; }
.project-table .item { cursor: pointer; }
.project-table .item:hover, .project-table .item:focus-within { background: #f0f4f5; }
.project-table .item.active { background: #e7eef1; }
.project-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item-icon { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border: 1px solid #d4dcdf; border-radius: 6px; background: #fafcfb; color: #566c7b; font-size: 18px; }
.item-copy { display: block; min-width: 0; }
.item-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.item-title strong { color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.draft-dot { padding: 0 4px; border: 1px solid #d2c5a9; border-radius: 3px; color: #6f5726; font-size: 11px; line-height: 1.6; white-space: nowrap; }
.item-meta { display: none; }
.mobile-status { display: none; }
.dot, .mobile-status { color: #38604b; font-size: 12px; white-space: nowrap; }
.dot { display: inline-block; padding: 2px 6px; background: #e5eee8; border-radius: 3px; }
.dot.hidden, .mobile-status.hidden { color: #58636b; }
.dot.hidden { background: #e9edef; }
.table-version { font-variant-numeric: tabular-nums; font-size: 13px; }
.edit-item { min-width: 44px; min-height: 40px; margin: -4px -8px -4px 0; padding: 8px; border: 0; border-radius: 3px; color: var(--blue); background: none; font-size: 13px; }
.edit-item:hover { text-decoration: underline; text-underline-offset: 3px; }
.empty { padding: 32px 20px; color: var(--muted); }

/* Activity stays secondary to the software list. */
.history { margin-top: 32px; scroll-margin-top: 24px; }
.history > .library-top { padding-bottom: 12px; }
.history h2 { font-size: 16px; }
#jobs { max-height: 280px; overflow-y: auto; border-top: 1px solid #c6d0d4; scrollbar-width: thin; scrollbar-color: #a6b3ba transparent; }
#jobs > .muted { padding: 20px 0; font-size: 13px; }
.job { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,.7fr); gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.job strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.job small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.job-status { align-self: center; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
.job-status.done { color: var(--green); }
.job-status.failed { color: var(--danger); }
.job-status.queued, .job-status.running { color: var(--blue); }

/* Focused editor: bounded title and actions, one scrolling field area. */
dialog { width: calc(100vw - 32px); max-width: 480px; max-height: calc(100dvh - 32px); overflow: auto; padding: 28px; color: var(--ink); background: var(--surface); border: 1px solid var(--frame); border-radius: 8px; }
dialog::backdrop { background: #202b3466; }
dialog h2 { margin-bottom: 12px; font-size: 20px; }
dialog p { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
dialog .fine { margin-top: 12px; font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
dialog.editor-panel { position: fixed; inset: 0 0 0 auto; width: 720px; max-width: calc(100vw - 48px); height: 100dvh; max-height: 100dvh; min-height: 0; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; box-shadow: -12px 0 40px #17293624; }
.editor-panel::backdrop { background: #1e2b344d; }
.drawer-top { display: flex; align-items: center; justify-content: space-between; height: calc(56px + var(--safe-top)); padding: calc(6px + var(--safe-top)) max(24px,var(--safe-right)) 6px max(24px,var(--safe-left)); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.drawer-close { display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 4px; color: var(--muted); background: none; }
.drawer-close:hover { color: var(--ink); background: #e8edef; }
.drawer-close svg { width: 20px; height: 20px; }
.editor-panel > #editor { height: calc(100% - 56px - var(--safe-top)); }
.editor-panel fieldset { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.editor-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px max(24px,var(--safe-right)) 24px max(24px,var(--safe-left)); scrollbar-width: thin; scrollbar-color: #a6b3ba transparent; }
.editor-panel .editor-empty { display: none; }
.editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.editor-heading > div { min-width: 0; }
.editor-heading h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.editor-heading .muted { margin-top: 4px; font-size: 13px; }
.badge { flex-shrink: 0; padding: 2px 6px; border: 1px solid #c1ccd1; border-radius: 3px; color: #4d626f; background: #eef2f3; font-size: 12px; }
.form-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.section-title { margin-bottom: 16px; }
.section-title p { margin-top: 4px; font-size: 13px; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.span-2 { grid-column: 1 / -1; }
label { display: block; font-size: 14px; font-weight: 500; }
.editor-panel label { margin-top: 0; }
label .hint { margin-left: 4px; }
input:not([type=checkbox]):not([type=file]), textarea { display: block; width: 100%; min-width: 0; min-height: 40px; margin-top: 6px; padding: 8px 12px; border: 1px solid #aeb9be; border-radius: 4px; background: var(--field); color: var(--ink); font-size: 14px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #5e6b73; font-weight: 400; }
input:focus, textarea:focus { border-color: var(--focus); outline: 2px solid #c4d9e6; outline-offset: 1px; }
textarea { min-height: 88px; resize: vertical; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset:disabled label { color: var(--muted); }
.icon-field .hint { display: block; margin: 4px 0 0; }
.editor-panel .icon-field .fine { margin-top: 8px; font-size: 12px; }
.editor-panel .icon-image-preview { width: 44px; height: 44px; border-radius: 5px; background: var(--field); }
.editor-panel .icon-image-preview .item-icon { width: 36px; height: 36px; }
.editor-panel .icon-select { min-height: 40px; padding: 8px 12px; font-size: 13px; }
.editor-panel .icon-controls .plain { min-height: 36px; font-size: 13px; }
.custom-icon-image { object-fit: contain; padding: 3px; }
.download-list { margin-top: 16px; }
.download-list > p { margin-bottom: 8px; }
.download-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.download-row > div { flex: 1; min-width: 0; }
.download-row input { margin-top: 0 !important; }
.editor-panel .download-row input.download-url { font-size: 14px; }
.download-row small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.remove { min-height: 40px; min-width: 44px; padding: 8px 0; border: 0; color: var(--danger); background: none; font-size: 13px; }
.remove:hover { text-decoration: underline; }
.direct-link-actions { margin: 16px 0; }
.direct-link-actions .fine { margin-top: 8px; }
.upload-box { position: relative; display: grid; grid-template-columns: 24px minmax(0,1fr); column-gap: 12px; padding: 16px; margin: 20px 0; border: 1px dashed #9eafb6; border-radius: 4px; background: #eff3f2; overflow: hidden; cursor: pointer; }
.upload-box:hover { background: #e8efef; border-color: #58768a; }
.upload-box:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.upload-symbol { grid-row: 1 / 4; align-self: center; width: 24px; height: 24px; color: #536d7c; }
.upload-box > strong { font-size: 14px; font-weight: 500; }
.upload-box > span { grid-column: 2; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.7; }
.upload-box input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-progress { margin: 12px 0; color: var(--blue); font-size: 13px; }
progress { display: block; width: 100%; height: 8px; margin-bottom: 8px; accent-color: var(--blue); }
.notes { margin-top: 16px !important; }
.visibility { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.visibility strong { font-size: 14px; font-weight: 500; }
.visibility p { margin-top: 4px; font-size: 12px; }
.switch { display: flex; align-items: center; gap: 8px; min-height: 44px; white-space: nowrap; }
.switch input { width: 18px; height: 18px; accent-color: var(--blue); }
.preview-details { color: var(--muted); font-size: 14px; }
.preview-details summary { min-height: 44px; padding: 10px 0; }
.card-preview { max-width: 360px; padding: 12px 0 0; }
.card-preview h3 { margin: 12px 0 6px; }
.card-preview p { font-size: 14px; overflow-wrap: anywhere; }
.card-preview small { display: block; margin-top: 6px; color: var(--muted); }
.preview-button { display: block; margin-top: 8px; padding: 8px 12px; border-radius: 3px; color: #315771; background: #e6eef2; }
.project-delete { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.project-delete strong { font-size: 14px; font-weight: 500; }
.project-delete p { max-width: 64ch; margin-top: 4px; font-size: 12px; }
.danger-outline { border-color: #bd9b94; color: #804b43; background: #f7f0ed; }
.danger-outline:hover { border-color: #93665c; background: #eee0da; }
.danger-solid { border-color: var(--danger); color: #fff; background: var(--danger); }
.danger-solid:hover { border-color: #704038; background: #704038; }
.editor-scroll > .fine { margin-top: 16px; }
.editor-actions { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px max(24px,var(--safe-right)) max(16px,var(--safe-bottom)) max(24px,var(--safe-left)); border-top: 1px solid #c2cdd2; background: #f5f7f6; }
.editor-actions > div { display: flex; gap: 8px; }
.editor-actions > .plain { min-height: 40px; }

/* Authentication and status feedback. */
.login-panel { max-width: 420px; margin: 8vh auto 4vh; padding: 32px; border: 1px solid var(--frame); border-radius: 6px; background: var(--surface); }
.login-content h1 { font-size: 24px; }
.login-content > .muted { margin-top: 8px; font-size: 14px; }
.login-panel form { margin-top: 24px; }
.login-panel label, #password-form label { margin-top: 16px; }
.login-panel .primary { min-height: 44px; margin-top: 24px; }
.login-panel .fine { margin-top: 20px; }
.error { margin-top: 12px; color: var(--danger); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 4px; color: #fff; background: #303b43; font-size: 14px; box-shadow: 0 8px 24px #19252b24; overflow-wrap: anywhere; }
.toast.error-toast { background: #7d4842; }
dialog > .toast { position: static; transform: none; width: auto; max-width: none; margin-top: 16px; box-shadow: none; }
dialog.editor-panel > .toast { position: absolute; top: calc(64px + var(--safe-top)); left: max(16px,var(--safe-left)); right: max(16px,var(--safe-right)); bottom: auto; width: auto; max-width: none; margin: 0; box-shadow: 0 6px 18px #19252b24; }

@media (min-width: 960px) and (max-width: 1199px) {
  :root { --sidebar-width: 192px; }
  .app-sidebar { padding-right: 12px; padding-left: 12px; }
  .sidebar-brand { font-size: 13px; gap: 8px; }
  .sidebar-brand small, .sidebar-bottom p { font-size: 11px; }
  .is-signed-in .topbar { padding-right: 24px; padding-left: 24px; }
  .is-signed-in main { padding-right: 24px; padding-left: 24px; }
}
@media (max-width: 959px) {
  .is-signed-in .topbar { min-height: 60px; margin-left: 0; padding: calc(8px + var(--safe-top)) max(24px,var(--safe-right)) 8px max(24px,var(--safe-left)); background: #252f36; color: #f3f5f4; border-bottom: 0; }
  .is-signed-in .topbar > .brand { display: flex; }
  .is-signed-in .brand small, .is-signed-in .brand-divider, .is-signed-in .context-title { display: none; }
  .is-signed-in .brand-icon { border: 1px solid #61727c; background: transparent; }
  .is-signed-in .account-menu summary { color: #d6dee2; }
  .is-signed-in .account-menu summary:hover, .is-signed-in .account-menu[open] summary { color: #f3f5f4; background: #3b4d59; }
  .is-signed-in .topbar > .brand:focus-visible, .is-signed-in .account-menu > summary:focus-visible { outline-color: #a5c5da; }
  .app-sidebar { position: static; width: auto; padding: 0 max(24px,var(--safe-right)) 0 max(24px,var(--safe-left)); background: #252f36; }
  .sidebar-brand, .sidebar-bottom { display: none; }
  .sidebar-nav { display: flex; gap: 24px; margin: 0; }
  .sidebar-nav a { padding: 8px 0 10px; border-bottom: 2px solid transparent; border-radius: 0; }
  .sidebar-nav .current { background: none; border-bottom-color: #93aebf; }
  .sidebar-nav svg { width: 16px; height: 16px; }
  .is-signed-in main { margin-left: 0; padding: 24px max(24px,var(--safe-right)) 24px max(24px,var(--safe-left)); }
  .project-table th.table-category { width: 17%; }
  .project-table th.table-version { width: 19%; }
}
@media (max-width: 639px) {
  html { scroll-padding-top: 16px; }
  .topbar { min-height: 60px; padding: 8px 16px; gap: 12px; }
  .brand { gap: 8px; font-size: 14px; }
  .brand > span:last-child { gap: 8px; }
  .brand small { font-size: 12px; }
  .brand-divider { display: none; }
  .public-link { font-size: 12px; }
  .is-signed-in .topbar { min-height: 60px; padding: calc(8px + var(--safe-top)) max(16px,var(--safe-right)) 8px max(16px,var(--safe-left)); }
  .account-menu summary { padding: 8px 4px; font-size: 12px; }
  .account-menu .menu-chevron { display: none; }
  .app-sidebar { padding: 0 max(16px,var(--safe-right)) 0 max(16px,var(--safe-left)); }
  .sidebar-nav { gap: 24px; }
  .sidebar-nav a { gap: 8px; font-size: 13px; }
  .is-signed-in main { padding: 20px max(16px,var(--safe-right)) 32px max(16px,var(--safe-left)); }
  .page-heading { gap: 16px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 22px; }
  .page-heading .muted { display: none; }
  .page-heading .primary { min-height: 44px; padding: 8px 12px; }
  .library { margin: 0 -16px; border-right: 0; border-left: 0; border-radius: 0; }
  .library .library-top { gap: 12px; padding: 16px 16px 0; }
  .search { max-width: none; }
  #refresh { min-height: 44px; font-size: 14px; }
  .tabs { justify-content: space-between; gap: 8px; padding: 4px 16px 0; }
  .tabs button { min-height: 48px; gap: 4px; padding: 8px 0; font-size: 13px; }
  .filter-count { font-size: 12px; }
  .project-table { display: block; }
  .project-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  #item-list { display: block; }
  .project-table .item { display: grid; grid-template-columns: minmax(0,1fr) 44px; align-items: center; gap: 12px; min-height: 88px; padding: 16px; border-bottom: 1px solid #dfe4e5; }
  .project-table .item:last-child { border-bottom: 0; }
  .project-table td, .project-table td:first-child, .project-table td:last-child { padding: 0; border: 0; }
  .project-table .table-category, .project-table .table-version, .project-table .table-status { display: none; }
  .project-cell { gap: 12px; align-items: flex-start; }
  .project-cell .item-icon { width: 36px; height: 36px; margin-top: 2px; }
  .item-title { gap: 4px 8px; }
  .item-title strong { font-size: 15px; line-height: 1.6; }
  .item-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; }
  .item-meta small { color: var(--muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
  .mobile-status { display: inline; font-size: 12px; }
  .edit-item { min-width: 44px; min-height: 44px; margin: 0; padding: 8px 4px; font-size: 14px; }
  .empty { padding: 28px 16px; }
  .history { margin-top: 28px; }
  .history > .library-top { align-items: flex-start; flex-direction: column; gap: 4px; }
  #jobs { max-height: 320px; }
  .job { grid-template-columns: 1fr; gap: 6px; padding: 16px 0; font-size: 14px; }
  .job-status { text-align: left; font-size: 13px; }
  main { padding: 20px 16px; }
  .login-panel { margin: 5vh auto; padding: 24px; }
  .login-content h1 { font-size: 22px; }
  dialog { padding: 24px; }
  .dialog-actions { gap: 8px; }
  .dialog-actions > button { min-height: 44px; padding: 8px 12px; }
  dialog.editor-panel { width: 100%; max-width: none; height: 100dvh; border-radius: 0; }
  .drawer-top { height: calc(60px + var(--safe-top)); padding: calc(8px + var(--safe-top)) max(16px,var(--safe-right)) 8px max(16px,var(--safe-left)); }
  .editor-panel > #editor { height: calc(100% - 60px - var(--safe-top)); }
  .editor-scroll { padding: 20px max(16px,var(--safe-right)) 24px max(16px,var(--safe-left)); }
  .editor-heading { gap: 12px; }
  .editor-heading h2 { font-size: 20px; }
  .editor-heading .muted { font-size: 13px; }
  .badge { font-size: 11px; padding: 2px 4px; }
  .form-section { margin-top: 24px; padding-top: 20px; }
  .section-title { margin-bottom: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .span-2 { grid-column: auto; }
  input:not([type=checkbox]):not([type=file]), textarea { min-height: 44px; font-size: 16px; }
  textarea { min-height: 96px; }
  .editor-panel .download-row input.download-url { font-size: 16px; }
  .primary, .secondary, .danger-outline, .danger-solid, .remove { min-height: 44px; }
  .editor-panel .icon-select { min-height: 44px; font-size: 14px; }
  .editor-panel .icon-controls .plain { min-height: 44px; font-size: 14px; }
  .visibility { align-items: flex-start; gap: 16px; }
  .visibility p, .project-delete p, .section-title p { font-size: 13px; }
  .project-delete { flex-direction: column; align-items: flex-start; gap: 12px; }
  .editor-actions { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px; padding: 12px max(16px,var(--safe-right)) max(12px,var(--safe-bottom)) max(16px,var(--safe-left)); }
  .editor-actions > .plain { min-height: 44px; font-size: 13px; }
  .editor-actions > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .editor-actions > div button { min-width: 0; padding: 8px; font-size: 13px; }
  dialog.editor-panel > .toast { top: calc(68px + var(--safe-top)); }
  .toast { bottom: max(16px,var(--safe-bottom)); }
}
@media (max-width: 359px) {
  .brand { font-size: 13px; }
  .brand small { display: none; }
  .project-table .item { column-gap: 8px; }
  .project-cell { gap: 8px; }
  .project-cell .item-icon { width: 32px; height: 32px; }
  .item-title strong { font-size: 14px; }
  .editor-actions { gap: 8px; }
  .editor-actions > div { gap: 6px; }
  .editor-actions > div button { padding: 8px 6px; }
}
@media (pointer: coarse) {
  .primary, .secondary, .danger-outline, .danger-solid, .edit-item, .remove, .plain { min-height: 44px; }
  .editor-panel .icon-select, .editor-panel .icon-controls .plain, .editor-actions > .plain { min-height: 44px; }
  input:not([type=checkbox]):not([type=file]), textarea, .editor-panel .download-row input.download-url { min-height: 44px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
