:root { color-scheme: light dark; --mobile-space: 16px; --mobile-panel: var(--view-panel-bg, var(--card-bg)); --mobile-border: var(--view-panel-border, rgba(var(--neutral-rgb),.24)); --mobile-muted: var(--view-secondary-text, var(--muted)); --mobile-radius: var(--view-panel-radius, 18px); --mobile-control-radius: var(--view-control-radius, 12px); }
* { box-sizing: border-box; }
[hidden] { display: none!important; }
html { min-height: 100%; background: var(--bg); -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { min-height: 100dvh; margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--font-sans, system-ui, sans-serif); }
button, input, select { font: inherit; }
button, a, [role="button"] { touch-action: manipulation; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
.visually-hidden { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-150%); padding: 10px 14px; border-radius: var(--mobile-control-radius); background: var(--surface-strong); color: var(--text); }
.skip-link:focus { transform: none; }
.mobile-topbar { position: sticky; z-index: 5; top: 0; display: flex; flex-direction: row; align-items: center; justify-content: space-between; min-height: 58px; margin: 0; padding: calc(8px + env(safe-area-inset-top,0px)) max(var(--mobile-space),env(safe-area-inset-right,0px)) 8px max(var(--mobile-space),env(safe-area-inset-left,0px)); border: 0; border-bottom: 1px solid color-mix(in srgb, var(--mobile-border) 65%, transparent); background: var(--bg); animation: none; }
.mobile-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 650; letter-spacing: -.015em; }
.mobile-brand-mark { display: block; width: 28px; height: 28px; border: 1px solid color-mix(in srgb,var(--accent-primary) 45%,var(--mobile-border)); border-radius: 8px; object-fit: cover; }
.mobile-menu-button { display: inline-grid; place-items: center; flex: none; width: 44px; min-width: 44px; min-height: 44px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--text); font: inherit; font-size: 20px; cursor: pointer; }
.icon-button { display: inline-grid; place-items: center; flex: none; min-width: 44px; min-height: 44px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--mobile-muted); font-size: 20px; cursor: pointer; }
.icon-button:active, .mobile-menu-button:active, .text-button:active, .action-button:active, .primary-button:active, .secondary-button:active { transform: scale(.96); }
.app-main { width: min(100%, 760px); min-height: calc(100dvh - 58px); margin-inline: auto; padding: 22px max(var(--mobile-space),env(safe-area-inset-right,0px)) calc(36px + env(safe-area-inset-bottom,0px)) max(var(--mobile-space),env(safe-area-inset-left,0px)); }
.collection-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.eyebrow { margin: 0 0 2px; color: var(--mobile-muted); font-size: 12px; letter-spacing: .045em; }
h1, h2, h3, p { text-wrap: pretty; }
h1 { margin: 0; font: 500 clamp(25px,7vw,34px)/1.1 var(--font-serif, Georgia,serif); letter-spacing: -.025em; text-wrap: balance; }
h2 { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 620; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 14px; border: 1px solid color-mix(in srgb,var(--accent-primary) 50%,var(--mobile-border)); border-radius: var(--mobile-control-radius); background: color-mix(in srgb,var(--accent-primary) 14%,var(--surface-strong)); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform 120ms ease-out, background-color 140ms ease-out; }
.primary-button { white-space: nowrap; }
.phone-guide-dialog { max-width: 520px; margin-inline: auto; }
.phone-guide-dialog h2:focus { outline: none; }
.phone-guide-progress { display: grid; gap: 14px; list-style: none; padding: 12px 0 18px; margin: 0; border-bottom: 1px solid var(--mobile-border); }
.phone-guide-progress li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.phone-guide-mark { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border: 1px solid var(--mobile-border); border-radius: 50%; font-size: 12px; color: var(--mobile-muted); }
.phone-guide-progress .is-complete .phone-guide-mark { color: var(--accent-success); border-color: var(--accent-success); }
.phone-guide-instructions { display: grid; gap: 14px; padding-block: 12px; }
.phone-guide-platform { display: flex; flex-wrap: wrap; gap: 8px; }
.phone-guide-platform [aria-pressed="true"] { border-color: var(--accent-primary); }
.phone-guide-dialog .primary-button { white-space: normal; }
.primary-button > span { font-size: 18px; line-height: 1; }
.secondary-button { border-color: var(--mobile-border); background: var(--surface-strong); }
.danger-button { border-color: color-mix(in srgb,var(--accent-danger) 65%,var(--mobile-border)); background: color-mix(in srgb,var(--accent-danger) 16%,var(--surface-strong)); }
.search-box { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 10px 0 14px; border: 1px solid var(--mobile-border); border-radius: var(--mobile-control-radius); background: var(--surface-strong); color: var(--mobile-muted); }
.search-box:focus-within { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
.search-icon { font-size: 22px; line-height: 1; }
.search-box input { min-width: 0; width: 100%; min-height: 48px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.search-box input::placeholder { color: var(--mobile-muted); opacity: 1; }
.clear-search { width: 44px; min-width: 44px; height: 44px; border: 0; border-radius: 50%; background: color-mix(in srgb,var(--mobile-muted) 16%,transparent); color: var(--text); font-size: 20px; cursor: pointer; }
.collection-tools { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-top: 4px; }
.collection-count { color: var(--mobile-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.text-button { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--accent-primary); font-size: 14px; font-weight: 600; cursor: pointer; }
.collection { display: grid; gap: 12px; }
.app-main { touch-action: pan-y pinch-zoom; }
.collection-position { display: flex; justify-content: center; gap: 6px; margin-block: 14px 0; }
.collection-position span { width: 5px; height: 5px; border-radius: 50%; background: var(--mobile-muted); opacity: .35; }
.collection-position .is-current { width: 16px; border-radius: 4px; background: var(--accent-primary); opacity: 1; }
.collection > .link-list { padding: 0; }
.collection > .link-list > .link-row { content-visibility: auto; contain-intrinsic-size: auto 76px; }
.mobile-storage-warning { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-block-end: 20px; padding: 14px; border: 1px solid color-mix(in srgb,var(--accent-danger) 65%,var(--mobile-border)); border-radius: var(--mobile-control-radius); background: color-mix(in srgb,var(--accent-danger) 12%,var(--mobile-panel)); }
.mobile-storage-warning p { flex: 1 1 180px; margin: 0; font-size: 14px; }
.mobile-storage-details { margin-block-start: 24px; }
.mobile-storage-details summary { display: list-item; min-height: 44px; padding-block: 10px; cursor: pointer; font-weight: 600; }
.mobile-storage-details summary:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
.mobile-storage-content { display: grid; gap: 12px; padding-block-start: 8px; }
.mobile-storage-content .settings-note { margin: 0; overflow-wrap: anywhere; }
.storage-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.storage-actions button { flex: 1 1 160px; }
.folder-card, .inbox-card { min-width: 0; overflow: clip; border: 1px solid var(--mobile-border); border-radius: var(--mobile-radius); background: var(--mobile-panel); box-shadow: var(--view-panel-shadow, 0 8px 24px var(--shadow)); }
.folder-card { border-inline-start: 3px solid var(--folder-accent, var(--accent-primary)); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; padding: 8px 12px 8px 15px; }
.section-title-heading { display: flex; align-items: center; min-width: 0; margin: 0; font-size: 15px; line-height: 1.3; font-weight: 650; }
.section-title-button { display: flex; align-items: center; min-width: 0; min-height: 42px; padding: 3px 0; border: 0; background: transparent; text-align: start; cursor: pointer; }
.disclosure-icon { flex: none; width: 18px; color: var(--mobile-muted); font-size: 17px; line-height: 1; }
.folder-dot { flex: none; width: 9px; height: 9px; margin-inline-end: 10px; border-radius: 50%; background: var(--accent-primary); box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent-primary) 15%,transparent); }
.section-title { min-width: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 650; }
.section-count { margin-inline-start: 8px; color: var(--mobile-muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.folder-lock { flex: none; margin-inline-start: 8px; padding: 2px 7px; border: 1px solid var(--mobile-border); border-radius: 99px; color: var(--mobile-muted); font-size: 11px; line-height: 1.4; }
.section-actions { display: flex; align-items: center; gap: 2px; }
.mini-button { display: inline-grid; place-items: center; width: 44px; min-width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--mobile-muted); font-size: 18px; cursor: pointer; }
.mini-button[aria-pressed="true"] { color: var(--accent-primary); }
.link-list { display: grid; padding: 0 9px 10px; }
.link-more { justify-content: center; width: 100%; margin-block-start: 6px; white-space: normal; overflow-wrap: anywhere; }
.link-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 5px; min-width: 0; min-height: 56px; padding: 5px 4px 5px 9px; border-top: 1px solid color-mix(in srgb,var(--mobile-border) 68%,transparent); }
.link-open { display: block; min-width: 0; padding: 7px 4px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: start; text-decoration: none; cursor: pointer; }
.link-title { display: block; overflow-wrap: anywhere; font-size: 14px; line-height: 1.4; font-weight: 520; }
.link-host { display: block; margin-top: 2px; color: var(--mobile-muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.row-menu { width: 44px; min-width: 44px; height: 44px; }
.empty-state { padding: 22px 18px; border: 1px dashed var(--mobile-border); border-radius: var(--mobile-radius); text-align: center; }
.empty-state h2 { font: 500 20px/1.25 var(--font-serif,Georgia,serif); }
.empty-state p { max-width: 34rem; margin: 8px auto 14px; color: var(--mobile-muted); font-size: 14px; }
.app-error { margin: 14px 0 0; padding: 12px 14px; border-inline-start: 3px solid var(--accent-danger); border-radius: 9px; background: color-mix(in srgb,var(--accent-danger) 12%,var(--mobile-panel)); color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.sheet-dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: min(90dvh, 860px); margin: 0; padding: 0; overflow: auto; border: 1px solid var(--mobile-border); border-bottom: 0; border-radius: 22px 22px 0 0; background: var(--mobile-panel); color: var(--text); box-shadow: 0 -16px 50px var(--shadow); overscroll-behavior: contain; }
.sheet-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(var(--neutral-rgb),.28); backdrop-filter: blur(3px); }
.sheet-panel { display: flex; flex-direction: column; gap: 10px; min-height: min-content; padding: 9px max(18px,env(safe-area-inset-right,0px)) calc(18px + env(safe-area-inset-bottom,0px)) max(18px,env(safe-area-inset-left,0px)); }
.large-sheet { min-height: 50dvh; max-height: min(88dvh,820px); }
.sheet-handle { align-self: center; width: 38px; height: 4px; margin: 0 0 3px; border-radius: 99px; background: color-mix(in srgb,var(--mobile-muted) 42%,transparent); }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; margin-bottom: 2px; }
.close-button { margin-inline-end: -7px; font-size: 25px; }
.menu-list, .action-list, .secondary-list { display: grid; gap: 6px; }
.menu-list button, .action-button, .secondary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; min-height: 52px; padding: 8px 12px; border: 1px solid var(--mobile-border); border-radius: var(--mobile-control-radius); background: var(--surface-strong); color: var(--text); text-align: start; font-size: 15px; cursor: pointer; }
.menu-list button { width: 100%; }
.action-button:disabled { opacity: .46; cursor: not-allowed; }
.action-button.danger-action { color: var(--view-danger-text,var(--accent-danger)); }
.action-button .action-detail { min-width: 0; }
.action-button small, .secondary-row small { display: block; margin-top: 2px; color: var(--mobile-muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.field-label { display: block; margin: 4px 0 -5px; color: var(--mobile-muted); font-size: 13px; font-weight: 600; }
.sheet-panel > input:not([type="checkbox"]), .sheet-panel > select, .confirm-panel input { width: 100%; min-height: 48px; padding: 9px 12px; border: 1px solid var(--mobile-border); border-radius: var(--mobile-control-radius); background: var(--surface-strong); color: var(--text); font-size: 16px; }
.sheet-panel input::placeholder { color: var(--mobile-muted); }
.share-review-notice { padding: 10px 12px; border-inline-start: 3px solid var(--accent-primary); border-radius: 8px; background: color-mix(in srgb,var(--accent-primary) 13%,var(--mobile-panel)); color: var(--text); font-size: 14px; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.field-error { margin: 0; color: var(--view-danger-text,var(--accent-danger)); font-size: 13px; }
.color-field { margin: 2px 0 0; padding: 0; border: 0; }
.color-options { display: flex; flex-wrap: wrap; gap: 10px; padding: 5px 0 2px; }
.color-option { width: 44px; height: 44px; border: 2px solid var(--mobile-border); border-radius: 50%; background: var(--swatch); cursor: pointer; }
.color-option[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding: 7px 0; border-bottom: 1px solid color-mix(in srgb,var(--mobile-border) 70%,transparent); }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { font-size: 14px; }
.setting-row small, .settings-note { color: var(--mobile-muted); font-size: 13px; line-height: 1.5; }
.settings-note { margin: 2px 0 7px; }
.phone-guide-shortcut { margin-block-start: 16px; color: var(--mobile-muted); font-size: 13px; line-height: 1.5; }
.phone-guide-shortcut summary { min-height: 44px; padding-block: 12px; color: var(--text); cursor: pointer; }
.phone-guide-shortcut ol { margin-block: 10px 14px; padding-inline-start: 22px; }
.phone-guide-shortcut li + li { margin-block-start: 8px; }
.phone-guide-shortcut-address { display: block; margin-block: 12px; color: var(--text); overflow-wrap: anywhere; user-select: text; }
.setting-row input { width: 24px; height: 24px; accent-color: var(--accent-primary); }
.mobile-sync-entry { width: 100%; justify-content: space-between; margin-top: 6px; }
.action-summary { padding: 7px 0 10px; overflow-wrap: anywhere; }
.secondary-row { align-items: flex-start; cursor: default; }
.secondary-row > div { min-width: 0; }
.secondary-row button { flex: none; min-height: 44px; padding: 6px 10px; border: 1px solid var(--mobile-border); border-radius: 10px; background: var(--view-control-bg,var(--surface-strong)); color: var(--text); cursor: pointer; }
.confirm-dialog { position: fixed; inset: 0; width: min(calc(100% - 32px), 440px); margin: auto; padding: 0; border: 1px solid var(--mobile-border); border-radius: var(--mobile-radius); background: var(--mobile-panel); color: var(--text); box-shadow: 0 20px 60px var(--shadow); }
.confirm-panel { padding: 21px; }
.confirm-panel h2 { font-size: 18px; }
.confirm-panel p { margin: 10px 0; color: var(--mobile-muted); font-size: 14px; overflow-wrap: anywhere; }
.mobile-toast-host { position: fixed; z-index: 30; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom,0px)); display: flex; justify-content: center; pointer-events: none; }
.mobile-toast { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; width: max-content; max-width: 100%; min-height: 54px; padding: 8px 10px 8px 14px; border: 1px solid color-mix(in srgb,var(--accent-success) 60%,var(--mobile-border)); border-radius: 16px; background: color-mix(in srgb,var(--accent-success) 23%,var(--mobile-panel)); box-shadow: 0 10px 32px var(--shadow); color: var(--text); pointer-events: auto; opacity: 1; visibility: visible; }
.mobile-toast-message { min-width: 0; font-size: 14px; font-weight: 560; overflow-wrap: anywhere; }
.mobile-toast-undo { flex: none; min-width: 70px; min-height: 44px; padding: 7px 11px; border: 1px solid color-mix(in srgb,var(--accent-success) 60%,var(--mobile-border)); border-radius: 11px; background: color-mix(in srgb,var(--accent-success) 28%,var(--surface-strong)); color: var(--text); font-size: 14px; font-weight: 650; cursor: pointer; opacity: 1; visibility: visible; }
.mobile-toast-dismiss { display: inline-grid; flex: none; place-items: center; width: 44px; min-width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--mobile-muted); font-size: 22px; cursor: pointer; }
.mobile-toast-time { min-width: 10px; color: var(--mobile-muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.mobile-toast-progress { position: absolute; inset-inline: 10px; bottom: 2px; height: 3px; border-radius: 99px; background: var(--accent-success); transform: scaleX(1); transform-origin: left center; animation: mobile-toast-countdown 5600ms linear forwards; pointer-events: none; }
.mobile-toast-progress.is-paused { animation-play-state: paused; }
@keyframes mobile-toast-countdown { to { transform: scaleX(0); } }
html[dir="rtl"] .mobile-toast-progress { transform-origin: right center; }
html[data-theme$="glass"] .mobile-topbar { background: color-mix(in srgb,var(--bg) 82%,transparent); backdrop-filter: blur(var(--glass-blur,18px)) saturate(var(--glass-saturation,150%)); }
html[data-theme$="glass"] :is(.folder-card,.inbox-card,.sheet-dialog,.confirm-dialog,.mobile-toast) { backdrop-filter: blur(var(--glass-blur,18px)) saturate(var(--glass-saturation,150%)); }
html[data-theme$="glass"] .mobile-toast { background: color-mix(in srgb,var(--accent-success) 23%,var(--view-panel-bg)); }
:is(html[data-theme="papersoft"],html[data-theme="lattesoft"]) :is(.folder-card,.inbox-card,.sheet-dialog,.confirm-dialog,.search-box,.menu-list button,.action-button) { box-shadow: inset -2px -2px 5px var(--neu-light), inset 2px 2px 5px var(--neu-dark); }
/* Match desktop Soft folders: color lives in the dot, the material has no stripe. */
:is(html[data-theme="papersoft"],html[data-theme="lattesoft"]) .folder-card { border-color: transparent; background: var(--bg); box-shadow: -4px -4px 9px var(--neu-light), 4px 4px 10px var(--neu-dark); }
:is(html[data-theme="spaceblack"],html[data-theme="pacificblue"],html[data-theme="orchidbloom"]) :is(.folder-card,.inbox-card,.sheet-dialog,.confirm-dialog) { background: var(--view-panel-bg,var(--card-bg)); box-shadow: var(--view-panel-shadow,0 12px 32px var(--shadow)); }
@media (hover:hover) and (pointer:fine) {
  .mobile-menu-button:hover, .mini-button:hover, .text-button:hover, .mobile-toast-dismiss:hover { background: var(--surface-strong-hover); color: var(--text); }
  .link-open:hover { background: color-mix(in srgb,var(--accent-primary) 8%,transparent); }
  .menu-list button:hover, .action-button:hover, .secondary-row button:hover { background: var(--surface-strong-hover); }
  .primary-button:hover { background: color-mix(in srgb,var(--accent-primary) 22%,var(--surface-strong)); }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior: auto!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; } .mobile-toast-progress { animation: none!important; transform: scaleX(1)!important; } }
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { scroll-behavior: auto!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; }
html[data-motion="reduced"] .mobile-toast-progress { animation: none!important; transform: scaleX(1)!important; }
@media (prefers-reduced-transparency:reduce),(prefers-contrast:more) { html[data-theme$="glass"] :is(.mobile-topbar,.folder-card,.inbox-card,.sheet-dialog,.confirm-dialog,.mobile-toast) { backdrop-filter: none; background: var(--surface-strong); } }
@media (max-width:360px) { :root { --mobile-space: 12px; } .collection-heading { align-items: start; } .primary-button { padding-inline: 10px; } .section-heading { padding-inline: 10px; } .section-count { margin-inline-start: 5px; } }
@media (max-width:360px) { .mobile-sync-counts { grid-template-columns: 1fr; } .mobile-sync-code { font-size: 18px; letter-spacing: .08em; } }
@media (orientation:landscape) and (max-height:480px) { .app-main { padding-top: 12px; } .collection-heading { margin-bottom: 12px; } .sheet-dialog { max-height: 96dvh; } .large-sheet { max-height: 94dvh; } }
