:root {
    color-scheme: dark;
    --bg: #0a0c0f;
    --surface: #111419;
    --surface-2: #161a20;
    --surface-3: #1b2028;
    --line: #262c35;
    --line-soft: #1d2229;
    --text: #eef1f5;
    --muted: #8d96a5;
    --muted-2: #646d7a;
    --brand: #7dd3fc;
    --danger: #fb7185;
    --success: #4ade80;
    --radius: 10px;
    --sidebar: 270px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[data-inline-title] { border-radius: 5px; }
.inline-title-editing { display: inline-block; min-width: 110px; max-width: 100%; padding: 3px 7px !important; margin: -4px -8px; overflow: hidden; border: 1px solid #7dd3fc !important; border-radius: 6px; outline: 0; background: #0c1015 !important; box-shadow: 0 0 0 3px rgba(125, 211, 252, .13); color: #f4f7fa !important; line-height: 1.35; text-overflow: clip; white-space: nowrap; cursor: text; }
.inline-edit-button { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #687382; font-size: 11px; cursor: pointer; opacity: .7; transition: .14s ease; }
.inline-edit-button:hover { border-color: #39424d; background: #20262e; color: #d5dbe3; opacity: 1; }
.heading-edit { display: inline-grid; margin-left: 8px; vertical-align: middle; }
.recent-card-title strong { overflow: hidden; font: inherit; text-overflow: ellipsis; white-space: nowrap; }
button { color: inherit; }
[hidden] { display: none !important; }
::selection { background: rgba(125, 211, 252, .22); }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); display: flex; flex-direction: column; padding: 24px 18px 16px; background: #0d1014; border-right: 1px solid var(--line-soft); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0 6px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #39424e; border-radius: 8px; background: #171b21; color: var(--brand); font: 700 18px/1 Georgia, serif; }
.brand > span:last-child { display: grid; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.search-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 28px 0 22px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: #12161b; color: var(--muted); cursor: pointer; transition: .18s ease; }
.search-trigger:hover { border-color: #3a434f; color: var(--text); background: var(--surface-2); }
kbd { padding: 2px 6px; border: 1px solid #333a45; border-bottom-color: #444d5b; border-radius: 5px; background: #0d1014; color: var(--muted-2); font-size: 10px; }
.side-nav { min-height: 0; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; scrollbar-color: #282e37 transparent; }
.side-link, .folder-link { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 9px; border-radius: 7px; color: #a9b1bd; transition: .15s ease; }
.side-link:hover, .folder-link:hover, .side-link.active, .folder-link.active { background: #171b21; color: var(--text); }
.side-link > span { width: 14px; color: var(--muted-2); }
.folder-nav-list { margin-top: 14px; }
.manage-link { margin-top: 18px; }
.folder-nav { border-radius: 8px; }
.folder-nav.dragging { opacity: .45; }
.folder-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
.nested-links { display: grid; gap: 1px; margin: 1px 0 7px 26px; padding-left: 12px; border-left: 1px solid #252b33; }
.nested-links a { overflow: hidden; padding: 5px 7px; border-radius: 5px; color: #717b89; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.nested-links a:hover, .nested-links a.drop-target { background: #171b21; color: #cbd1d9; }
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 8px; }
.user-card:hover, .user-card.active { background: #171b21; }
.avatar { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; border-radius: 7px; background: #232a33; color: #d8dde4; font-size: 12px; font-weight: 700; }
.user-meta { display: grid; min-width: 0; flex: 1; }
.user-meta strong, .user-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { font-size: 12px; }
.user-meta small { color: var(--muted-2); font-size: 10px; }

.workspace { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; justify-content: space-between; height: 66px; padding: 0 34px; border-bottom: 1px solid rgba(38, 44, 53, .76); background: rgba(10, 12, 15, .88); backdrop-filter: blur(16px); }
.breadcrumb { color: #aeb6c1; font-size: 12px; }
.top-actions, .button-row { display: flex; align-items: center; gap: 8px; }
.icon-button, .more-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover, .more-button:hover { border-color: var(--line); background: var(--surface-2); color: var(--text); }
.mobile-nav { display: none; border: 0; background: transparent; }
.main-content { max-width: 1560px; margin: 0 auto; padding: 45px 42px 80px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.page-heading.compact { align-items: center; }
.page-heading h1 { margin: 0 0 7px; font: 500 clamp(30px, 3vw, 45px)/1.07 ui-serif, Georgia, serif; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); }
.back-link { color: var(--muted); font-size: 12px; }
.back-link:hover { color: var(--text); }
.title-accent { display: inline-block; width: 9px; height: 9px; margin: 0 13px 4px 1px; border-radius: 50%; background: var(--accent); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 38px; padding: 0 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: #dce1e7; font-weight: 600; cursor: pointer; transition: .16s ease; }
.button:hover { transform: translateY(-1px); border-color: #3e4855; background: #1b2027; }
.button.primary { border-color: #dbe7ef; background: #e9f1f5; color: #101317; }
.button.primary:hover { background: #fff; }
.button.ghost { background: transparent; }
.button.subtle { border-color: transparent; background: transparent; color: var(--muted); }
.button.danger-text { border-color: transparent; background: transparent; color: #d87989; }
.button.small { min-height: 31px; padding: 0 10px; font-size: 12px; }
.button.wide { width: 100%; }

.welcome-banner { display: flex; align-items: center; gap: 14px; margin: -10px 0 28px; padding: 13px 16px; border: 1px solid rgba(74, 222, 128, .22); border-radius: 8px; background: rgba(74, 222, 128, .06); }
.welcome-banner span { flex: 1; color: var(--muted); }
.welcome-banner button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.folder-overview { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)); gap: 18px; align-items: start; }
.folder-column { position: relative; min-width: 0; }
.folder-column.dragging { opacity: .35; }
.folder-column.drag-over .folder-hero { border-color: #677383; }
.folder-hero { position: relative; display: flex; align-items: center; gap: 15px; min-height: 116px; padding: 20px; overflow: hidden; border: 1px solid #282e36; border-radius: var(--radius); background: #12161b; transition: .18s ease; }
.folder-hero::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); content: ""; }
.folder-hero:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 42%, #282e36); background: #15191f; box-shadow: var(--shadow); }
.folder-symbol { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid color-mix(in srgb, var(--accent) 35%, #303641); border-radius: 9px; background: color-mix(in srgb, var(--accent) 9%, #111419); color: var(--accent); font-size: 18px; }
.folder-title { display: grid; flex: 1; }
.folder-title strong { font-size: 18px; letter-spacing: .03em; }
.folder-arrow { align-self: flex-start; color: #5e6875; }
.folder-add { position: absolute; top: 9px; right: 9px; z-index: 2; display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 1px solid #353d47; border-radius: 6px; background: #171b21; color: var(--muted); cursor: pointer; opacity: 0; transition: .16s ease; }
.folder-column:hover .folder-add { opacity: 1; }
.folder-add:hover { border-color: #697482; color: white; }
.recent-connector { width: 1px; height: 15px; margin-left: 30px; background: #282e36; }
.recent-collections { position: relative; display: grid; gap: 6px; margin-left: 15px; padding-left: 15px; border-left: 1px solid #282e36; }
.recent-card { display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--item-accent) 18%, var(--line-soft)); border-left: 2px solid var(--item-accent); border-radius: 7px; background: color-mix(in srgb, var(--item-accent) 4%, rgba(17, 20, 25, .7)); transition: .14s ease; }
.recent-card:hover { border-color: color-mix(in srgb, var(--item-accent) 45%, #343c47); border-left-color: var(--item-accent); background: color-mix(in srgb, var(--item-accent) 8%, var(--surface-2)); }
.recent-card-title { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; color: #bfc6cf; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.recent-card-title i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 3px; background: var(--item-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--item-accent) 12%, transparent); }
.recent-card small { flex: 0 0 auto; color: #596270; font-size: 9px; text-transform: uppercase; }
.empty-recent { padding: 9px; border: 1px dashed #2d343d; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.dashboard-lower { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 18px; margin-top: 48px; }
.panel, .focus-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.activity-panel { padding: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading h2 { margin: 4px 0 0; font-size: 17px; font-weight: 600; }
.count-label { color: var(--muted-2); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.activity-list { display: grid; }
.activity-row { display: flex; gap: 13px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.activity-icon { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; border-radius: 50%; background: #1b2027; color: #9aa4b1; font-size: 11px; }
.activity-row div { display: grid; gap: 2px; }
.activity-row strong { color: #c8ced6; font-size: 12px; font-weight: 500; }
.activity-row small { color: #5f6875; font-size: 10px; }
.focus-panel { padding: 24px; }
.focus-panel h2 { margin: 5px 0 22px; font: 500 25px/1.1 ui-serif, Georgia, serif; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--line-soft); }
.stat-grid div { display: grid; gap: 2px; padding: 14px 10px; background: #13171c; }
.stat-grid strong { font-size: 20px; font-weight: 500; }
.stat-grid span { color: var(--muted-2); font-size: 9px; line-height: 1.25; }

.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.collection-card { position: relative; overflow: visible; border: 1px solid var(--line); border-top: 3px solid var(--card-accent, var(--brand)); border-radius: var(--radius); background: var(--surface); transition: .17s ease; }
.collection-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--card-accent, var(--brand)) 44%, var(--line)); border-top-color: var(--card-accent, var(--brand)); box-shadow: var(--shadow); }
.collection-card.dragging { opacity: .35; }
.collection-card.drag-over { border-color: var(--brand); }
.drag-handle { color: #4f5865; cursor: grab; }
.collection-card-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 7px; min-height: 53px; padding: 9px 10px 9px 14px; border-bottom: 1px solid color-mix(in srgb, var(--card-accent, var(--brand)) 22%, var(--line-soft)); background: color-mix(in srgb, var(--card-accent, var(--brand)) 7%, var(--surface)); border-radius: 7px 7px 0 0; }
.collection-card-header a { min-width: 0; }
.collection-card h2 { overflow: hidden; margin: 0; font-size: 15px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.collection-card-actions { display: flex; align-items: center; gap: 3px; }
.collection-summary { display: block; padding: 10px 14px 8px; color: var(--muted-2); font-size: 10px; }
.collection-summary:hover { color: #aeb6c1; }
.color-picker { position: relative; }
.collection-color-button { display: flex; align-items: center; gap: 5px; height: 29px; padding: 0 7px; border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; }
.collection-color-button:hover, .collection-color-button[aria-expanded="true"] { border-color: #343d48; background: #1a1f26; }
.collection-color-button span { width: 12px; height: 12px; border-radius: 4px; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.collection-color-button b { color: #6f7986; font-size: 10px; font-weight: 400; }
.color-palette { position: absolute; top: calc(100% + 7px); right: 0; z-index: 25; display: grid; grid-template-columns: repeat(8, 20px); gap: 6px; width: max-content; padding: 10px; border: 1px solid #343d48; border-radius: 9px; background: #15191f; box-shadow: 0 18px 45px rgba(0,0,0,.48); }
.color-palette button { width: 20px; height: 20px; padding: 0; border: 1px solid rgba(255,255,255,.13); border-radius: 5px; background: var(--swatch); cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.color-palette button:hover { transform: scale(1.18); box-shadow: 0 0 0 2px #15191f, 0 0 0 3px var(--swatch); }
.color-palette button.selected { box-shadow: 0 0 0 2px #15191f, 0 0 0 3px #e4ebf1; }
.collection-recent-items { display: grid; gap: 2px; padding: 0 7px 8px; }
.collection-item-row { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 2px 4px 2px 0; border-radius: 6px; background: transparent; }
.collection-item-row:hover { background: #1a1f26; }
.collection-item-main { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; min-height: 36px; flex: 1; padding: 4px 3px 4px 7px; text-align: left; border: 0; background: transparent; cursor: pointer; }
.collection-item-main > span:nth-child(2) { display: grid; min-width: 0; }
.collection-item-row strong, .collection-item-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-item-row strong { color: #cbd1d9; font-size: 11px; font-weight: 550; }
.collection-item-row small { color: #596370; font-size: 9px; }
.collection-item-row time { color: #515b68; font-size: 9px; }
.collection-item-icon { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 5px; background: color-mix(in srgb, var(--item-color, var(--card-accent, var(--brand))) 12%, #171b21); color: var(--item-color, var(--card-accent, var(--brand))); font-size: 9px; }
.collection-item-row.completed { opacity: .55; }
.collection-item-row.completed strong { text-decoration: line-through; }
.copy-item-button { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #687382; font-size: 13px; cursor: pointer; opacity: .62; transition: .14s ease; }
.copy-item-button:hover { border-color: #39424d; background: #20262e; color: #d5dbe3; opacity: 1; }
.collection-empty { padding: 18px 8px; color: #555f6c; font-size: 10px; text-align: center; }
.collection-open { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 14px; text-align: left; border: 0; border-top: 1px solid var(--line-soft); background: transparent; color: #7e8996; font-size: 10px; cursor: pointer; }
.collection-open:hover { color: #c0c7d0; background: rgba(255,255,255,.015); }
.collection-open b { color: var(--card-accent, var(--brand)); }
.add-card { display: grid; min-height: 240px; place-items: center; align-content: center; gap: 7px; border-top: 1px dashed var(--line); border-style: dashed; background: transparent; color: var(--muted); cursor: pointer; }
.add-card span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #333b45; border-radius: 50%; font-size: 18px; }
.add-card small { color: var(--muted-2); }

.collection-heading { margin-bottom: 25px; }
.board { display: flex; align-items: flex-start; gap: 13px; min-height: calc(100vh - 220px); overflow-x: auto; padding: 2px 3px 20px; scroll-snap-type: x proximity; }
.list-column { width: 310px; min-width: 310px; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: #101318; scroll-snap-align: start; }
.list-column.dragging { opacity: .35; }
.list-column.drag-over { border-color: #56616f; }
.list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; padding: 2px 1px 5px 5px; }
.list-header > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.list-header h2 { overflow: hidden; margin: 0; font-size: 12px; font-weight: 650; letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.item-count { display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 9px; background: #1b2027; color: #66717e; font-size: 9px; }
.item-list { display: grid; gap: 7px; min-height: 28px; }
.item-list.drop-target { padding: 4px; outline: 1px dashed #506071; outline-offset: 2px; border-radius: 7px; }
.item-card { display: flex; gap: 10px; padding: 11px; border: 1px solid color-mix(in srgb, var(--item-color) 24%, #242a32); border-left: 2px solid var(--item-color); border-radius: 8px; background: color-mix(in srgb, var(--item-color) 4%, #171b21); transition: .14s ease; }
.item-card:hover { border-color: color-mix(in srgb, var(--item-color) 45%, #343d48); border-left-color: var(--item-color); background: color-mix(in srgb, var(--item-color) 7%, #1a1f26); }
.item-card.dragging { opacity: .3; }
.item-card.completed { opacity: .58; background: #13161a; }
.item-card.completed strong { color: #78818d; text-decoration: line-through; }
.hide-completed .item-card.completed { display: none; }
.task-check { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; padding: 0; border: 1px solid color-mix(in srgb, var(--item-color) 65%, #46515f); border-radius: 5px; background: color-mix(in srgb, var(--item-color) 8%, transparent); color: var(--item-color); font-size: 11px; cursor: pointer; }
.completed .task-check { border-color: #4b7259; background: #263a2c; color: #8dda9f; }
.task-check.type-icon { border: 0; color: var(--item-color); cursor: default; }
.item-main { display: grid; min-width: 0; flex: 1; gap: 3px; padding: 0; text-align: left; border: 0; background: transparent; cursor: pointer; }
.item-main strong { overflow: hidden; color: #d6dbe2; font-size: 12px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.item-main span { display: -webkit-box; overflow: hidden; color: #6f7986; font-size: 10px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.item-main small { margin-top: 5px; color: #56606d; font-size: 8px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.item-card > .copy-item-button, .item-card > .edit-item-button { margin: -3px -3px 0 0; }
.edit-item-button { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #687382; font-size: 12px; cursor: pointer; opacity: .62; transition: .14s ease; }
.edit-item-button:hover { border-color: #39424d; background: #20262e; color: #d5dbe3; opacity: 1; }
.quick-add, .completed-toggle { width: 100%; margin-top: 8px; padding: 8px; text-align: left; border: 0; border-radius: 6px; background: transparent; color: #697381; font-size: 11px; cursor: pointer; }
.quick-add:hover, .completed-toggle:hover { background: #171b21; color: #aeb6c1; }
.completed-toggle { margin-top: 1px; padding-top: 4px; color: #4e5763; font-size: 9px; text-align: center; }
.add-list { display: flex; align-items: center; gap: 9px; min-height: 47px; border-style: dashed; background: transparent; color: var(--muted); cursor: pointer; }
.add-list:hover { border-color: #424c58; background: #101318; }

.tab-bar { display: flex; gap: 3px; margin-bottom: 17px; padding: 3px; width: fit-content; border: 1px solid var(--line); border-radius: 8px; background: #0e1115; }
.tab-bar button { padding: 7px 11px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.tab-bar button.active { background: #1b2027; color: var(--text); }
.tab-bar span { margin-left: 5px; color: var(--muted-2); font-size: 10px; }
.archive-list { display: grid; gap: 7px; }
.archive-row { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface); }
.archive-row > div:nth-child(2) { display: grid; }
.archive-row small { color: var(--muted-2); font-size: 10px; }
.archive-type { width: fit-content; padding: 3px 7px; border: 1px solid #303844; border-radius: 5px; color: #818c9a; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.archive-type.danger { border-color: rgba(251,113,133,.23); color: #bd6b78; }
.empty-state { display: grid; justify-items: center; padding: 70px 20px; border: 1px dashed #292f38; border-radius: var(--radius); text-align: center; }
.empty-state > span { font-size: 25px; color: #525b68; }
.empty-state h2 { margin: 13px 0 4px; font-size: 16px; }
.empty-state p, .empty-hint { margin: 0; color: var(--muted-2); }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-form { display: grid; align-content: start; gap: 15px; padding: 23px; }
.settings-form p { margin: 0; color: var(--muted); }
label { display: grid; gap: 6px; color: #9fa8b4; font-size: 11px; font-weight: 600; }
label small { color: var(--muted-2); font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid #2c333d; border-radius: 7px; outline: none; background: #0f1216; color: var(--text); transition: .15s ease; }
input, select { min-height: 40px; padding: 0 11px; }
textarea { padding: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #637082; box-shadow: 0 0 0 3px rgba(125, 211, 252, .06); }
.switch-row { grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 8px; }
.switch-row span { display: grid; }
.switch-row input { width: 38px; min-height: 20px; accent-color: var(--brand); }

.dialog { width: min(520px, calc(100vw - 30px)); padding: 0; overflow: hidden; border: 1px solid #343c47; border-radius: 12px; background: #12161b; color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.dialog::backdrop { background: rgba(3, 5, 7, .72); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin: 0; font-size: 20px; }
.form-dialog form { display: grid; gap: 18px; max-height: min(86vh, 760px); padding: 23px; overflow-y: auto; }
#dynamic-fields { display: grid; gap: 13px; }
#dynamic-fields textarea { min-height: 92px; }
.color-preset-field { gap: 9px; }
.form-color-palette { display: grid; grid-template-columns: repeat(8, 24px); gap: 8px; width: fit-content; padding: 10px; border: 1px solid #2c333d; border-radius: 8px; background: #0f1216; }
.form-color-palette button { width: 24px; height: 24px; padding: 0; border: 1px solid rgba(255,255,255,.15); border-radius: 6px; background: var(--swatch); cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.form-color-palette button:hover { transform: scale(1.12); box-shadow: 0 0 0 2px #12161b, 0 0 0 3px var(--swatch); }
.form-color-palette button.selected { box-shadow: 0 0 0 2px #12161b, 0 0 0 4px #e4ebf1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.form-error { margin: 0; color: var(--danger); font-size: 11px; }
.search-dialog { width: min(650px, calc(100vw - 30px)); margin-top: 11vh; vertical-align: top; }
.search-box { padding: 8px; }
.search-input-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 6px 7px 8px; border-bottom: 1px solid var(--line); }
.search-input-row input { border: 0; background: transparent; box-shadow: none; font-size: 16px; }
.search-results { max-height: 440px; overflow-y: auto; padding: 6px 0 0; }
.search-results > .empty-hint { padding: 25px 16px; text-align: center; }
.search-result { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 7px; }
.search-result:hover, .search-result.active { background: #1a1f26; }
.search-result > span { color: #697482; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.search-result div { display: grid; min-width: 0; }
.search-result strong, .search-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result strong { font-size: 12px; }
.search-result small { color: var(--muted-2); font-size: 10px; }
.search-result b { color: #5d6774; }
.item-dialog { width: min(920px, calc(100vw - 28px)); }
.item-editor-shell { display: grid; grid-template-rows: auto auto auto auto auto minmax(280px, 48vh) auto; padding: 22px; }
.item-editor-topline { display: flex; align-items: center; gap: 9px; }
.type-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.saved-state { color: var(--muted-2); font-size: 10px; }
.saved-state.saving { color: #d0a84a; }
.saved-state.error { color: var(--danger); }
.item-title-row { display: grid; grid-template-columns: 1fr 145px; gap: 10px; margin-top: 17px; }
.editor-title { height: 49px; padding: 0; border: 0; background: transparent; box-shadow: none !important; font-size: 23px; font-weight: 600; }
.editor-location { margin-top: 7px; }
.editor-location select { min-height: 34px; color: var(--muted); font-size: 11px; }
.editor-link { margin-top: 7px; }
.editor-link input { min-height: 34px; color: var(--muted); font-size: 11px; }
.editor-tabs { display: flex; align-items: center; gap: 3px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.editor-tabs button { padding: 8px 11px; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.editor-tabs button.active { border-color: #c8d0da; color: var(--text); }
.editor-tabs span { margin-left: auto; color: #505966; font-size: 9px; }
.editor-content { min-height: 280px; padding: 17px 3px; border: 0; background: transparent; box-shadow: none !important; line-height: 1.65; resize: none; }
.markdown-body { overflow-y: auto; padding: 15px 3px; color: #c9cfd7; line-height: 1.7; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: var(--text); line-height: 1.2; }
.markdown-body h1 { font-size: 25px; }.markdown-body h2 { font-size: 20px; }.markdown-body h3 { font-size: 16px; }
.markdown-body p { margin: 0 0 12px; }
.markdown-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.markdown-body code { padding: 2px 5px; border-radius: 4px; background: #222832; color: #d8dee7; }
.markdown-body pre { overflow-x: auto; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: #0c0f12; }
.markdown-body pre code { padding: 0; background: transparent; }
.markdown-body blockquote { margin: 12px 0; padding-left: 13px; border-left: 2px solid #4e5967; color: #909aa7; }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.editor-footer > div { display: flex; gap: 3px; }
.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 7px; }
.toast { min-width: 230px; padding: 11px 14px; border: 1px solid #343d47; border-radius: 8px; background: #171b21; box-shadow: var(--shadow); color: #dce1e7; font-size: 11px; animation: toast-in .2s ease; }
.toast.error { border-color: rgba(251,113,133,.35); color: #f3abb7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.auth-body { background: #090b0e; }
.auth-layout { display: grid; place-items: center; min-height: 100vh; padding: 28px; }
.auth-panel { width: min(450px, 100%); }
.auth-card { display: grid; gap: 18px; width: 100%; padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 7px; padding: 0; }
.auth-card h1 { margin: 0; font-size: 27px; font-weight: 600; }
.auth-card p { margin: 0; color: var(--muted); }
.auth-card input { min-height: 45px; }
.form-switch { text-align: center; font-size: 11px; }
.form-switch a { color: #d5dce5; text-decoration: underline; text-underline-offset: 3px; }
.alert { padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; }
.alert.error { border-color: rgba(251,113,133,.27); background: rgba(251,113,133,.06); color: #ef9baa; }

@media (max-width: 1100px) {
    :root { --sidebar: 235px; }
    .main-content { padding-inline: 27px; }
    .folder-overview { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
    .dashboard-lower { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { transform: translateX(-101%); transition: transform .2s ease; box-shadow: var(--shadow); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .workspace { width: 100%; }
    .mobile-nav { display: block; }
    .topbar { height: 58px; padding: 0 16px; }
    .main-content { padding: 28px 16px 60px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-heading h1 { font-size: 34px; }
    .folder-overview, .collection-grid, .settings-grid { grid-template-columns: 1fr; }
    .folder-add { opacity: 1; }
    .archive-row { grid-template-columns: 1fr; }
    .board { min-height: auto; }
    .list-column { width: 285px; min-width: 285px; }
    .auth-layout { padding: 16px; }
    .auth-card { padding: 23px; }
    .item-title-row { grid-template-columns: 1fr; }
    .item-editor-shell { padding: 17px; }
    .editor-tabs span { display: none; }
}

