/* Reading, capture and recovery share the existing paper-and-ink palette. */
.library-workspace {--library-ink:#494038;--library-muted:#817163;--library-line:#dfd2c1;}
[data-theme=hirono] .hero + .content .library-workspace .notes-heading {display:flex;align-items:center;gap:12px;margin:12px 0 21px;}
.library-workspace .notes-heading h2 {margin:0;font-size:24px;}
.library-heading-copy {margin:6px 0 0;color:var(--library-muted);font-size:12px;line-height:1.7;}
.library-workspace .notes-heading>.micro {margin-left:auto;text-align:right;}
[data-theme=hirono] .hero + .content .library-workspace .library-toolbar {display:flex;gap:9px;align-items:center;padding:13px;background:#faf6ef;border-radius:12px;border:1px solid var(--library-line);}
.library-search-wrap {display:flex;align-items:center;gap:8px;flex:1;min-width:0;border:1px solid #dfcebb;border-radius:8px;background:#fffdf9;padding-left:12px;}
.library-search-wrap>.icon {color:#a38b74;flex:none;width:17px;height:17px;}
[data-theme=hirono] .hero + .content .library-workspace #library-search {flex:1;min-width:0;width:0;background:transparent;border:0;box-shadow:none;margin:0;min-height:44px;padding:10px 12px 10px 0;}
.library-search-wrap:focus-within {outline:2px solid #9c7b57;outline-offset:2px;}
[data-theme=hirono] .hero + .content .library-workspace #library-search:focus {outline:none;}
.library-browse-controls {display:flex;align-items:center;justify-content:space-between;gap:16px;margin:18px 0 8px;}
.library-tags {display:flex;gap:6px;flex:1;min-width:0;overflow-x:auto;padding:4px 3px 8px;scrollbar-width:thin;scrollbar-color:#d0bfa8 transparent;}
.library-tags button {display:flex;align-items:center;gap:7px;flex:none;min-height:36px;max-width:220px;border:1px solid #e2d7c7;border-radius:7px;background:#f5eee3;color:#7d6957;padding:7px 11px;font-size:12px;white-space:nowrap;}
.library-tags button span {font:10px/1.5 var(--mono);background:#e8ddcc;padding:1px 5px;border-radius:4px;}
.library-tags button.active {background:#67584b;border-color:#67584b;color:#fffaf1;}
.library-tags button.active span {background:#ffffff20;color:#fffaf1;}
.library-view-controls {display:flex;gap:12px;align-items:center;flex:none;}
.library-view-controls>label {display:flex;gap:7px;align-items:center;color:#7d6e60;font-size:11px;}
.library-view-controls select {min-height:38px;border:1px solid #dfd2c0;border-radius:7px;padding:7px 9px;background:#fffdf7;font:inherit;color:#6d5e50;}
.library-view-controls .view-switch {display:flex;border:1px solid #dfd2c0;background:#ece4d8;border-radius:7px;padding:3px;gap:3px;}
.library-view-controls .icon-btn {width:34px;height:34px;border-radius:5px;}
.library-view-controls .icon-btn.active {background:#fffdf7;box-shadow:0 1px 3px #65503a20;color:#76583e;}
.library-result-bar {display:flex;align-items:center;flex-wrap:wrap;gap:10px;min-height:42px;margin-bottom:12px;color:#897666;font-size:11px;}
.library-result-bar .filter-summary {margin:0;padding:0;display:flex;align-items:center;gap:10px;min-height:36px;}
.library-result-scope {margin-left:auto;overflow-wrap:anywhere;}
[data-theme=hirono] .hero + .content .library-workspace .note-grid {gap:18px;}
[data-theme=hirono] .hero + .content .library-workspace .library-note {display:flex;flex-direction:column;min-height:258px;padding:20px 22px 14px;border-top-width:2px;}
[data-theme=hirono] .hero + .content .library-workspace .library-note::after {width:50px;height:62px;bottom:74px;right:18px;opacity:.9;}
.library-note-top {gap:8px;justify-content:space-between;}
.library-reading-badge {display:inline-flex;gap:4px;align-items:center;color:#7e8167;font-size:10px;white-space:nowrap;}
.library-reading-badge .icon {width:12px;height:12px;}
[data-theme=hirono] .hero + .content .library-workspace .library-note h3 {margin:14px 0 10px;}
[data-theme=hirono] .hero + .content .library-workspace .library-note h3 .task-title {font-size:16px;line-height:1.65;}
[data-theme=hirono] .hero + .content .library-workspace .library-note>p {max-width:none;width:100%;padding-right:56px;min-height:72px;margin:0 0 15px;font-size:12px;line-height:1.9;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;overflow-wrap:anywhere;}
[data-theme=hirono] .hero + .content .library-workspace .library-note-foot {display:flex;align-items:center;gap:8px;margin-top:auto;padding-top:11px;font-size:10px;}
.library-note-actions {display:flex;align-items:center;gap:7px;margin-left:auto;flex:none;}
.library-read-link {min-height:36px;font-size:11px;color:#8c6445;padding:6px 4px;}
.library-read-link:hover {text-decoration:underline;text-underline-offset:3px;}
.library-load-more {display:flex;align-items:center;justify-content:center;gap:16px;margin:26px 0 16px;color:#8b7968;font-size:12px;}
.library-load-more .soft-button {min-height:42px;border:1px solid #cfbda4;background:#f9f1e4;color:#705b43;border-radius:8px;padding:8px 16px;}
[data-theme=hirono] .hero + .content .library-workspace .note-list-view {grid-template-columns:minmax(0,1fr);gap:10px;}
[data-theme=hirono] .hero + .content .library-workspace .note-list-view .library-note {display:grid;grid-template-columns:minmax(0,1fr) 190px;column-gap:24px;min-height:0;padding:16px 22px;}
[data-theme=hirono] .hero + .content .library-workspace .note-list-view .library-note::after {display:none;}
.note-list-view .library-note-top {justify-content:flex-start;grid-column:1;}
[data-theme=hirono] .hero + .content .library-workspace .note-list-view .library-note h3 {grid-column:1;margin:8px 0 5px;}
[data-theme=hirono] .hero + .content .library-workspace .note-list-view .library-note>p {grid-column:1;min-height:0;padding:0;margin:0;-webkit-line-clamp:2;}
[data-theme=hirono] .hero + .content .library-workspace .note-list-view .library-note-foot {grid-column:2;grid-row:1/4;align-self:center;margin:0;border:0;padding:0;flex-direction:column;align-items:flex-end;gap:10px;}
.note-list-view .library-note-actions {margin:0;}
.side-pane .quick-composer {border:1px solid #d9c8b3;border-radius:10px;background:#fffcf7;box-shadow:0 3px 0 #e6ddcf;overflow:hidden;}
.side-pane .quick-composer textarea {background:transparent;min-height:138px;line-height:1.9;padding:14px;}
.side-pane .composer-toolbar {padding:9px 10px;gap:7px;border-top:1px dashed #e2d4c0;flex-wrap:wrap;}
#quick-draft-status {font-size:10px;color:#89715c;}
.quick-save-error {margin:10px 0;padding:11px 12px;border:1px solid #dfbba6;background:#fbede3;color:#945b40;border-radius:7px;font-size:12px;line-height:1.7;}
.quick-note-title {margin:8px 0;font-size:13px;line-height:1.7;}
.quick-note-title button {display:block;width:100%;text-align:left;overflow-wrap:anywhere;padding:3px 0;font:inherit;color:#5c483a;}
.side-pane .quick-note-content {line-height:1.85;color:#85705f;font-size:12px;white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden;}
.side-pane .quick-note-head .icon-btn {width:32px;height:32px;color:#93775d;border:1px solid #dfd0bd;border-radius:6px;background:#fff9f0;}
.side-tag-filter {display:flex;align-items:center;gap:10px;font-size:12px;margin:8px 0;color:#7b6553;}
.side-tag-filter select {flex:1;min-width:0;max-width:100%;min-height:38px;border:1px solid #d7c5af;background:#fffaf2;color:#745f4d;border-radius:6px;padding:7px 9px;}
.side-library-link {padding:18px 0;text-align:center;}
.side-library-link button {min-height:42px;padding:9px 15px;border:1px solid #d3bfa5;border-radius:7px;color:#806244;background:#f6ecdd;}
#dialog:has(.settings-workspace),#dialog:has(.restore-overview) {width:min(690px,calc(100vw - 32px));}
.settings-workspace {color:#5e4c3e;}
.settings-section {padding:18px 0;border-bottom:1px solid #e5d9c9;}
.settings-section:first-child {padding-top:0;}
.settings-section-heading {display:flex;align-items:center;justify-content:space-between;gap:15px;}
.settings-eyebrow {display:block;font:9px/1.5 var(--mono);letter-spacing:2px;color:#a08060;}
.settings-section h3 {margin:5px 0 0;font-size:18px;font-weight:600;line-height:1.5;}
.settings-section>p {font-size:12px;line-height:1.8;color:#897463;margin:12px 0;}
.settings-section-heading .soft-button {min-height:40px;flex:none;}
.settings-record-counts {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));margin:15px 0 0;padding:13px 5px;background:#f0e8dc;border:1px solid #dfcfb9;border-radius:10px;text-align:center;}
.settings-record-counts div+div {border-left:1px solid #ddcdb8;}
.settings-record-counts dt {font-size:11px;color:#8d745d;}
.settings-record-counts dd {margin:6px 0 0;font:23px/1.3 Georgia,serif;color:#796049;overflow-wrap:anywhere;}
.settings-toggle-row {display:flex;justify-content:space-between;align-items:center;gap:18px;padding:14px 0 2px;}
.settings-toggle-row strong {display:block;font-weight:500;font-size:13px;}
.settings-toggle-row small {display:block;color:#937d69;font-size:11px;margin-top:5px;line-height:1.6;}
.settings-toggle-row input {width:19px;height:19px;accent-color:#8c6a4c;flex:none;}
.settings-backup-actions {display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.settings-data-card {display:flex;align-items:center;gap:12px;text-align:left;padding:15px;border:1px solid #d7c1a4;border-radius:9px;background:#f7efdf;min-width:0;}
.settings-data-card:hover {border-color:#ab8963;background:#f1e5d0;}
.settings-data-card>.icon {width:23px;height:23px;flex:none;color:#9b764a;}
.settings-data-card>span {min-width:0;}
.settings-data-card strong {display:block;color:#705238;font-size:13px;font-weight:500;}
.settings-data-card small {display:block;color:#92785c;font-size:10px;line-height:1.7;margin-top:6px;}
.settings-transfer-actions {display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;}
.settings-transfer-actions button {font-size:11px;min-height:38px;}
.settings-section .settings-backup-note {font-size:10px;margin:12px 0 0;color:#99846d;}
.settings-version {display:flex;justify-content:space-between;padding:14px 2px 0;font-size:10px;color:#a38c75;}
.settings-version span {font-family:var(--mono);}
.restore-file-name {display:flex;align-items:center;gap:10px;padding:14px;border:1px solid #ddcbb1;background:#f7ecdc;border-radius:9px;overflow-wrap:anywhere;font-size:13px;}
.restore-file-name .icon {flex:none;color:#987448;}
.restore-file-name strong {min-width:0;}
.restore-space-grid {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:18px;}
.restore-space-card {padding:16px;border:1px solid #dcccB7;background:#fbf6ec;border-radius:9px;}
.restore-space-card h3 {font-size:15px;margin:0 0 12px;color:#70543b;}
.restore-space-card dl {display:flex;flex-direction:column;gap:10px;margin:0;}
.restore-space-card dl>div {display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#8a715c;}
.restore-space-card dd {margin:0;color:#725435;font-family:var(--mono);}
.restore-open-space {font-size:12px;color:#8f7459;margin:16px 0 0;}
.save-recovery-banner {display:flex;align-items:center;justify-content:space-between;gap:20px;padding:15px 24px;margin:16px auto 0;width:calc(100% - 40px);max-width:1304px;border:1px solid #d6ac8a;border-left:4px solid #b5774e;background:#fff1df;border-radius:9px;box-shadow:0 5px 18px #795c3010;}
.save-recovery-banner[hidden] {display:none;}
.save-recovery-banner>div {display:flex;align-items:center;gap:12px;}
.save-recovery-banner .icon {color:#a16b43;flex:none;}
.save-recovery-banner strong {display:block;color:#8b5533;font-size:13px;}
.save-recovery-banner small {display:block;margin-top:5px;font-size:11px;color:#a07755;line-height:1.7;}
.save-recovery-banner button {min-height:40px;white-space:nowrap;}
@media(min-width:761px){
 .side-open .library-workspace .note-grid:not(.note-list-view) {grid-template-columns:repeat(2,minmax(0,1fr));}
 .side-open .library-workspace .library-browse-controls {flex-wrap:wrap;}
 .side-open .library-workspace .library-tags {flex-basis:100%;}
}
@media(max-width:1100px){
 [data-theme=hirono] .hero + .content .library-workspace .note-grid:not(.note-list-view) {grid-template-columns:repeat(2,minmax(0,1fr));}
 .library-browse-controls {flex-wrap:wrap;gap:8px;}
 .library-tags {flex-basis:100%;}
}
@media(max-width:760px){
 [data-theme=hirono] .hero + .content .library-workspace .notes-heading {flex-wrap:wrap;}
 .library-workspace .notes-heading>.micro {flex-basis:100%;margin:0;text-align:left;}
 [data-theme=hirono] .hero + .content .library-workspace .library-toolbar {flex-wrap:wrap;gap:8px;padding:11px;}
 .library-search-wrap {flex-basis:100%;}
 .library-workspace .library-toolbar>button {flex:1;padding:8px;min-width:0;font-size:11px;}
 .library-view-controls {width:100%;justify-content:space-between;}
 .library-tags button,.library-view-controls select {min-height:42px;}
 .library-result-scope {margin-left:0;}
 [data-theme=hirono] .hero + .content .library-workspace .note-grid:not(.note-list-view) {grid-template-columns:minmax(0,1fr);}
 [data-theme=hirono] .hero + .content .library-workspace .note-list-view .library-note {grid-template-columns:minmax(0,1fr);padding:16px 18px;}
 [data-theme=hirono] .hero + .content .library-workspace .note-list-view .library-note-foot {grid-column:1;grid-row:auto;flex-direction:row;align-items:center;justify-content:space-between;padding-top:12px;border-top:1px dashed #d9cabb;margin-top:12px;}
 [data-theme=hirono] .hero + .content .library-workspace .library-note-foot {flex-wrap:wrap;}
 .library-note-actions {gap:5px;}
 .library-read-link {min-height:44px;}
 .settings-section-heading {gap:8px;}
 .settings-section-heading .soft-button {font-size:11px;padding:8px;}
 .settings-backup-actions {grid-template-columns:minmax(0,1fr);}
 .settings-record-counts dd {font-size:20px;}
 .settings-data-card {padding:13px;}
 .save-recovery-banner {flex-direction:column;align-items:stretch;gap:12px;padding:14px;width:calc(100% - 24px);}
 .save-recovery-banner>div:last-child {justify-content:flex-end;}
 .side-pane .quick-note-head .icon-btn {width:40px;height:40px;}
 .side-tag-filter select {min-height:44px;}
}

/* Recovery stays reachable when the browser has a native modal form open. */
#dialog #cloud-alert.within-dialog {position:static;transform:none;width:100%;max-width:100%;margin:18px 0 0;padding:16px;border-radius:9px;box-shadow:none;}
#dialog #cloud-alert.within-dialog button {min-height:44px;}
/* The seven destinations need a second row in small desktop-width windows. */
@media(min-width:761px) and (max-width:900px){
 :root {--app-bar-base:112px;--app-header-height:calc(var(--app-bar-base) + var(--app-safe-top));}
 [data-theme=hirono] .topbar {display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:44px 50px;gap:4px!important;height:var(--app-header-height)!important;min-height:var(--app-header-height)!important;padding:calc(6px + var(--app-safe-top)) 16px 6px!important;}
 [data-theme=hirono] .topbar .brand {grid-column:1;grid-row:1;min-width:0;}
 [data-theme=hirono] .topbar .top-actions {grid-column:2;grid-row:1;margin:0;}
 [data-theme=hirono] .topbar .app-tabs {grid-column:1/-1;grid-row:2;position:static;transform:none;width:100%;min-width:0;max-width:100%;margin:0;padding:3px;gap:3px;}
 [data-theme=hirono] .topbar .app-tab {min-width:0;flex:1 1 0;min-height:42px;padding:5px 7px;gap:5px;font-size:12px;}
 [data-theme=hirono] .topbar .nav-character {width:24px;height:28px;}
}
