:root {
  --bg: #F7F1E7;
  --bg2: #FFF8EC;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #FFFFFF;
  --surface-soft: #FFF3DD;
  --text: #2D2A26;
  --muted: #7F786E;
  --primary: #6F8F72;
  --primary-dark: #49664D;
  --primary-light: #DDEBDA;
  --accent: #C76F4A;
  --accent-dark: #9B4B2F;
  --success: #3F8F5B;
  --warning: #D49A3A;
  --danger: #B85C5C;
  --blue: #79A9D6;
  --violet: #9E8DD7;
  --gold: #F4C063;
  --border: rgba(96, 78, 55, 0.16);
  --shadow: rgba(50, 38, 27, 0.12);
  --shadow-strong: rgba(50, 38, 27, 0.22);
  --radius: 24px;
  --font: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --round: 'Fredoka', var(--font);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 5%, rgba(244, 192, 99, 0.28), transparent 30rem),
    radial-gradient(circle at 92% 86%, rgba(111, 143, 114, 0.24), transparent 34rem),
    linear-gradient(180deg, #fffaf1 0%, #f7f1e7 52%, #eee2d4 100%);
  font-family: var(--font);
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

/* ambient background */
.ambient-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient-bg::before {
  content: '';
  position: absolute;
  inset: auto -10% 0;
  height: 27vh;
  background: linear-gradient(180deg, transparent, rgba(111, 143, 114, 0.10));
}
.cloud {
  position: absolute;
  width: 130px;
  height: 46px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  filter: blur(0.2px);
  box-shadow: 0 12px 30px rgba(96, 78, 55, 0.06);
  animation: cloudDrift 56s linear infinite;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud::before { width: 72px; height: 72px; left: 18px; top: -32px; }
.cloud::after { width: 58px; height: 58px; right: 18px; top: -24px; }
.cloud-a { top: 10vh; left: -160px; animation-duration: 72s; }
.cloud-b { top: 28vh; left: 60vw; transform: scale(0.72); animation-duration: 92s; animation-direction: reverse; }
.cloud-c { top: 58vh; left: 20vw; transform: scale(0.55); opacity: 0.5; animation-duration: 110s; }
@keyframes cloudDrift { from { translate: -180px 0; } to { translate: calc(100vw + 240px) 0; } }
.leaf {
  position: absolute;
  font-size: 28px;
  opacity: 0.34;
  filter: drop-shadow(0 5px 10px rgba(80, 64, 40, 0.16));
  animation: floatLeaf 8s ease-in-out infinite;
}
.leaf-a { left: 8%; top: 72%; animation-duration: 7.5s; }
.leaf-b { right: 9%; top: 18%; animation-duration: 9s; animation-delay: 0.8s; }
.leaf-c { right: 18%; bottom: 18%; animation-duration: 10s; animation-delay: 1.6s; }
@keyframes floatLeaf { 0%,100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-18px) rotate(10deg); } }
.sparkle-field { position: absolute; inset: 0; }
.twinkle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(244, 192, 99, 0.85);
  box-shadow: 0 0 12px rgba(244, 192, 99, 0.75);
  animation: twinkle 2.8s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: 0.14; transform: scale(0.65); } 50% { opacity: 0.95; transform: scale(1.25); } }
.burst-layer { position: fixed; inset: 0; z-index: 120; pointer-events: none; overflow: hidden; }

/* login */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.login-card {
  width: min(430px, 100%);
  background: rgba(255,255,255,.88);
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px var(--shadow-strong), 0 8px 0 rgba(111,143,114,.16);
  border-radius: 34px;
  padding: 34px;
  text-align: center;
  animation: popIn 500ms cubic-bezier(.22,1.6,.36,1);
  backdrop-filter: blur(18px);
}
.login-logo { width: 155px; height: 95px; object-fit: contain; margin-bottom: 10px; filter: drop-shadow(0 8px 18px rgba(50,38,27,.12)); }
.login-card h1 { margin: 0; font-family: var(--round); font-size: 38px; letter-spacing: -0.03em; }
.login-card p { color: var(--muted); margin: 8px 0 24px; font-weight: 700; }
.login-form { text-align: left; display: grid; gap: 10px; }
.login-form label { font-weight: 900; color: var(--primary-dark); }
.login-form input { height: 50px; border-radius: 17px; border: 2px solid var(--border); padding: 0 14px; background: var(--surface-soft); outline: none; }
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 5px rgba(111,143,114,.16); }
.login-form button,.primary-btn { min-height: 46px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #7EA47E, var(--primary-dark)); color: #fff; padding: 0 18px; font-weight: 900; box-shadow: 0 5px 0 #354D38; transition: transform 120ms ease, box-shadow 120ms ease; }
.login-form button:active,.primary-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #354D38; }
.login-error { background: rgba(184,92,92,.12); color: var(--danger); border: 1px solid rgba(184,92,92,.25); border-radius: 14px; padding: 10px 12px; margin-bottom: 16px; }

/* layout */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; position: relative; z-index: 1; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: rgba(255, 249, 238, .78);
  backdrop-filter: blur(20px);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 12px 0 40px rgba(80,64,40,.05);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px 24px; }
.brand-logo { width: 52px; height: 52px; object-fit: contain; border-radius: 17px; background: #fff; box-shadow: 0 8px 24px rgba(80,64,40,.08); }
.brand strong { display: block; font-family: var(--round); font-size: 22px; letter-spacing: -.02em; }
.brand span { color: var(--muted); font-size: 13px; font-weight: 900; }
.side-nav { display: grid; gap: 8px; }
.nav-link {
  min-height: 46px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 14px;
  border-radius: 17px;
  font-weight: 900;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}
.nav-link:hover { background: rgba(255,255,255,.58); transform: translateX(2px); }
.nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 6px 0 rgba(53,77,56,.55), 0 12px 28px rgba(73,102,77,.20);
}
.sidebar-footer { margin-top: auto; padding: 14px 10px; }
.sidebar-footer a { color: var(--muted); text-decoration: none; font-weight: 800; }

.main-shell { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(255, 250, 242, .80);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(80,64,40,.06);
}
.topbar-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.topbar-logo { width: 50px; height: 50px; object-fit: contain; display: none; background: #fff; border-radius: 16px; flex: 0 0 auto; box-shadow: 0 8px 22px rgba(80,64,40,.08); }
.app-title { font-family: var(--round); font-size: 26px; font-weight: 900; line-height: 1.05; letter-spacing: -.03em; }
.date-label { color: var(--muted); font-size: 14px; font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.author-select {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  padding: 0 14px;
  font-weight: 900;
  box-shadow: 0 7px 22px rgba(80,64,40,.08);
}
.top-add {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #DB845C, var(--accent));
  color: #fff;
  font-size: 30px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 5px 0 var(--accent-dark), 0 12px 24px rgba(199,111,74,.24);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.top-add:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-dark); }

.sync-pill,.pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  white-space: nowrap;
}
.sync-pill.ok { color: var(--primary-dark); border-color: rgba(111,143,114,.28); background: rgba(111,143,114,.13); }
.sync-pill.saving { color: #8B6723; border-color: rgba(212,154,58,.3); background: rgba(212,154,58,.14); }
.sync-pill.offline,.sync-pill.conflict { color: var(--danger); border-color: rgba(184,92,92,.3); background: rgba(184,92,92,.14); }

.view-root { padding: 26px; max-width: 1030px; margin: 0 auto; animation: viewEnter 300ms ease-out both; }
.view-head { margin-bottom: 18px; display: flex; justify-content: space-between; gap: 14px; align-items: flex-end; }
.view-head h1 { margin: 0 0 6px; font-family: var(--round); font-size: clamp(30px,4vw,44px); letter-spacing: -.035em; }
.view-head p { margin: 0; color: var(--muted); font-weight: 800; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }

.card,.task-card,.target-card,.area-card,.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 55px var(--shadow), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(16px);
}
.card,.area-card,.target-card,.note-card { padding: 18px; animation: cardIn 260ms ease-out both; }
.card h2,.card h3,.area-card h3,.target-card h3,.note-card h3 { margin: 0 0 8px; font-family: var(--round); letter-spacing: -.02em; }
.task-description,.area-card p,.target-card p,.note-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.56; font-weight: 700; }
.lede { font-size: 17px; color: var(--muted); line-height: 1.5; margin: 0; }

.section-title { margin: 26px 0 12px; font-family: var(--round); font-size: 20px; letter-spacing: -.02em; }
.task-list { display: grid; gap: 10px; }

.task-card {
  position: relative;
  overflow: visible;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  animation: cardIn 260ms ease-out both;
}
.task-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: .74;
}
.task-card.done { opacity: .58; filter: saturate(.86); }
.task-card.done::after {
  content: '✓';
  position: absolute;
  right: 14px;
  top: -10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, var(--success), #2F7247);
  border: 3px solid #fff;
  box-shadow: 0 8px 20px rgba(63,143,91,.25);
  font-weight: 900;
}
.task-card.overdue {
  border-color: rgba(184,92,92,.42);
  background: linear-gradient(135deg, rgba(184,92,92,.09), rgba(255,255,255,.90));
  animation: cardIn 260ms ease-out both, softWarn 2.6s ease-in-out infinite;
}
.task-card.open { box-shadow: 0 28px 70px rgba(50,38,27,.18), inset 0 1px 0 rgba(255,255,255,.8); transform: translateY(-1px); }
.task-row {
  width: 100%;
  min-height: 62px;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 15px 17px 15px 20px;
}
.task-row-title { font-family: var(--round); font-size: 18px; font-weight: 900; line-height: 1.2; color: var(--text); letter-spacing: -.01em; }
.task-row-sub { color: var(--muted); font-size: 13px; margin-top: 4px; font-weight: 800; }
.person-tag { background: rgba(111,143,114,.15); color: var(--primary-dark); border-color: rgba(111,143,114,.28); }
.johanna-tag { background: rgba(199,111,74,.14); color: var(--accent-dark); border-color: rgba(199,111,74,.28); }
.shared-tag { background: rgba(212,154,58,.15); color: #805D1E; border-color: rgba(212,154,58,.28); }
.overdue-pill { background: rgba(184,92,92,.14); color: var(--danger); border-color: rgba(184,92,92,.25); }
.chevron { font-size: 22px; color: var(--muted); transform: rotate(0deg); transition: transform 160ms ease; }
.task-card.open .chevron { transform: rotate(180deg); }

.task-details {
  display: none;
  padding: 0 17px 17px 20px;
  border-top: 1px dashed rgba(96,78,55,.18);
}
.task-card.open .task-details { display: block; animation: openDetails 190ms cubic-bezier(.22,1.3,.36,1); }
.detail-block { margin-top: 14px; }
.detail-block h4 { margin: 0 0 7px; font-size: 13px; color: var(--primary-dark); text-transform: uppercase; letter-spacing: .06em; }
.hint-box { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 16px; padding: 12px; color: var(--muted); line-height: 1.45; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.status-offen { background: #F1EEE9; }
.status-läuft { background: rgba(111,143,114,.16); color: var(--primary-dark); }
.status-erledigt { background: rgba(63,143,91,.16); color: var(--success); }
.status-blockiert { background: rgba(184,92,92,.14); color: var(--danger); }
.status-übersprungen { background: rgba(212,154,58,.16); color: #805D1E; }

.task-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 14px; }
.more-menu-wrap { position: relative; }
.more-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 48px;
  z-index: 25;
  min-width: 218px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px var(--shadow-strong);
  border-radius: 20px;
  padding: 9px;
  backdrop-filter: blur(18px);
}
.more-menu.open { display: grid; gap: 6px; animation: popIn 160ms ease-out; }
.more-menu .btn { width: 100%; justify-content: flex-start; }

.btn {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.78);
  color: var(--text);
  padding: 0 14px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(96,78,55,.12);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 0 rgba(96,78,55,.12); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(96,78,55,.18); }
.btn.primary { background: linear-gradient(180deg, #7EA47E, var(--primary-dark)); border-color: var(--primary); color: #fff; box-shadow: 0 4px 0 #354D38; }
.btn.success { background: linear-gradient(180deg, #56A66B, var(--success)); border-color: var(--success); color: #fff; box-shadow: 0 4px 0 #2E6B43; }
.btn.warn { background: rgba(184,92,92,.12); border-color: rgba(184,92,92,.22); color: var(--danger); }
.btn.accent { background: linear-gradient(180deg, #DB845C, var(--accent)); border-color: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-dark); }
.btn.ghost { background: transparent; }
.btn.icon { width: 46px; padding: 0; font-size: 20px; }

.week-nav { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.week-days { display: grid; grid-template-columns: repeat(7,minmax(96px,1fr)); gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.day-card {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.82);
  border-radius: 20px;
  padding: 12px;
  min-height: 92px;
  box-shadow: 0 10px 28px rgba(80,64,40,.08);
  transition: transform 140ms ease, border-color 140ms ease;
}
.day-card:hover { transform: translateY(-2px); }
.day-card-active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary), 0 14px 34px rgba(111,143,114,.12); background: rgba(221,235,218,.75); }
.day-card strong { display: block; font-family: var(--round); }
.day-card span { color: var(--muted); font-size: 13px; font-weight: 800; }
.day-section { padding: 18px; }
.day-section-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.day-section-head h3 { margin: 0 0 6px; font-family: var(--round); }
.day-section-head p { margin: 0; color: var(--muted); font-weight: 800; }
.progress-bar { height: 10px; overflow: hidden; border-radius: 999px; background: #E8DECF; margin-top: 14px; }
.progress-bar span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg,var(--primary),var(--gold),var(--accent)); border-radius: 999px; transition: width 320ms ease; }

.search-input,.form-input,.textarea,select.form-input {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  padding: 14px;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.search-input:focus,.form-input:focus,.textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 5px rgba(111,143,114,.13); }
.textarea { min-height: 120px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.form-label { display: grid; gap: 6px; font-weight: 900; color: var(--text); }
.form-label span { font-size: 13px; color: var(--muted); font-weight: 900; }
.form-actions,.target-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.empty-state { text-align: center; padding: 30px 18px; color: var(--muted); font-weight: 800; }
.import-help { background: #241D18; color: #fff8ec; padding: 14px; border-radius: 16px; overflow: auto; font-size: 13px; border: 1px solid rgba(244,192,99,.28); }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(46,36,28,.36); display: grid; place-items: center; padding: 18px; backdrop-filter: blur(5px); }
.modal-backdrop.hidden { display: none; }
.modal-card { width: min(720px,100%); max-height: min(86vh,800px); overflow: auto; background: rgba(255,255,255,.96); border-radius: 30px; box-shadow: 0 32px 100px rgba(50,38,27,.24), 0 8px 0 rgba(111,143,114,.15); padding: 26px; position: relative; animation: modalIn 220ms cubic-bezier(.22,1.35,.36,1); }
.modal-close { position: absolute; right: 14px; top: 14px; width: 42px; height: 42px; border: 0; border-radius: 999px; background: var(--surface-soft); font-size: 30px; line-height: 1; color: var(--text); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 140; background: rgba(73,102,77,.96); color: #fff; padding: 13px 18px; border-radius: 999px; box-shadow: 0 18px 50px var(--shadow-strong), 0 0 0 1px rgba(255,255,255,.25) inset; font-weight: 900; animation: toastIn 240ms cubic-bezier(.22,1.4,.36,1); }
.toast.hidden { display: none; }

.bottom-nav { display: none; }
.confetti-piece {
  position: fixed;
  top: -20px;
  z-index: 130;
  pointer-events: none;
  will-change: transform, opacity;
  animation: confettiFall 1500ms cubic-bezier(.12,.78,.28,1) forwards;
  font-size: 18px;
}
.confetti-dot {
  position: fixed;
  z-index: 130;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  pointer-events: none;
  animation: confettiFall 1400ms cubic-bezier(.12,.78,.28,1) forwards;
}
.reward-burst {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 132;
  padding: 16px 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: var(--primary-dark);
  font-family: var(--round);
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 18px 60px rgba(50,38,27,.22), 0 0 0 2px rgba(111,143,114,.18) inset;
  animation: rewardPop 1200ms cubic-bezier(.22,1.5,.36,1) forwards;
}

@keyframes viewEnter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes openDetails { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes softWarn { 0%,100% { box-shadow: 0 20px 55px var(--shadow), 0 0 0 rgba(184,92,92,0); } 50% { box-shadow: 0 20px 55px var(--shadow), 0 0 26px rgba(184,92,92,.16); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 18px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes confettiFall { 0% { transform: translate3d(0,-20px,0) rotate(0deg); opacity: 1; } 78% { opacity: 1; } 100% { transform: translate3d(var(--x, 0px), 108vh, 0) rotate(760deg); opacity: 0; } }
@keyframes rewardPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-4deg); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(2deg); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); } 100% { opacity: 0; transform: translate(-50%, -78%) scale(.92); } }

@media (max-width: 920px) {
  .app-shell { display: block; padding-bottom: 108px; }
  .sidebar { display: none; }
  .topbar { min-height: 72px; padding: 10px 12px; }
  .topbar-logo { display: block; width: 42px; height: 42px; }
  .app-title { font-size: 22px; }
  .date-label { font-size: 12px; }
  .topbar-actions { gap: 6px; }
  .sync-pill { display: none; }
  .author-select { max-width: 118px; min-height: 42px; font-size: 16px; }
  .top-add { width: 46px; height: 46px; }
  .view-root { padding: 16px 12px 140px; }
  .view-head { display: block; }
  .view-head .btn.accent { margin-top: 10px; }
  .grid.two,.grid.three,.form-grid { grid-template-columns: 1fr; }
  .week-nav { grid-template-columns: 1fr; }
  .week-nav .btn { width: 100%; }
  .day-section-head { display: block; }
  .task-row { min-height: 64px; grid-template-columns: 1fr auto auto; padding: 14px 14px 14px 18px; }
  .task-row-title { font-size: 17px; }
  .task-row-sub { font-size: 12px; }
  .task-details { padding: 0 14px 14px 18px; }
  .task-actions { grid-template-columns: 1fr auto; }
  .task-actions .btn.success { min-height: 50px; font-size: 17px; }
  .btn.icon { min-width: 50px; height: 50px; font-size: 22px; }
  .more-menu { right: -2px; top: 56px; min-width: 228px; }
  .bottom-nav { position: fixed; z-index: 30; left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; padding: 7px; background: rgba(255,255,255,.90); border: 1px solid var(--border); border-radius: 26px; box-shadow: 0 18px 60px rgba(50,38,27,.22), inset 0 1px 0 rgba(255,255,255,.8); backdrop-filter: blur(20px); }
  .bottom-nav .nav-link { min-height: 56px; padding: 0 4px; text-align: center; font-size: 20px; border-radius: 18px; display: grid; place-items: center; gap: 0; box-shadow: none; }
  .bottom-nav .nav-link span { font-size: 11px; display: block; }
  .bottom-nav .nav-link.active { box-shadow: 0 4px 0 rgba(53,77,56,.50); }
  .modal-card { padding: 20px; border-radius: 24px; }
}

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

/* v7: static, calmer shell. Ambient background nodes are removed in HTML, this is a safety net. */
.ambient-bg,
.cloud,
.leaf,
.sparkle-field,
.twinkle {
  display: none !important;
  animation: none !important;
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(244, 192, 99, 0.18), transparent 28rem),
    radial-gradient(circle at 95% 90%, rgba(111, 143, 114, 0.16), transparent 34rem),
    linear-gradient(180deg, #fffaf1 0%, #f7f1e7 58%, #efe5d8 100%);
}

.task-row-card {
  overflow: hidden;
}

.task-row-card:hover {
  transform: translateY(-1px);
}

.task-row {
  width: 100%;
  min-height: 64px;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 15px 16px;
}

.task-row-title {
  font-family: var(--round);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

.task-row-sub {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-top: 4px;
}

.chevron {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.task-detail-sheet h2 {
  margin: 0;
  font-family: var(--round);
  font-size: clamp(25px, 5vw, 34px);
  line-height: 1.08;
}

.task-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.task-detail-head p {
  color: var(--muted);
  font-weight: 800;
  margin: 8px 0 0;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.detail-actions .btn.success {
  grid-column: 1 / -1;
  min-height: 48px;
}

.floor-list {
  display: grid;
  gap: 22px;
}

.floor-section {
  animation: cardPop 280ms cubic-bezier(.22, 1.3, .36, 1);
}

.floor-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.floor-head h2 {
  margin: 0;
  font-family: var(--round);
  font-size: 23px;
  letter-spacing: -0.02em;
}

.area-card-v7 {
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.area-card-v7:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 56px rgba(50, 38, 27, 0.16), 0 5px 0 rgba(111,143,114,.18);
}

.modal-backdrop.sheet-mode {
  place-items: center;
}

.modal-backdrop.sheet-mode .modal-card {
  width: min(760px, calc(100vw - 28px));
}

@media (max-width: 920px) {
  .task-row {
    min-height: 62px;
    padding: 14px;
  }

  .task-row-title {
    font-size: 17px;
  }

  .task-row-sub {
    font-size: 12px;
  }

  .task-row .pill {
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .modal-backdrop.sheet-mode {
    place-items: end center;
    padding: 10px;
  }

  .modal-backdrop.sheet-mode .modal-card {
    width: 100%;
    max-height: 82vh;
    border-radius: 28px 28px 18px 18px;
    animation: sheetUp 210ms cubic-bezier(.22, 1.3, .36, 1);
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .floor-head h2 {
    font-size: 21px;
  }
}

@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* v7.1 performance pass: fewer paints, no constant visual work while scrolling */
:root {
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --round: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { scroll-behavior: auto; }

body {
  background: linear-gradient(180deg, #fffaf1 0%, #f7f1e7 58%, #efe5d8 100%) !important;
}

.view-root,
.card,
.task-card,
.area-card,
.target-card,
.note-card,
.floor-section {
  animation: none !important;
}

.card,
.task-card,
.target-card,
.area-card,
.note-card {
  backdrop-filter: none !important;
  box-shadow: 0 6px 18px rgba(50, 38, 27, 0.10), inset 0 1px 0 rgba(255,255,255,.7) !important;
}

.sidebar,
.topbar,
.bottom-nav,
.modal-backdrop,
.modal-card,
.more-menu,
.login-card {
  backdrop-filter: none !important;
}

.topbar {
  box-shadow: 0 3px 10px rgba(80,64,40,.06) !important;
}

.bottom-nav {
  box-shadow: 0 8px 24px rgba(50,38,27,.16), inset 0 1px 0 rgba(255,255,255,.75) !important;
}

.task-card,
.area-card-v7,
.day-section {
  content-visibility: auto;
  contain-intrinsic-size: 86px;
}

.task-card.overdue {
  animation: none !important;
}

.task-card.done {
  filter: none !important;
}

.task-card.done::after {
  top: 9px !important;
  right: 10px !important;
  width: 34px !important;
  height: 34px !important;
  border-width: 2px !important;
  box-shadow: 0 4px 12px rgba(63,143,91,.22) !important;
  line-height: 1 !important;
}

.task-card.done .task-row {
  padding-right: 58px !important;
}

.btn,
.nav-link,
.task-row,
.day-card,
.area-card-v7,
.top-add {
  transition: transform 90ms ease, background-color 90ms ease, box-shadow 90ms ease !important;
}

@media (max-width: 920px) {
  .task-row-card:hover,
  .day-card:hover,
  .area-card-v7:hover,
  .btn:hover {
    transform: none !important;
  }

  .task-card,
  .area-card-v7,
  .day-section {
    contain-intrinsic-size: 78px;
  }

  .modal-backdrop.sheet-mode .modal-card {
    animation: sheetUp 150ms ease-out !important;
  }
}


/* v7.2 fixes */
.modal-card {
  padding-top: 62px;
}

.modal-close {
  z-index: 5;
  top: 12px;
  right: 12px;
}

.task-detail-head {
  padding-right: 54px;
}

.task-detail-head .pill {
  display: none;
}

@media (max-width: 920px) {
  .modal-card {
    padding-top: 60px;
  }

  .task-detail-head {
    padding-right: 0;
  }
}
