:root,
html[data-theme="barack"] {
  --primary: #FF8B5E;
  --primary-light: #FFE6DC;
  --bg: #FAFBFC;
  --surface: #FFFFFF;
  --ink: #1A1A1A;
  --muted: #6B7280;
  --border: #E5E7EB;
  --success: #22C55E;
  --error: #EF4444;
  --warning: #F59E0B;
  --accent: #FB923C;
  --glow: 255, 139, 94;
  --brand-from: #FFB08A;
  --brand-to: #FF8B5E;
  --coral: var(--primary);
  --peach: var(--primary-light);
  --paper: var(--surface);
  --shadow: 0 12px 32px rgba(26, 26, 26, 0.08);
  --nav-h: 96px;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Poppins", system-ui, sans-serif;
  --radius: 24px;
}
html[data-theme="lila"] {
  --primary: #9B7BB8;
  --primary-light: #EDE4F5;
  --accent: #B794D4;
  --glow: 155, 123, 184;
  --brand-from: #C4A8DC;
  --brand-to: #9B7BB8;
}
html[data-theme="kek"] {
  --primary: #5BA4D6;
  --primary-light: #D7ECF8;
  --accent: #7BB8E0;
  --glow: 91, 164, 214;
  --brand-from: #8EC4E6;
  --brand-to: #5BA4D6;
}
html[data-theme="zold"] {
  --primary: #5AA67A;
  --primary-light: #DCEFE4;
  --accent: #7CBC96;
  --glow: 90, 166, 122;
  --brand-from: #8EC9A6;
  --brand-to: #5AA67A;
}
html[data-theme="rozsa"] {
  --primary: #E56B8A;
  --primary-light: #FBE0E8;
  --accent: #F08AA3;
  --glow: 229, 107, 138;
  --brand-from: #F099B0;
  --brand-to: #E56B8A;
}
html[data-theme="homok"] {
  --primary: #C4A574;
  --primary-light: #F3E9D8;
  --accent: #D4B892;
  --glow: 196, 165, 116;
  --brand-from: #DCC4A0;
  --brand-to: #C4A574;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  background: #e8eef3;
  color: var(--ink);
}

img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

.device {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  background: #eef2f6;
}

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--surface) 240px, var(--bg) 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(26, 26, 26, .12);
}

.screen {
  min-height: 100dvh;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page-title,
.editorial {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 36px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.h2 { font-family: var(--sans); font-size: 20px; font-weight: 600; line-height: 28px; }
.h3 { font-family: var(--sans); font-size: 18px; font-weight: 500; line-height: 26px; }
.body-lg { font-size: 16px; line-height: 24px; }
.caption, .tiny { font-size: 12px; line-height: 16px; color: var(--muted); }

.muted { color: var(--muted); }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.gap16 { gap: 16px; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; object-position: center center;
  background: var(--primary-light);
  box-shadow: 0 0 0 2px #fff;
}
.avatar.sm { width: 24px; height: 24px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.7); }
.avatar.lg { width: 72px; height: 72px; }

.home-top { padding-top: 8px; }
.greet-wrap { flex: 1; min-width: 0; padding-left: 12px; }
.greet {
  font-size: 18px;
  line-height: 26px;
  font-weight: 400;
  color: var(--ink);
}
.greet strong { font-weight: 600; }
.greet-date {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
  margin-top: 1px;
}

.bell {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(26,26,26,.06);
  display: grid; place-items: center;
  position: relative;
  color: var(--ink);
}
.bell svg { width: 20px; height: 20px; }
.badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--error); color: #fff;
  font-size: 10px; font-weight: 600; display: grid; place-items: center;
}

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin: 22px 0 4px;
}
.week-day {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0 10px;
  border-radius: 20px;
  color: var(--muted);
}
.week-day small { font-size: 11px; font-weight: 400; line-height: 16px; }
.week-day b {
  font-size: 16px; font-weight: 600; line-height: 24px;
  color: var(--ink); margin-top: 4px;
}
.week-day.active {
  background: #fff;
  box-shadow: 0 0 0 1.5px var(--primary-light), 0 8px 18px rgba(var(--glow), .16);
  color: var(--primary);
}
.week-day.active b { color: var(--ink); }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: 24px 0 14px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 36px;
  letter-spacing: -0.02em;
}
.add-link {
  font-size: 14px; font-weight: 500; line-height: 20px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
  color: var(--ink);
}

.attention-intro {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  margin: 0 0 14px;
}

.event-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  height: 210px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  color: #fff;
}
.event-card img.cover {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.event-card .scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(26,26,26,.04) 28%, rgba(26,26,26,.58) 100%);
}
.event-card.pending .cover { filter: saturate(.7) blur(6px); transform: scale(1.06); }
.chip {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(26, 26, 26, .38);
  backdrop-filter: blur(10px);
  color: #fff; border-radius: 999px;
  padding: 3px 10px 3px 3px;
  font-size: 12px; font-weight: 500; line-height: 16px;
}
.chip.static {
  position: static;
  background: var(--ink);
  margin: 4px 0 10px;
}
.more {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(26,26,26,.32); backdrop-filter: blur(10px);
  color: #fff; display: grid; place-items: center;
  font-size: 16px; letter-spacing: 1px; font-weight: 600;
}
.event-meta {
  position: absolute; left: 16px; right: 16px; bottom: 14px;
}
.event-meta h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 30px;
  letter-spacing: -0.02em;
  text-shadow: 0 6px 18px rgba(0,0,0,.28);
}
.event-time {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px; font-size: 12px; line-height: 16px; font-weight: 400; opacity: .95;
}

.quiet-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 16px 16px 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(26, 26, 26, .05);
  border: 1px solid var(--border);
}
.quiet-card h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 500;
  line-height: 26px;
}
.when { color: var(--muted); font-size: 12px; line-height: 16px; margin: 2px 0 12px; }
.check {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
  font-size: 16px;
  line-height: 24px;
  width: 100%;
  text-align: left;
}
.check .box {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--border);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.check.done { color: var(--muted); }
.check.done .box {
  background: var(--success); border-color: var(--success); color: #fff;
  font-size: 11px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font-weight: 500; font-size: 14px; line-height: 20px;
}
.btn.block { width: 100%; }
.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(var(--glow), .28);
}
.btn.ghost,
.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--border);
}
.btn.soft {
  background: var(--primary-light);
  color: var(--ink);
}
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.choice {
  flex: 1; min-width: 120px;
  border-radius: 16px; padding: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 500; font-size: 14px;
}
.choice.on {
  background: var(--primary-light);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}
.login-error { color: var(--error); font-size: 13px; margin-top: 10px; min-height: 18px; }
.waiting {
  display: inline-flex; align-items: center; gap: 8px;
  background: #FFF7ED;
  color: #9A6B24;
  border-radius: 999px; padding: 6px 12px;
  font-size: 12px; font-weight: 500; line-height: 16px;
}

.nav {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(390px, calc(100% - 24px));
  min-height: 64px;
  border-radius: 32px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: 0 12px 32px rgba(26, 26, 26, .12);
  display: flex; align-items: center; justify-content: space-around;
  padding: 8px 10px;
  z-index: 20;
}
.nav button {
  min-width: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--muted);
  padding: 4px 6px;
}
.nav button .nav-lbl {
  font-size: 9px;
  line-height: 12px;
  font-weight: 500;
  color: var(--muted);
}
.nav button.active {
  width: 48px; height: 48px; min-width: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 16px rgba(var(--glow), .35);
  padding: 0;
}
.nav button.active .nav-lbl { display: none; }
.nav svg { width: 22px; height: 22px; }

.login {
  min-height: 100dvh;
  padding: 56px 24px 40px;
  text-align: center;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--surface) 48%, var(--bg) 100%);
}
.brand-mark {
  width: 64px; height: 64px; border-radius: 22px;
  margin: 0 auto 8px;
  background: linear-gradient(180deg, var(--brand-from), var(--brand-to));
  box-shadow: 0 12px 24px rgba(var(--glow), .28);
}
.login h1 {
  font-family: var(--serif);
  font-size: 36px;
  line-height: 44px;
  font-weight: 600;
  margin: 12px 0 8px;
}
.login p { color: var(--muted); font-size: 14px; line-height: 20px; }
.people { display: flex; flex-direction: column; gap: 10px; margin-top: 32px; }
.person {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border-radius: 18px; padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--border);
}
.person b { font-size: 16px; font-weight: 600; line-height: 24px; display: block; }
.person span { color: var(--muted); font-size: 12px; line-height: 16px; }

.form-label {
  font-size: 12px; font-weight: 500; line-height: 16px;
  color: var(--muted); margin: 16px 0 8px;
}
.field {
  width: 100%; border: 0; background: var(--surface);
  border-radius: 16px; padding: 14px 16px;
  font-size: 16px; line-height: 24px;
  box-shadow: inset 0 0 0 1px var(--border);
  outline: none; color: var(--ink);
}
.field:focus { box-shadow: inset 0 0 0 1.5px var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  font-weight: 500; font-size: 14px;
}
.tag.on { background: var(--primary-light); box-shadow: none; }
.prep-add { display: flex; gap: 8px; }
.toggle {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-radius: 16px; padding: 14px 16px;
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 14px;
}
.switch {
  width: 46px; height: 28px; border-radius: 99px; background: var(--border); position: relative;
}
.switch.on { background: var(--primary); }
.switch i {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: left .2s;
}
.switch.on i { left: 21px; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.seg {
  display: flex; background: var(--surface); border-radius: 999px; padding: 4px;
  border: 1px solid var(--border);
}
.seg button { padding: 8px 16px; border-radius: 999px; font-weight: 500; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--primary); color: #fff; }
.week-agenda { margin-top: 18px; }
.week-block { margin-bottom: 18px; }
.week-block.is-today .wd-head h3 { color: var(--primary); }
.wd-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px; padding: 0 2px;
}
.wd-head h3 {
  font-family: var(--serif);
  font-size: 20px; font-weight: 600; line-height: 28px;
}
.wd-head span { font-size: 14px; color: var(--muted); font-weight: 500; }
.week-empty { font-size: 13px; color: var(--muted); padding: 4px 2px 8px; }
.week-ev {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--surface);
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.week-ev-cover {
  width: 56px; height: 56px; border-radius: 12px;
  object-fit: cover; flex: 0 0 auto;
}
.week-ev-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.week-ev-body b {
  font-size: 15px; font-weight: 600; line-height: 20px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.week-ev-body span { font-size: 12px; line-height: 16px; color: var(--muted); }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 8px 4px; margin-top: 18px;
}
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 6px; }
.cal-cell {
  aspect-ratio: 1; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 500; font-size: 14px; color: var(--ink);
  position: relative;
}
.cal-cell.out { color: #D1D5DB; }
.cal-cell.sel { background: var(--primary); color: #fff; }
.cal-cell .dots { display: flex; gap: 3px; position: absolute; bottom: 6px; }
.cal-cell .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.cal-cell.sel .dots i { background: #fff; }

.sheet {
  position: fixed; inset: 0; background: rgba(26,26,26,.28);
  z-index: 30; display: flex; align-items: flex-end; justify-content: center;
}
.sheet-card {
  width: min(430px, 100%);
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  padding: 18px 20px 28px;
  max-height: 86dvh; overflow: auto;
}
.handle { width: 42px; height: 5px; border-radius: 99px; background: var(--border); margin: 0 auto 14px; }

.notif { padding: 14px 0; border-bottom: 1px solid var(--border); }
.notif b { display: block; font-size: 14px; font-weight: 600; line-height: 20px; }
.notif p { color: var(--muted); font-size: 12px; line-height: 16px; margin-top: 3px; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; }

.ai-bubble {
  max-width: 86%; padding: 12px 14px; border-radius: 16px; margin-bottom: 10px;
  font-size: 14px; line-height: 20px;
}
.ai-bubble.bot { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 6px; }
.ai-bubble.me { background: var(--primary-light); margin-left: auto; border-top-right-radius: 6px; }

.detail-hero { height: 260px; border-radius: 0 0 24px 24px; overflow: hidden; position: relative; margin: -18px -20px 18px; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.back {
  position: absolute; top: 18px; left: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.82); backdrop-filter: blur(10px);
  display: grid; place-items: center;
}

.empty { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 14px; }
.shimmer {
  background: linear-gradient(90deg, var(--primary-light), #fff, var(--primary-light));
  background-size: 200% 100%;
  animation: sh 1.4s infinite linear;
  border-radius: 20px;
}
@keyframes sh { to { background-position: -200% 0; } }

.status-ok { color: var(--success); font-weight: 600; font-size: 14px; }
.status-pending { color: var(--warning); }
.status-overdue { color: var(--error); }

.hidden { display: none !important; }
.install-hint {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  width: min(390px, calc(100% - 28px));
  background: rgba(26,26,26,.9); color: #fff;
  border-radius: 16px; padding: 12px 14px; font-size: 12px; z-index: 25;
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
}
.push-card {
  background: #fff;
  border-radius: 20px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
  margin: 14px 0 4px;
}
.push-card h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  margin-bottom: 6px;
}
.push-card p { color: var(--muted); font-size: 13px; line-height: 20px; }
.push-card ol {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 20px;
}
.push-card li { margin: 4px 0; }
.push-card .push-err { color: var(--error); margin-top: 8px; font-size: 12px; }
.push-card .btn { margin-top: 12px; }
.push-ok { color: var(--success); font-weight: 600; font-size: 13px; }

.theme-block { margin-top: 28px; text-align: left; }
.login .theme-block { margin-top: 36px; }
.theme-block .tiny { margin-bottom: 10px; }
.theme-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.theme-dot {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px 8px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}
.theme-dot::before {
  content: '';
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 6px 12px rgba(0,0,0,.12);
}
.theme-dot span { font-size: 11px; font-weight: 500; color: var(--muted); line-height: 14px; }
.theme-dot.on {
  box-shadow: inset 0 0 0 1.5px var(--primary);
  background: var(--primary-light);
}
.theme-dot.on span { color: var(--ink); font-weight: 600; }
