:root {
  --bg: #f4f4ef;
  --surface: #fffefa;
  --surface-2: #f8f8f3;
  --ink: #252824;
  --muted: #777b72;
  --line: #e4e4dc;
  --line-soft: #eeeeE8;
  --brand: #315f52;
  --brand-dark: #23473e;
  --brand-soft: #e5eee9;
  --accent: #e6a564;
  --shadow: 0 12px 38px rgba(49, 54, 48, .07);
  --vital: #7ca497;
  --work: #738fbb;
  --projects: #927db7;
  --duties: #d49a60;
  --relations: #ca8191;
  --leisure: #73a98b;
  --entertainment: #a58ab1;
  --free: #aeb5a9;
  --sidebar: 218px;
  --topbar: 70px;
  --hour-height: 72px;
  --library-width: 250px;
  font-synthesis: none;
}

:root[data-theme="ocean"] { --bg:#f1f5f6; --surface:#fcffff; --surface-2:#f3f8f9; --ink:#213036; --muted:#6f7e82; --line:#dce6e8; --line-soft:#e7edef; --brand:#2d6f7a; --brand-dark:#215762; --brand-soft:#dfeff1; --accent:#e2a765; --shadow:0 12px 38px rgba(36,70,77,.08); }
:root[data-theme="clay"] { --bg:#f7f2ed; --surface:#fffdf9; --surface-2:#faf5ef; --ink:#332a25; --muted:#82756d; --line:#e8ddd3; --line-soft:#f0e7df; --brand:#9a5f43; --brand-dark:#79462f; --brand-soft:#f2e2d7; --accent:#d99c58; --shadow:0 12px 38px rgba(85,55,39,.08); }
:root[data-theme="lavender"] { --bg:#f5f3f8; --surface:#fffefe; --surface-2:#f8f5fb; --ink:#2d2935; --muted:#797482; --line:#e4dfea; --line-soft:#eee9f2; --brand:#75619a; --brand-dark:#59477b; --brand-soft:#eae3f2; --accent:#d49a72; --shadow:0 12px 38px rgba(74,57,94,.08); }
:root[data-theme="midnight"] { color-scheme:dark; --bg:#18201f; --surface:#222b29; --surface-2:#283230; --ink:#edf2ef; --muted:#9daaa5; --line:#36423f; --line-soft:#303a38; --brand:#7db3a3; --brand-dark:#9bc9bb; --brand-soft:#2a4540; --accent:#e4aa6d; --shadow:0 14px 42px rgba(0,0,0,.22); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar);
  padding: 27px 18px 18px;
  display: flex;
  flex-direction: column;
  background: #f9f9f5;
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 8px 30px;
  color: var(--ink);
  font: 700 21px/1 "Manrope", sans-serif;
  text-decoration: none;
  letter-spacing: -.6px;
}
.brand > span:last-child > span, .mobile-brand span { color: var(--brand); }
.brand-mark { position: relative; width: 28px; height: 28px; display: grid; place-items: center; transform: rotate(-8deg); }
.brand-mark i { position: absolute; width: 18px; height: 8px; border: 2px solid var(--brand); border-radius: 50%; }
.brand-mark i:nth-child(2) { transform: rotate(60deg); }
.brand-mark i:nth-child(3) { transform: rotate(-60deg); }
.main-nav { display: grid; gap: 6px; }
.nav-item {
  border: 0;
  background: transparent;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #6f746c;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: .18s ease;
}
.nav-item:hover { background: #efefe9; color: var(--ink); }
.nav-item.active { color: var(--brand); background: var(--brand-soft); }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:first-child svg { fill: currentColor; stroke: none; }
.nav-item b { margin-left: auto; min-width: 20px; height: 20px; display: grid; place-items: center; background: #ecece5; border-radius: 8px; font-size: 11px; }
.nav-item.active b { background: rgba(49,95,82,.12); }
.sidebar-spacer { flex: 1; }
.week-note { margin: 16px 3px 15px; padding: 15px 14px; background: color-mix(in srgb, var(--brand) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 13%, var(--line)); border-radius: 14px; }
.week-note-icon { color: var(--brand); font-size: 14px; }
.week-note p { margin: 7px 0 0; font-size: 12px; line-height: 1.5; color: #6d7468; }
.week-note strong { color: #4f5c51; }
.settings-btn { width: 100%; }
.profile-mini { border-top: 1px solid var(--line); margin-top: 12px; padding: 17px 3px 0; display: grid; grid-template-columns: 36px 1fr auto; gap: 9px; align-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: white; background: #bd8c70; font-size: 11px; font-weight: 700; }
.profile-mini strong, .profile-mini span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-mini strong { font-size: 12px; }
.profile-mini span { color: var(--muted); font-size: 10px; margin-top: 2px; }
.profile-mini button { border: 0; background: transparent; cursor: pointer; color: #999b96; letter-spacing: 1px; }

.main-content { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { height: var(--topbar); padding: 0 3.5vw; border-bottom: 1px solid rgba(222,222,214,.75); display: flex; align-items: center; justify-content: flex-end; position: sticky; top: 0; z-index: 30; background: rgba(244,244,239,.88); backdrop-filter: blur(15px); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.save-state { display: flex; align-items: center; gap: 7px; color: #8a8e85; font-size: 11px; transition: .2s; }
.save-state span { width: 6px; height: 6px; border-radius: 50%; background: #75a288; box-shadow: 0 0 0 3px rgba(117,162,136,.12); }
.save-state.saving span { background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.icon-btn, .mini-icon-btn { border: 1px solid var(--line); background: rgba(255,255,252,.75); display: grid; place-items: center; cursor: pointer; border-radius: 10px; transition: .18s; }
.icon-btn { width: 38px; height: 38px; }
.icon-btn:hover, .mini-icon-btn:hover { border-color: #c9ccc3; background: white; }
.icon-btn svg { width: 18px; height: 18px; }
.primary-btn, .outline-btn { height: 40px; border-radius: 10px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 700; transition: transform .18s, background .18s, border-color .18s; }
.primary-btn { border: 1px solid var(--brand); color: white; background: var(--brand); box-shadow: 0 5px 12px rgba(49,95,82,.13); }
.primary-btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.primary-btn span { font-size: 18px; font-weight: 400; line-height: 0; }
.outline-btn { border: 1px solid #d8d9d1; background: rgba(255,255,252,.7); }
.outline-btn:hover { border-color: #bfc4b9; background: white; }
.outline-btn svg { width: 16px; height: 16px; }
.outline-btn.compact { height: 37px; padding: 0 12px; }
.outline-btn b { color: var(--brand); min-width: 19px; height: 19px; display: grid; place-items: center; background: var(--brand-soft); border-radius: 6px; font-size: 10px; }
.mobile-menu, .mobile-brand { display: none; }

.global-search { position: fixed; z-index: 80; top: 16px; left: calc(var(--sidebar) + 50%); transform: translate(-50%, -16px); width: min(600px, calc(100vw - var(--sidebar) - 80px)); height: 48px; padding: 0 14px; background: white; border: 1px solid #d9dad2; box-shadow: 0 16px 45px rgba(36,42,37,.16); border-radius: 13px; display: flex; align-items: center; gap: 10px; opacity: 0; pointer-events: none; transition: .2s; }
.global-search.open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.global-search svg { color: var(--muted); flex: none; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; font-size: 14px; color: var(--ink); }
.global-search kbd { color: #92958d; background: #f3f3ee; padding: 3px 6px; border: 1px solid #e2e2dc; border-radius: 5px; font: 10px "DM Sans"; }
.search-results { position: absolute; top: 55px; left: 0; right: 0; max-height: 320px; overflow-y: auto; padding: 7px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 13px; display: none; }
.search-results.has-results { display: block; }
.search-result { width: 100%; border: 0; background: transparent; border-radius: 8px; display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center; padding: 10px; text-align: left; cursor: pointer; }
.search-result:hover { background: var(--surface-2); }
.search-result i { width: 8px; height: 8px; border-radius: 50%; }
.search-result strong { font-size: 13px; display: block; }
.search-result span { color: var(--muted); font-size: 11px; }

.view { display: none; padding: 42px max(3.5vw, 30px) 60px; max-width: 1500px; margin: 0 auto; }
.view.active { display: block; animation: viewIn .28s ease; }
@keyframes viewIn { from { opacity: .3; transform: translateY(5px); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin: 0 0 29px; }
.eyebrow, .section-kicker { margin: 0; color: #999b94; font-size: 9px; font-weight: 700; letter-spacing: 1.35px; }
.page-heading h1, .planner-header h1 { font: 600 29px/1.2 "Manrope", sans-serif; letter-spacing: -1.2px; margin: 8px 0 0; }
.dashboard-heading h1 span { display: inline-block; margin-left: 4px; color: #e8ad4f; font-size: 24px; }
.subheading { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .7fr) minmax(280px, .95fr); gap: 17px; align-items: stretch; }
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; box-shadow: 0 7px 25px rgba(50,54,49,.035); padding: 21px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.card h2 { margin: 5px 0 0; font: 600 16px/1.3 "Manrope", sans-serif; letter-spacing: -.35px; }
.soft-status { color: #5b7868; background: #edf3ee; border-radius: 20px; padding: 6px 9px; display: flex; gap: 6px; align-items: center; white-space: nowrap; font-size: 9px; font-weight: 600; }
.soft-status i { width: 6px; height: 6px; border-radius: 50%; background: #75a288; }
.today-card { grid-row: span 2; min-height: 487px; display: flex; flex-direction: column; }
.day-timeline { flex: 1; margin: 20px 0 9px; position: relative; }
.day-timeline:before { content: ""; position: absolute; left: 57px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 47px 10px 1fr; gap: 10px; align-items: start; min-height: 64px; }
.timeline-time { font-size: 10px; color: #92958c; padding-top: 8px; text-align: right; }
.timeline-dot { z-index: 1; margin-top: 9px; width: 9px; height: 9px; border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px currentColor; background: currentColor; }
.timeline-content { padding: 7px 10px 10px 3px; border-radius: 8px; }
.timeline-content strong { display: block; font-size: 12px; font-weight: 600; }
.timeline-content span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.timeline-empty { min-height: 60px; display: flex; align-items: center; gap: 9px; margin-left: 47px; padding-left: 20px; color: var(--muted); font-size: 11px; }
.timeline-empty i { width: 8px; height: 8px; border-radius: 50%; border: 1px dashed #aeb2a8; background: var(--surface); z-index: 1; }
.text-btn { align-self: flex-start; padding: 0; border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 11px; font-weight: 700; }
.text-btn:hover { color: var(--brand-dark); }
.text-btn span { margin-left: 5px; }
.text-btn.inline { align-self: auto; }
.free-time-card { padding: 24px; background: color-mix(in srgb, var(--brand) 7%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 12%, var(--line)); overflow: hidden; position: relative; }
.free-time-card:after { content: ""; position: absolute; right: -30px; bottom: -55px; width: 140px; height: 140px; border: 1px solid rgba(93,126,100,.1); border-radius: 50%; }
.free-time-top { display: flex; justify-content: space-between; }
.free-number strong { display: block; margin-top: 9px; color: #405a49; font: 600 25px/1 "Manrope"; letter-spacing: -1.2px; }
.free-number span { display: block; color: #738078; font-size: 10px; margin-top: 5px; }
.open-circle { width: 45px; height: 45px; border: 6px solid #cfdbce; border-right-color: #71957c; border-radius: 50%; transform: rotate(-28deg); display: grid; place-items: center; }
.open-circle span { width: 5px; height: 5px; background: #71957c; border-radius: 50%; }
.free-time-card > p { color: #68756b; font-size: 11px; line-height: 1.55; margin: 19px 0 14px; max-width: 300px; }
.free-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.free-chips span { padding: 5px 8px; border: 1px solid #d9e1d5; color: #647368; background: rgba(255,255,255,.48); border-radius: 6px; font-size: 9px; }
.mini-icon-btn { width: 29px; height: 29px; font-size: 13px; color: #777b73; }
.next-list { display: grid; gap: 8px; margin-top: 17px; }
.next-item { display: grid; grid-template-columns: 41px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #efefe9; cursor: pointer; }
.next-item:last-child { border-bottom: 0; }
.next-time { color: #8d9089; font-size: 10px; }
.next-detail { border-left: 3px solid; padding-left: 10px; min-width: 0; }
.next-detail strong { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-detail span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.next-item > span:last-child { color: #aaa; font-size: 13px; }
.balance-card { grid-column: span 2; }
.info-button { border: 1px solid var(--line); background: transparent; color: #999c95; width: 22px; height: 22px; border-radius: 50%; cursor: help; font: 600 11px serif; }
.general-balance { margin: 18px 0 15px; padding: 13px 15px; border: 1px solid #e7e8e1; background: #fafaf7; border-radius: 10px; display: grid; grid-template-columns: 150px 1fr; gap: 15px; align-items: center; }
.general-balance strong, .general-balance span { display: block; }
.general-balance strong { font-size: 11px; }
.general-balance div > span { color: var(--muted); margin-top: 3px; font-size: 9px; }
.balance-track { height: 7px; display: flex; position: relative; border-radius: 10px; }
.balance-track .zone { height: 100%; }
.balance-track .z1 { width: 24%; border-radius: 10px 0 0 10px; background: #eceee8; }
.balance-track .z2 { width: 23%; background: #dce7de; }
.balance-track .z3 { width: 30%; background: #8bad96; box-shadow: inset 0 0 0 1px rgba(58,101,73,.1); }
.balance-track .z4 { width: 23%; border-radius: 0 10px 10px 0; background: #ead9cf; }
.balance-track i { position: absolute; top: 50%; left: 62%; width: 3px; height: 14px; border: 2px solid white; box-sizing: content-box; background: var(--brand-dark); border-radius: 4px; transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(32,50,41,.35); transition: left .4s; }
.area-balances { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 26px; }
.area-balance-row { display: grid; grid-template-columns: 105px 1fr; gap: 10px; align-items: center; }
.area-balance-row > span { font-size: 9px; color: #666b63; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.area-balance-row .balance-track { height: 5px; }
.area-balance-row .balance-track i { height: 10px; width: 2px; }
.balance-hint { margin: 16px 0 0; display: flex; gap: 8px; color: #727a70; font-size: 9px; line-height: 1.45; }
.balance-hint > span:first-child { color: #799887; }
.tasks-card { min-height: 265px; }
.unscheduled-preview { margin: 15px 0 8px; display: grid; gap: 3px; }
.preview-task { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 7px; cursor: pointer; }
.preview-task:hover { background: var(--surface-2); }
.preview-task i { width: 8px; height: 8px; border: 2px solid; border-radius: 50%; }
.preview-task strong { font-size: 10px; font-weight: 600; }
.preview-task span { font-size: 9px; color: var(--muted); }
.add-quiet-btn { border: 1px dashed #dfe1da; background: #fafaf7; color: #777c73; width: 100%; min-height: 34px; border-radius: 8px; cursor: pointer; font-size: 10px; }
.add-quiet-btn:hover { color: var(--brand); border-color: #b9ccc2; background: var(--brand-soft); }
.add-quiet-btn span { margin-right: 4px; font-size: 14px; }
.projects-preview-card { min-height: 265px; }
.project-preview-list { margin-top: 16px; display: grid; gap: 14px; }
.project-preview { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; cursor: pointer; }
.project-symbol { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.project-preview strong { display: block; font-size: 10px; }
.project-preview span { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.progress-ring { --progress: 50; width: 29px; height: 29px; border-radius: 50%; background: conic-gradient(var(--ring-color, var(--brand)) calc(var(--progress) * 1%), #ecece6 0); position: relative; }
.progress-ring:after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.conflict-card { grid-column: span 2; display: grid; grid-template-columns: 39px 1fr auto; align-items: center; gap: 13px; padding: 16px 19px; background: #f6f8f2; }
.conflict-card.has-conflict { background: #fbf3ed; border-color: #efded1; }
.conflict-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #557663; background: #e2eee4; font-size: 15px; }
.has-conflict .conflict-icon { color: #a26747; background: #f2dfd3; }
.conflict-card h3 { font: 600 12px "Manrope"; margin: 4px 0 2px; }
.conflict-card p { margin: 0; color: var(--muted); font-size: 9px; }

/* Planner */
.planner-view { max-width: none; padding: 28px max(2.2vw, 22px) 30px; }
.planner-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 20px; }
.planner-title-row { display: flex; align-items: center; gap: 12px; margin-top: 5px; }
.planner-title-row h1 { margin: 0; font-size: 25px; }
.today-btn { border: 1px solid var(--line); background: white; height: 28px; padding: 0 10px; border-radius: 7px; font-size: 10px; cursor: pointer; }
.week-nav { display: flex; }
.week-nav button { width: 28px; height: 28px; border: 1px solid var(--line); background: white; cursor: pointer; font-size: 18px; line-height: 1; }
.week-nav button:first-child { border-radius: 7px 0 0 7px; }
.week-nav button:last-child { border-radius: 0 7px 7px 0; border-left: 0; }
.planner-tools { display: flex; align-items: center; gap: 9px; }
.view-switch { display: flex; padding: 3px; border: 1px solid var(--line); background: #edede8; border-radius: 9px; }
.view-switch button { height: 29px; border: 0; background: transparent; border-radius: 6px; padding: 0 12px; color: #777b74; cursor: pointer; font-size: 10px; font-weight: 600; }
.view-switch button.active { background: white; color: var(--ink); box-shadow: 0 1px 5px rgba(50,54,48,.08); }
.week-insight { margin-bottom: 12px; min-height: 37px; padding: 8px 12px; display: flex; align-items: center; gap: 9px; background: color-mix(in srgb, var(--brand) 7%, var(--surface)); color: var(--muted); border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--line)); border-radius: 9px; font-size: 10px; }
.week-insight > span { color: #698b77; }
.week-insight p { margin: 0; flex: 1; }
.week-insight button { border: 0; background: transparent; color: #8c938b; cursor: pointer; }
.planner-layout { display: grid; grid-template-columns: var(--library-width) minmax(700px, 1fr); min-height: 760px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--surface); transition: grid-template-columns .25s ease; }
.planner-layout:not(.library-open) { grid-template-columns: 0 minmax(700px, 1fr); }
.planner-layout:not(.library-open) .task-library { opacity: 0; pointer-events: none; }
.task-library { position: relative; width: 100%; min-width: 0; padding: 19px 18px 19px 14px; border-right: 1px solid var(--line); background: var(--surface-2); overflow: hidden; transition: opacity .2s; }
.library-resizer { position:absolute; z-index:12; top:0; right:-1px; bottom:0; width:8px; cursor:col-resize; display:grid; place-items:center; }
.library-resizer:after { content:""; width:2px; height:42px; border-radius:2px; background:var(--line); transition:.18s; }
.library-resizer:hover:after, .library-resizer.resizing:after { width:3px; background:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.library-head { display: flex; justify-content: space-between; align-items: flex-start; }
.library-head h2 { margin: 5px 0 0; font: 600 15px "Manrope"; }
.library-head button { border: 0; background: transparent; cursor: pointer; color: #999c95; font-size: 20px; }
.task-library > p { color: var(--muted); margin: 8px 0 14px; font-size: 9px; line-height: 1.45; }
.library-filter-row { display: grid; grid-template-columns: 1fr 30px; gap: 5px; }
.library-search { height: 31px; display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 0 7px; }
.library-search svg { width: 13px; height: 13px; color: #8c9088; flex: none; }
.library-search input { min-width: 0; border: 0; outline: none; width: 100%; font-size: 9px; }
.library-filter-row > button { border: 1px solid var(--line); background: white; border-radius: 7px; cursor: pointer; color: #777; }
.filter-pills { display: none; flex-wrap: wrap; gap: 4px; padding-top: 7px; }
.filter-pills.open { display: flex; }
.filter-pills button { border: 1px solid var(--line); background: white; color: var(--muted); padding: 4px 6px; border-radius: 10px; font-size: 8px; cursor: pointer; }
.filter-pills button.active { background: var(--brand-soft); color: var(--brand); border-color: #d4e4db; }
.library-list { margin: 13px 0 10px; display: grid; gap: 7px; max-height: 610px; overflow-y: auto; scrollbar-width: thin; }
.library-task { position: relative; padding: 10px 9px 9px 12px; background: white; border: 1px solid #e7e7e0; border-radius: 9px; cursor: grab; box-shadow: 0 2px 5px rgba(43,47,42,.025); }
.library-task:active { cursor: grabbing; }
.library-task:before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; background: var(--task-color); border-radius: 0 3px 3px 0; }
.library-task strong { display: block; font-size: 10px; line-height: 1.3; padding-right: 14px; }
.library-task-meta { margin-top: 7px; display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 8px; }
.library-task-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library-task button { position: absolute; top: 6px; right: 5px; border: 0; background: transparent; cursor: pointer; color: #a1a39d; font-size: 12px; }
.library-empty { padding: 30px 12px; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.6; }
.add-quiet-btn.full { min-height: 36px; }
.calendar-wrap { overflow: auto; background: white; scrollbar-width: thin; }
.calendar-grid { --days: 7; position: relative; display: grid; grid-template-columns: 48px minmax(700px, 1fr); grid-template-rows: 58px calc(17 * var(--hour-height)); min-width: 748px; }
.calendar-corner { grid-column: 1; grid-row: 1; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 7px; color: #aaa; font-size: 7px; }
.day-headers { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(var(--days), 1fr); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 8; background: rgba(255,255,252,.96); }
.day-header { min-width: 0; padding: 10px 5px 6px; text-align: center; border-right: 1px solid var(--line-soft); }
.day-header span { display: block; color: #8d9188; font-size: 8px; text-transform: uppercase; font-weight: 700; letter-spacing: .7px; }
.day-header strong { display: inline-grid; place-items: center; margin-top: 3px; width: 25px; height: 25px; border-radius: 50%; font-size: 11px; }
.day-header.today strong { background: var(--brand); color: white; }
.day-header.today span { color: var(--brand); }
.day-header.load-high { box-shadow: inset 0 -2px #e6ba91; }
.time-labels { grid-column: 1; grid-row: 2; border-right: 1px solid var(--line); background: #fdfdfa; }
.time-label { height: var(--hour-height); color: #9ea199; font-size: 7px; text-align: center; transform: translateY(-5px); }
.day-columns { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(var(--days), 1fr); }
.day-column { position: relative; border-right: 1px solid var(--line-soft); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-height) - 1px), #e9e9e3 calc(var(--hour-height) - 1px), #e9e9e3 var(--hour-height)), repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-height) / 2 - 1px), rgba(232,232,225,.42) calc(var(--hour-height) / 2 - 1px), rgba(232,232,225,.42) calc(var(--hour-height) / 2)); }
.day-column.today { background-color: rgba(234,241,236,.23); }
.day-column.drag-over { background-color: rgba(49,95,82,.08); box-shadow: inset 0 0 0 2px rgba(49,95,82,.15); }
.free-window { position: absolute; left: 4px; right: 4px; border-radius: 4px; background: repeating-linear-gradient(-45deg, transparent 0, transparent 4px, rgba(115,130,119,.055) 4px, rgba(115,130,119,.055) 5px); pointer-events: none; }
.calendar-block { --block-color: var(--work); position: absolute; z-index: 3; left: 4px; right: 4px; top: calc(var(--start) * var(--hour-height) / 60); height: max(22px, calc(var(--duration) * var(--hour-height) / 60 - 2px)); min-height: 22px; padding: 5px 6px 4px 9px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--block-color) 37%, white); border-left: 3px solid var(--block-color); border-radius: 6px; background: color-mix(in srgb, var(--block-color) 17%, white); color: color-mix(in srgb, var(--block-color) 62%, #1b2922); cursor: grab; text-align: left; box-shadow: 0 1px 3px rgba(42,45,40,.04); user-select: none; transition: box-shadow .16s, transform .16s; }
.calendar-block:hover { z-index: 5; box-shadow: 0 4px 12px rgba(46,49,44,.12); transform: translateY(-1px); }
.calendar-block:active { cursor: grabbing; }
.calendar-block.conflict { box-shadow: inset 0 0 0 1px #c86b57, 0 2px 6px rgba(160,75,57,.13); }
.calendar-block.fixed { opacity: .82; background-image: repeating-linear-gradient(-45deg, transparent 0, transparent 5px, rgba(255,255,255,.36) 5px, rgba(255,255,255,.36) 7px); }
.calendar-block.locked { cursor:pointer; padding-right:17px; }
.calendar-block.locked:after { content:"▣"; position:absolute; right:5px; top:4px; font-size:7px; opacity:.62; }
.calendar-block strong { display: block; font-size: 8.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.calendar-block span { display: block; margin-top: 2px; font-size: 7px; opacity: .78; white-space: nowrap; pointer-events: none; }
.calendar-block .resize-handle { position: absolute; height: 7px; left: 4px; right: 4px; bottom: 0; cursor: ns-resize; border-bottom: 2px solid transparent; }
.calendar-block:hover .resize-handle { border-bottom-color: color-mix(in srgb, var(--block-color) 45%, transparent); }
.calendar-block.locked .resize-handle { display:none; }
.resize-readout { position:absolute; z-index:20; right:3px; bottom:3px; padding:2px 5px; border-radius:4px; color:white; background:color-mix(in srgb, var(--block-color) 78%, #1d2823); font-size:7px; font-style:normal; box-shadow:0 2px 7px rgba(0,0,0,.16); }
.snap-guide { position:absolute; z-index:15; left:0; right:0; height:1px; background:var(--brand); pointer-events:none; box-shadow:0 0 0 1px rgba(255,255,255,.6); }
.snap-guide span { position:absolute; right:4px; top:-10px; padding:2px 5px; border-radius:4px; color:white; background:var(--brand); font-size:7px; font-weight:700; box-shadow:0 2px 6px rgba(0,0,0,.14); }
.current-time { display: none; z-index: 7; pointer-events: none; position: absolute; left: 48px; right: 0; top: calc(58px + var(--now) * var(--hour-height) / 60); border-top: 1px solid #d96e5f; }
.current-time.visible { display: block; }
.current-time span { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: #d96e5f; }
.planner-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; padding: 13px; color: #888c84; font-size: 8px; }
.planner-legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--vital); }
.legend-dot.work { background: var(--work); }.legend-dot.projects { background: var(--projects); }.legend-dot.duties { background: var(--duties); }.legend-dot.relations { background: var(--relations); }.legend-dot.leisure { background: var(--leisure); }
.legend-hatch { width: 11px; height: 7px; border: 1px solid #d8ddd6; background: repeating-linear-gradient(-45deg, transparent 0, transparent 2px, #d8ddd6 2px, #d8ddd6 3px); }
.planner-layout.day-mode { grid-template-columns: var(--library-width) minmax(430px, 1fr); }
.planner-layout.day-mode:not(.library-open) { grid-template-columns: 0 minmax(430px, 1fr); }
.day-mode .calendar-grid { min-width: 480px; }

/* Projects */
.projects-view { max-width: 1280px; }
.projects-summary { display: flex; gap: 9px; margin-bottom: 17px; }
.summary-pill { padding: 8px 12px; border: 1px solid var(--line); background: rgba(255,255,252,.6); border-radius: 9px; font-size: 10px; color: var(--muted); }
.summary-pill strong { color: var(--ink); margin-right: 3px; }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.project-card { position: relative; min-height: 238px; padding: 21px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 15px; box-shadow: 0 7px 25px rgba(50,54,49,.035); overflow: hidden; cursor: pointer; transition: transform .18s, box-shadow .18s; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.project-card:after { content: ""; position: absolute; width: 130px; height: 130px; border-radius: 50%; right: -70px; top: -70px; background: var(--project-soft); }
.project-card-head { display: flex; align-items: center; justify-content: space-between; }
.project-card .project-symbol { width: 39px; height: 39px; background: var(--project-soft); color: var(--project-color); }
.project-menu { position: relative; z-index: 2; border: 0; background: transparent; color: #999; cursor: pointer; }
.project-card h2 { font: 600 16px "Manrope"; margin: 17px 0 6px; }
.project-card > p { color: var(--muted); font-size: 10px; line-height: 1.55; min-height: 31px; margin: 0 0 18px; }
.project-progress-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.project-progress-head strong { color: var(--ink); }
.project-progress-bar { margin: 7px 0 15px; height: 5px; background: #eeeeE9; border-radius: 5px; overflow: hidden; }
.project-progress-bar i { display: block; height: 100%; background: var(--project-color); border-radius: 5px; }
.project-next-task { display: flex; gap: 7px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line-soft); color: #656a62; font-size: 9px; }
.project-next-task i { flex: none; width: 9px; height: 9px; border: 1px solid var(--project-color); border-radius: 50%; }
.empty-project { border-style: dashed; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-project span { width: 40px; height: 40px; margin: auto; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 22px; }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 20px; background: rgba(37,41,37,.38); backdrop-filter: blur(3px); display: grid; place-items: center; opacity: 0; visibility: hidden; transition: .2s; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 30px); overflow-y: auto; padding: 24px; background: var(--surface); border-radius: 17px; box-shadow: 0 24px 70px rgba(28,33,29,.25); transform: translateY(10px) scale(.985); transition: .2s; }
.modal-backdrop.open .modal { transform: none; }
.small-modal { width: min(500px, 100%); }
.modal-head { display: flex; justify-content: space-between; margin-bottom: 20px; }
.modal-head h2 { font: 600 20px "Manrope"; margin: 5px 0 0; letter-spacing: -.5px; }
.close-modal { width: 32px; height: 32px; border: 0; background: var(--surface-2); color: #777; border-radius: 50%; font-size: 21px; cursor: pointer; }
.modal form { display: grid; gap: 14px; }
.modal label > span { display: block; margin-bottom: 6px; color: #666b63; font-size: 10px; font-weight: 600; }
.modal label em { color: #aaa; font-style: normal; font-weight: 400; }
.modal input, .modal select, .modal textarea { width: 100%; border: 1px solid #dedfd8; background: white; color: var(--ink); border-radius: 9px; outline: none; padding: 9px 10px; font-size: 12px; transition: border .15s, box-shadow .15s; }
.modal input, .modal select { height: 39px; }
.modal textarea { resize: vertical; min-height: 65px; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: #8fb1a2; box-shadow: 0 0 0 3px rgba(66,116,95,.08); }
.title-field input { font-size: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.schedule-toggle-row { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 10px 0; }
.switch-label { display: flex !important; align-items: center; gap: 9px; cursor: pointer; }
.switch-label input { display: none; }
.switch-label i { width: 31px; height: 18px; border-radius: 12px; background: #d7d9d3; position: relative; transition: .2s; }
.switch-label i:after { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch-label input:checked + i { background: var(--brand); }
.switch-label input:checked + i:after { transform: translateX(13px); }
.switch-label span { margin: 0 !important; color: var(--ink) !important; }
.schedule-fields.hidden { display: none; }
.modal-actions { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: 16px; margin-top: 2px; }
.modal-actions > div { display: flex; gap: 8px; }
.danger-text { border: 0; background: transparent; color: #b16759; cursor: pointer; padding: 7px 2px; font-size: 10px; }
.danger-text.hidden { visibility: hidden; }
.toast-stack { position: fixed; z-index: 130; bottom: 24px; right: 24px; display: grid; gap: 8px; }
.toast { min-width: 220px; max-width: 330px; padding: 11px 14px; color: white; background: #34463e; border-radius: 9px; box-shadow: 0 10px 30px rgba(32,40,35,.2); font-size: 11px; animation: toastIn .25s ease; }
.toast.warn { background: #9a6248; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.mobile-nav { display: none; }

/* Ajustes de formularios enriquecidos */
.duration-picker { height:39px; display:grid !important; grid-template-columns:1fr auto 1fr; align-items:center; gap:7px; margin:0 !important; }
.duration-picker > span { position:relative; min-width:0; }
.duration-picker input { padding-right:42px; text-align:right; }
.duration-picker small { position:absolute; right:8px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:8px; pointer-events:none; }
.duration-picker > b { color:var(--muted); font-weight:600; }
.advanced-schedule { display:grid; gap:10px; padding:2px 0 4px; }
.advanced-schedule.hidden { display:none; }
.advanced-schedule .switch-label { align-items:flex-start; }
.advanced-schedule .switch-label > span { display:grid; gap:2px; }
.advanced-schedule .switch-label strong { color:var(--ink); font-size:10px; }
.advanced-schedule .switch-label small { color:var(--muted); font-size:8px; font-weight:400; line-height:1.35; }
.weekday-picker { margin-left:40px; padding:10px 11px; border:1px solid var(--line-soft); border-radius:9px; background:var(--surface-2); }
.weekday-picker.hidden { display:none; }
.weekday-picker > span { color:var(--muted); font-size:8px; }
.weekday-picker > div { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; margin-top:7px; }
.weekday-picker button { height:29px; border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--muted); cursor:pointer; font-size:9px; font-weight:700; }
.weekday-picker button.active { color:white; background:var(--brand); border-color:var(--brand); box-shadow:0 3px 8px color-mix(in srgb, var(--brand) 22%, transparent); }
.project-icon-picker { display:grid; grid-template-columns:repeat(8,1fr); gap:6px; }
.project-icon-option { aspect-ratio:1; display:grid; place-items:center; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--muted); cursor:pointer; transition:.18s; }
.project-icon-option svg { width:19px; height:19px; }
.project-icon-option:hover { color:var(--brand); border-color:color-mix(in srgb, var(--brand) 45%, var(--line)); transform:translateY(-1px); }
.project-icon-option.active { color:var(--brand); border-color:var(--brand); background:var(--brand-soft); box-shadow:0 0 0 2px color-mix(in srgb, var(--brand) 10%, transparent); }
.project-icon-option.active svg { animation:iconAlive 1.7s ease-in-out infinite; }
@keyframes iconAlive { 0%,100%{transform:translateY(0) rotate(0)} 35%{transform:translateY(-2px) rotate(-4deg)} 70%{transform:translateY(0) rotate(4deg)} }
.project-color-picker { min-height:39px; display:flex; align-items:center; flex-wrap:wrap; gap:6px; padding:4px 0; }
.project-color-option { width:22px; height:22px; border:3px solid var(--surface); border-radius:50%; background:var(--swatch); box-shadow:0 0 0 1px var(--line); cursor:pointer; transition:.18s; }
.project-color-option:hover { transform:scale(1.1); }
.project-color-option.active { box-shadow:0 0 0 2px var(--swatch); transform:scale(1.06); }
.project-symbol svg { width:16px; height:16px; }
.project-card:hover .project-symbol svg, .project-preview:hover .project-symbol svg { animation:iconAlive 1.2s ease-in-out infinite; }

/* Opciones */
.settings-view { max-width:1120px; }
.settings-layout { display:grid; grid-template-columns:1.35fr .9fr; gap:17px; align-items:start; }
.settings-card { padding:24px; border:1px solid var(--line-soft); border-radius:16px; background:var(--surface); box-shadow:0 7px 25px rgba(50,54,49,.035); }
.theme-settings { grid-row:span 2; }
.settings-card-head { display:flex; gap:13px; align-items:flex-start; margin-bottom:20px; }
.settings-icon { flex:none; width:37px; height:37px; display:grid; place-items:center; border-radius:10px; color:var(--brand); background:var(--brand-soft); font-size:16px; }
.settings-card h2 { margin:1px 0 4px; font:600 15px "Manrope"; }
.settings-card p { margin:0; color:var(--muted); font-size:10px; line-height:1.5; }
.theme-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.theme-option { position:relative; min-height:126px; padding:11px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); text-align:left; cursor:pointer; transition:.18s; }
.theme-option:hover { transform:translateY(-1px); border-color:color-mix(in srgb, var(--brand) 38%, var(--line)); }
.theme-option.active { border-color:var(--brand); box-shadow:0 0 0 2px color-mix(in srgb, var(--brand) 10%, transparent); }
.theme-option > strong, .theme-option > small { display:block; }
.theme-option > strong { margin-top:9px; font-size:10px; }
.theme-option > small { margin-top:2px; color:var(--muted); font-size:8px; }
.theme-option > b { display:none; position:absolute; right:8px; bottom:8px; width:18px; height:18px; border-radius:50%; color:white; background:var(--brand); place-items:center; font-size:9px; }
.theme-option.active > b { display:grid; }
.theme-preview { height:52px; display:flex; align-items:flex-end; gap:5px; padding:8px; border-radius:7px; overflow:hidden; background:#f4f4ef; }
.theme-preview i { display:block; width:27%; border-radius:3px 3px 1px 1px; }
.theme-preview i:nth-child(1){height:45%;background:#315f52}.theme-preview i:nth-child(2){height:76%;background:#7ca497}.theme-preview i:nth-child(3){height:58%;background:#e6a564}
.theme-preview.ocean{background:#eef4f6}.theme-preview.ocean i:nth-child(1){background:#2d6f7a}.theme-preview.ocean i:nth-child(2){background:#79aeb6}.theme-preview.ocean i:nth-child(3){background:#e2a765}
.theme-preview.clay{background:#f6eee7}.theme-preview.clay i:nth-child(1){background:#9a5f43}.theme-preview.clay i:nth-child(2){background:#c98c6d}.theme-preview.clay i:nth-child(3){background:#d99c58}
.theme-preview.lavender{background:#f1edf5}.theme-preview.lavender i:nth-child(1){background:#75619a}.theme-preview.lavender i:nth-child(2){background:#aa98c2}.theme-preview.lavender i:nth-child(3){background:#d49a72}
.theme-preview.midnight{background:#18201f}.theme-preview.midnight i:nth-child(1){background:#7db3a3}.theme-preview.midnight i:nth-child(2){background:#465f59}.theme-preview.midnight i:nth-child(3){background:#e4aa6d}
.data-action-row { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:16px 0; border-top:1px solid var(--line-soft); }
.data-action-row:first-of-type { border-top:0; }
.data-action-row strong, .data-action-row span { display:block; }
.data-action-row strong { font-size:10px; }
.data-action-row span { max-width:270px; margin-top:3px; color:var(--muted); font-size:8px; line-height:1.4; }
.danger-row { margin-top:3px; padding:15px; border:1px solid color-mix(in srgb, #b75f54 22%, var(--line)); border-radius:10px; background:color-mix(in srgb, #b75f54 6%, var(--surface)); }
.danger-btn { flex:none; min-height:36px; padding:0 12px; border:1px solid #bc6a5f; border-radius:9px; color:#a94f45; background:transparent; cursor:pointer; font-size:9px; font-weight:700; }
.danger-btn:hover { color:white; background:#aa5b51; }
.principle-list { display:grid; gap:10px; }
.principle-list span { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:9px; line-height:1.4; }
.principle-list i { flex:none; width:7px; height:7px; border-radius:50%; background:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }

/* Ajustes del tema nocturno para superficies que deliberadamente eran blancas */
:root[data-theme="midnight"] .sidebar, :root[data-theme="midnight"] .topbar, :root[data-theme="midnight"] .mobile-nav { background:rgba(28,37,35,.96); }
:root[data-theme="midnight"] .icon-btn, :root[data-theme="midnight"] .mini-icon-btn, :root[data-theme="midnight"] .outline-btn, :root[data-theme="midnight"] .today-btn, :root[data-theme="midnight"] .week-nav button, :root[data-theme="midnight"] .view-switch button.active, :root[data-theme="midnight"] .library-search, :root[data-theme="midnight"] .library-filter-row>button, :root[data-theme="midnight"] .filter-pills button, :root[data-theme="midnight"] .library-task, :root[data-theme="midnight"] .day-headers, :root[data-theme="midnight"] .calendar-wrap, :root[data-theme="midnight"] .modal, :root[data-theme="midnight"] .modal input, :root[data-theme="midnight"] .modal select, :root[data-theme="midnight"] .modal textarea, :root[data-theme="midnight"] .global-search, :root[data-theme="midnight"] .search-results { background:var(--surface); color:var(--ink); }
:root[data-theme="midnight"] .calendar-corner, :root[data-theme="midnight"] .time-labels { background:var(--surface-2); }
:root[data-theme="midnight"] .day-column { background-color:var(--surface); background-image:repeating-linear-gradient(to bottom,transparent 0,transparent calc(var(--hour-height) - 1px),var(--line) calc(var(--hour-height) - 1px),var(--line) var(--hour-height)),repeating-linear-gradient(to bottom,transparent 0,transparent calc(var(--hour-height)/2 - 1px),rgba(120,140,132,.12) calc(var(--hour-height)/2 - 1px),rgba(120,140,132,.12) calc(var(--hour-height)/2)); }
:root[data-theme="midnight"] .free-time-card, :root[data-theme="midnight"] .week-note, :root[data-theme="midnight"] .week-insight { background:#293833; border-color:#384a44; }
:root[data-theme="midnight"] .general-balance, :root[data-theme="midnight"] .add-quiet-btn { background:var(--surface-2); }

@media (max-width: 1160px) {
  :root { --sidebar: 190px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.4fr) minmax(250px, .8fr); }
  .today-card { grid-row: span 2; }
  .balance-card { grid-column: span 2; }
  .projects-preview-card { grid-column: auto; }
  .conflict-card { grid-column: span 2; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; --topbar: 60px; }
  body { padding-bottom: 68px; }
  .sidebar { transform: translateX(-100%); width: 230px; transition: transform .25s; box-shadow: 10px 0 35px rgba(30,35,31,.12); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 17px; justify-content: space-between; }
  .mobile-menu { display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; }
  .mobile-brand { display: block; position: absolute; left: 50%; transform: translateX(-50%); font: 700 17px "Manrope"; }
  .save-state { display: none; }
  .topbar .primary-btn { display: none; }
  .view { padding: 27px 17px 40px; }
  .global-search { top: 7px; left: 50%; width: calc(100vw - 34px); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .today-card { grid-row: auto; }
  .today-card, .balance-card, .conflict-card { grid-column: span 2; }
  .mobile-nav { position: fixed; z-index: 50; bottom: 0; left: 0; right: 0; height: 65px; padding: 6px 16px max(5px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: rgba(255,255,252,.96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .mobile-nav button { border: 0; background: transparent; color: #858981; display: grid; place-items: center; gap: 2px; font-size: 8px; cursor: pointer; }
  .mobile-nav button.active { color: var(--brand); }
  .mobile-nav svg { width: 18px; height: 18px; }
  .mobile-nav button:first-child svg { fill: currentColor; stroke: none; }
  .mobile-nav .mobile-add { align-self: start; width: 45px; height: 45px; margin: -15px auto 0; border-radius: 50%; background: var(--brand); color: white; box-shadow: 0 5px 16px rgba(49,95,82,.23); font-size: 24px; }
  .planner-view { padding: 24px 12px 20px; }
  .planner-header { align-items: flex-start; }
  .planner-tools { padding-top: 18px; }
  .planner-layout { grid-template-columns: 0 minmax(700px, 1fr); max-height: calc(100vh - 220px); }
  .planner-layout.library-open { grid-template-columns: min(78vw, var(--library-width)) minmax(700px, 1fr); }
  .task-library { width: 100%; }
  .planner-layout.day-mode, .planner-layout.day-mode:not(.library-open) { grid-template-columns: 0 minmax(430px, 1fr); }
  .planner-layout.day-mode.library-open { grid-template-columns: min(78vw, var(--library-width)) minmax(430px, 1fr); }
  .settings-layout { grid-template-columns:1fr; }
  .theme-settings { grid-row:auto; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .page-heading { align-items: flex-start; margin-bottom: 20px; }
  .page-heading .outline-btn { display: none; }
  .page-heading h1 { font-size: 24px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .today-card, .balance-card, .conflict-card { grid-column: auto; }
  .today-card { min-height: auto; }
  .free-time-card { order: -1; }
  .balance-card { padding: 18px; }
  .general-balance { grid-template-columns: 1fr; gap: 10px; }
  .area-balances { grid-template-columns: 1fr; }
  .area-balance-row { grid-template-columns: 100px 1fr; }
  .dashboard-heading { margin-bottom: 18px; }
  .dashboard-heading .subheading { font-size: 11px; }
  .planner-header { display: block; }
  .planner-tools { justify-content: space-between; padding-top: 14px; }
  .week-insight { align-items: flex-start; }
  .planner-layout { min-height: 650px; max-height: calc(100vh - 245px); }
  .planner-legend { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .project-grid { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns:1fr 1fr; }
  .data-action-row { align-items:flex-start; }
  .projects-summary { overflow-x: auto; }
  .summary-pill { white-space: nowrap; }
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .modal { padding: 19px; }
  .modal-actions { align-items: flex-end; }
  .modal-actions > div { flex-direction: column-reverse; }
  .modal-actions .outline-btn, .modal-actions .primary-btn { height: 37px; }
  .project-icon-picker { grid-template-columns:repeat(4,1fr); }
}

@media (max-width: 430px) {
  .theme-grid { grid-template-columns:1fr; }
  .data-action-row { flex-direction:column; }
  .data-action-row .outline-btn, .data-action-row .danger-btn { width:100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
