:root {
  --ink: #17272a; --muted: #718083; --paper: #f5f1e8; --panel: #fbf9f3;
  --green: #1d6658; --green-dark: #124a41; --line: #dedbd2; --gold: #d6a958;
  --shadow: 0 16px 40px rgba(32, 48, 47, .09);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "DM Sans", sans-serif; color: var(--ink); background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; color: #eff8f3; background: #132c2b; display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 30px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #689087; border-radius: 50%; font: 600 21px Fraunces, serif; }
.brand strong, .brand span { display: block; }.brand span { color: #92aaa5; font-size: 11px; margin-top: 2px; }
.new-note, .save-button { border: 0; color: white; background: var(--green); border-radius: 9px; padding: 12px 16px; font-weight: 700; }
.sidebar .new-note { background: #f2efe4; color: #173633; margin-bottom: 22px; box-shadow: 0 6px 20px #0c211f; }
.nav-item, .section-toggle, .add-page, .page-item, .tag-item { width: 100%; color: #a9bfba; background: transparent; border: 0; text-align: left; padding: 10px 12px; border-radius: 7px; display: flex; gap: 10px; align-items: center; }
.nav-item b { margin-left: auto; font-size: 11px; background: #24423e; padding: 2px 7px; border-radius: 9px; }
.nav-item.active, .page-item.active, .tag-item.active { color: white; background: #25433f; }
.nav-section { border-top: 1px solid #28433f; margin-top: 18px; padding-top: 15px; }
.section-toggle { color: #76918c; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; justify-content: space-between; }
.section-toggle i { transition: transform .2s; }.section-toggle[aria-expanded="false"] i { transform: rotate(-90deg); }
.section-toggle[aria-expanded="false"] + div { display: none; }
.page-item::before { content: "□"; }.tag-item::before { content: "•"; color: #dcad5e; font-size: 20px; }
.add-page { color: #74908a; font-size: 13px; }
.sidebar-foot { margin-top: auto; color: #79928d; font-size: 10px; text-align: center; }
.sync-state { display: flex; align-items: center; justify-content: center; gap: 6px; color: #abc1bc; }
.sync-state span { width: 7px; height: 7px; border-radius: 50%; background: #d1a456; box-shadow: 0 0 0 3px #d1a45622; }
.sync-state.synced span { background: #6dc0a8; box-shadow: 0 0 0 3px #6dc0a822; }
.sync-state.offline span { background: #c77a67; box-shadow: 0 0 0 3px #c77a6722; }
.storage { height: 3px; background: #29433f; border-radius: 4px; overflow: hidden; }.storage span { display: block; height: 100%; width: 15%; background: #d1a456; }
main { min-width: 0; }.topbar { height: 78px; padding: 0 5vw; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; background: rgba(245,241,232,.88); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5; }
.search-wrap { max-width: 560px; flex: 1; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: var(--panel); }
.search-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
kbd { font-size: 10px; color: var(--muted); border: 1px solid var(--line); padding: 3px 6px; border-radius: 4px; }
.icon-button, .menu-button { border: 0; background: transparent; color: var(--ink); font-size: 20px; }.menu-button { display: none; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; color: white; background: #c88f55; font-size: 11px; font-weight: 700; }
.content { max-width: 1260px; margin: 0 auto; padding: 62px 5vw; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 34px; }
.eyebrow { color: var(--green); font-size: 11px; letter-spacing: .16em; font-weight: 700; margin: 0 0 8px; }
h1 { font: 600 clamp(36px, 5vw, 56px) Fraunces, serif; margin: 0 0 9px; letter-spacing: -.04em; }
.hero p:last-child { color: var(--muted); margin: 0; }
.sort-button { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 10px 13px; color: var(--muted); white-space: nowrap; }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.note-card { min-height: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 22px; display: flex; flex-direction: column; box-shadow: 0 2px 0 rgba(22,39,42,.02); transition: transform .2s, box-shadow .2s; position: relative; overflow: hidden; }
.note-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.note-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent, #d1a456); }
.card-meta { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.card-meta button { margin-left: auto; border: 0; background: none; color: #b7b6b0; font-size: 19px; }.card-meta button.favorite { color: var(--gold); }
.note-card h2 { font: 600 22px Fraunces, serif; margin: 18px 0 10px; }.note-card .body { color: #6e7777; font-size: 13px; line-height: 1.6; margin: 0; white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.card-foot { margin-top: auto; padding-top: 20px; display: flex; align-items: center; justify-content: space-between; color: #999d99; font-size: 10px; }
.card-actions button { opacity: 0; border: 0; background: none; color: var(--muted); }.note-card:hover .card-actions button { opacity: 1; }
.empty-state { text-align: center; padding: 80px 20px; color: var(--muted); }.empty-state div { font-size: 32px; color: var(--gold); }.empty-state h2 { font: 600 26px Fraunces; color: var(--ink); margin-bottom: 6px; }.small { margin-top: 15px; }
dialog { width: min(680px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 14px; color: var(--ink); background: var(--panel); box-shadow: 0 30px 80px #07131180; }
dialog::backdrop { background: #102421b8; backdrop-filter: blur(3px); }
dialog form { padding: 28px; }.dialog-head { display: flex; justify-content: space-between; color: var(--green); font-size: 10px; letter-spacing: .14em; font-weight: 700; }
.close-button { border: 0; background: none; font-size: 26px; line-height: 16px; color: var(--muted); }
.title-input { width: 100%; border: 0; border-bottom: 1px solid var(--line); outline: 0; padding: 25px 0 14px; background: transparent; font: 600 34px Fraunces; color: var(--ink); }
textarea { width: 100%; min-height: 250px; resize: vertical; border: 0; outline: 0; padding: 20px 0; background: transparent; line-height: 1.7; color: var(--ink); }
.form-row { display: flex; gap: 14px; border-top: 1px solid var(--line); padding-top: 18px; }.form-row label { flex: 1; font-size: 11px; color: var(--muted); }.form-row input, .form-row select, .small-dialog input { display: block; width: 100%; margin-top: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }.text-button { border: 0; background: none; color: var(--muted); padding: 10px 15px; }
.small-dialog { max-width: 440px; }.small-dialog h2 { font: 600 28px Fraunces; margin-bottom: 5px; }.small-dialog p { color: var(--muted); font-size: 13px; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: var(--panel); padding: 10px 17px; border-radius: 20px; font-size: 12px; opacity: 0; pointer-events: none; transition: .25s; z-index: 30; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.dark { --ink:#e9eee9; --muted:#9aa9a6; --paper:#142522; --panel:#1b302c; --line:#324641; --green:#68b6a4; }.dark .topbar { background:#142522e8; }.dark .note-card .body { color:#acb8b5; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }.sidebar { position: fixed; transform: translateX(-100%); transition: transform .25s; width: 270px; box-shadow: 15px 0 50px #08171466; }.sidebar.open { transform: translateX(0); }
  .menu-button { display: block; }.topbar { padding: 0 18px; }.content { padding: 40px 20px; }.hero { align-items: start; flex-direction: column; }.note-grid { grid-template-columns: 1fr; } kbd { display: none; }
}
