* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: 'Fraunces', serif; margin: 0; }

:root,
[data-theme="light"] {
  --bg: #FAF6EF;
  --surface: #FFFFFF;
  --surface-2: #F2ECE0;
  --text: #3A332C;
  --text-muted: #8A8175;
  --text-faint: #B4AB9C;
  --border: #E8E0D2;
  --morning-bg: #FAEAD0; --morning-fg: #BD7C2A;
  --zone-bg: #DFEED6; --zone-fg: #5A8C4E;
  --focus-bg: #F8DAE3; --focus-fg: #BE3C64;
  --night-bg: #E5E0F4; --night-fg: #6C5FB0;
  --extra-bg: #EFEAE2; --extra-fg: #8A8175;
  --accent: #C26C79;
  --accent-soft: #F3DEE1;
  --accent-2: #9080BE;
  --success: #6E9463;
  --danger: #C4626B;
  --shadow: 0 1px 2px rgba(58,51,44,.035), 0 2px 9px -5px rgba(58,51,44,.07);
}
[data-theme="dark"] {
  --bg: #211E1A;
  --surface: #2A2622;
  --surface-2: #322D27;
  --text: #F2ECE3;
  --text-muted: #B3AB9E;
  --text-faint: #857C6F;
  --border: #3D362F;
  --morning-bg: #3A2E20; --morning-fg: #EAB05A;
  --zone-bg: #243224; --zone-fg: #86C173;
  --focus-bg: #3A2230; --focus-fg: #E66B92;
  --night-bg: #2A2740; --night-fg: #A695E8;
  --extra-bg: #322D27; --extra-fg: #B3AB9E;
  --accent: #E08798;
  --accent-soft: #4A3036;
  --accent-2: #AC9BE0;
  --success: #9CC18E;
  --danger: #E0939E;
  --shadow: 0 1px 2px rgba(0,0,0,.18), 0 3px 12px -6px rgba(0,0,0,.3);
}
[data-theme="premium"] {
  --bg: #F7F2E9;
  --surface: #FFFFFF;
  --surface-2: #F1E3DD;
  --text: #332A21;
  --text-muted: #8C8072;
  --text-faint: #A89A85;
  --border: #EDE3D8;
  --morning-bg: #FFFFFF; --morning-fg: #B4776A;
  --zone-bg: #FFFFFF; --zone-fg: #6E9463;
  --focus-bg: #FFFFFF; --focus-fg: #B4776A;
  --night-bg: #FFFFFF; --night-fg: #776A8F;
  --extra-bg: #FFFFFF; --extra-fg: #8C8072;
  --accent: #B4776A;
  --accent-soft: #F1E3DD;
  --accent-2: #8C6F60;
  --success: #6E9463;
  --danger: #B86662;
  --shadow: 0 1px 2px rgba(51,42,33,.035), 0 2px 9px -5px rgba(51,42,33,.07);
}
[data-theme="premium-dark"] {
  --bg: #171311;
  --surface: #241D1A;
  --surface-2: #2C2521;
  --text: #F3ECE3;
  --text-muted: #B3AAA3;
  --text-faint: #7A6D63;
  --border: rgba(255,255,255,.06);
  --morning-bg: #241D1A; --morning-fg: #CA9B81;
  --zone-bg: #241D1A; --zone-fg: #7D9877;
  --focus-bg: #241D1A; --focus-fg: #C59486;
  --night-bg: #241D1A; --night-fg: #ABA3BC;
  --extra-bg: #241D1A; --extra-fg: #B0A89D;
  --accent: #B97A6B;
  --accent-soft: #3D2B22;
  --accent-2: #ABA3BC;
  --success: #7D9877;
  --danger: #C17B72;
  --shadow: 0 2px 12px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding: 18px 18px 96px;
  position: relative;
}

.view { display: none; }
.view.active { display: block; }

/* topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 18px; gap: 14px; }
.topbar-title { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 600; }
.topbar-title .sub { display: block; font-family: 'Inter', sans-serif; font-size: 12.5px; color: var(--text-muted); font-weight: 400; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.filled { background: var(--accent); border-color: var(--accent); color: #fff; }

.home-topbar { justify-content: flex-start; align-items: flex-start; }
.greet-block h1 { font-size: 21px; font-weight: 600; }
.greet-block .date { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* progress card */
.progress-card { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px; margin-bottom: 18px; }
.ring-wrap { position: relative; width: 74px; height: 74px; flex-shrink: 0; }
.ring-wrap svg { width: 74px; height: 74px; transform: rotate(-90deg); }
#ring-fg { transition: stroke-dashoffset .4s ease; }
.ring-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.progress-info { flex: 1; min-width: 0; }
.progress-info .label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.progress-info .count { font-size: 14.5px; font-weight: 600; margin: 3px 0 8px; }
.bar-track { height: 7px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar-track.tiny { height: 5px; margin: 6px 0 0; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 5px; transition: width .3s ease; }
.bar-fill.zone { background: var(--zone-fg); }
#zone-bar-fill { background: var(--zone-fg); }

.home-section-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 22px 2px 10px; }
.home-section-label:first-of-type { margin-top: 0; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; margin-bottom: 12px; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 15px 16px; cursor: pointer; }
.card-icon { width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface-2); color: var(--accent); }
.card-icon svg { width: 18px; height: 18px; }
.card.morning { background: var(--morning-bg); }
.card.morning .card-icon { background: rgba(255,255,255,.55); color: var(--morning-fg); }
.card.morning .card-badge { color: var(--morning-fg); }
.card.zone { background: var(--zone-bg); }
.card.zone .card-icon { background: rgba(255,255,255,.55); color: var(--zone-fg); }
.card.zone .card-badge { color: var(--zone-fg); }
.card.focus { background: var(--focus-bg); }
.card.focus .card-icon { background: rgba(255,255,255,.55); color: var(--focus-fg); }
.card.focus .card-badge { color: var(--focus-fg); }
.card.night { background: var(--night-bg); }
.card.night .card-icon { background: rgba(255,255,255,.55); color: var(--night-fg); }
.card.night .card-badge { color: var(--night-fg); }
.card.extra { background: var(--extra-bg); }
.card.extra .card-icon { background: rgba(255,255,255,.55); color: var(--extra-fg); }
.card.extra .card-badge { color: var(--extra-fg); }
[data-theme="dark"] .card .task-check, [data-theme="premium-dark"] .card .task-check { border-color: rgba(255,255,255,.25); }
[data-theme="dark"] .card.morning .card-icon,
[data-theme="dark"] .card.zone .card-icon,
[data-theme="dark"] .card.focus .card-icon,
[data-theme="dark"] .card.night .card-icon,
[data-theme="dark"] .card.extra .card-icon { background: rgba(0,0,0,.24); }
[data-theme="premium-dark"] .card.morning .card-icon,
[data-theme="premium-dark"] .card.zone .card-icon,
[data-theme="premium-dark"] .card.focus .card-icon,
[data-theme="premium-dark"] .card.night .card-icon,
[data-theme="premium-dark"] .card.extra .card-icon { background: rgba(255,255,255,.06); }
.card-titles { flex: 1; min-width: 0; }
.card-titles .t { font-weight: 600; font-size: 15px; }
.card-titles .t-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--focus-fg); margin-bottom: 3px; }
.zone-foot { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.card-badge { font-size: 12.5px; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border-radius: 20px; padding: 3px 9px; flex-shrink: 0; }
.chevron { color: var(--text-muted); transition: transform .2s ease; flex-shrink: 0; }
.chevron svg { width: 16px; height: 16px; }
.card.open .chevron { transform: rotate(180deg); }
.card-body { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.card.open .card-body { max-height: 1000px; }
.card-body > * { padding: 0 16px 16px; }
.card-body .task-list:first-child { padding-top: 2px; }

.zone-room-group { padding-top: 12px; }
.zone-room-group:first-child { padding-top: 0; }
.zone-room-group.divided { border-top: 1px solid var(--border); margin-top: 4px; }
.zone-room-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--zone-fg); margin-bottom: 4px; }
.zone-count-text { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

.task-list { display: flex; flex-direction: column; gap: 2px; }
.task-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; cursor: pointer; }
.task-check { width: 24px; height: 24px; border-radius: 8px; border: 1.6px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: .15s ease; }
.task-check svg { width: 14px; height: 14px; color: #fff; opacity: 0; transition: .15s; }
.task-row.done .task-check { background: var(--accent); border-color: var(--accent); }
.task-row.done .task-check svg { opacity: 1; }
.task-row .task-text { font-size: 14.5px; }
.task-row.done .task-text { color: var(--text-muted); text-decoration: line-through; }
.empty-hint { font-size: 13px; color: var(--text-muted); text-align: center; padding: 14px 0; }

.card.focus .focus-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }

/* rotinas view */
.section-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 4px 0 16px; }
.section-head h2 { font-size: 17px; font-weight: 600; }
.section-head .s { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

.rotinas-subpanel { display: none; }
.rotinas-subpanel.active { display: block; }

.routine-manage-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
.rmc-row { display: flex; align-items: center; gap: 10px; }
.rmc-clickable { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.rmc-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rmc-ic svg { width: 17px; height: 17px; }
.routine-manage-card.morning .rmc-ic { color: var(--morning-fg); }
.routine-manage-card.night .rmc-ic { color: var(--night-fg); }
.routine-manage-card.extra .rmc-ic { color: var(--extra-fg); }
.rmc-body { flex: 1; min-width: 0; }
.rmc-name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rmc-count { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rmc-chev { color: var(--text-muted); flex-shrink: 0; cursor: pointer; padding: 4px; }
.rmc-chev svg { width: 16px; height: 16px; }
.rmc-weekdays-label { font-size: 11.5px; color: var(--text-muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.rmc-weekdays { display: flex; gap: 5px; margin-top: 8px; }
.wd-dot { flex: 1; text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--surface-2); border-radius: 8px; padding: 5px 0; cursor: pointer; }
.wd-dot.on { color: #fff; background: var(--accent); }

.switch { position: relative; display: inline-block; width: 42px; height: 25px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; transition: .15s ease; pointer-events: none; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .15s ease; }
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(17px); }

.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.icon-opt { width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-opt svg { width: 19px; height: 19px; }
.icon-opt.sel { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }


.rlist { display: flex; flex-direction: column; gap: 2px; }
.rrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.rrow .rtext { flex: 1; font-size: 14.5px; background: transparent; border: none; color: var(--text); font-family: inherit; }
.rrow input.rtext { font-size: 16px; }
.rrow .rtext.done { color: var(--text-muted); text-decoration: line-through; }
.rrow .rtext:not(input) { cursor: default; }
input.rtext { border-bottom: 1px solid var(--border); padding: 4px 0; }
.rrow .bullet { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.mini-btn { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.mini-btn svg { width: 15px; height: 15px; }
.mini-btn.danger { color: var(--danger); }
.mini-btn.drag-handle { cursor: grab; touch-action: none; }
.rrow.dragging { opacity: .6; position: relative; z-index: 5; }

.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-row input { flex: 1; border: 1px solid var(--border); background: var(--surface-2); border-radius: 11px; padding: 10px 12px; font-size: 16px; color: var(--text); font-family: inherit; }
.add-row button { width: 40px; border-radius: 11px; border: none; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.add-row button svg { width: 17px; height: 17px; }

/* planejamento */
.week-strip { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
.nav-arrow { width: 30px; height: 30px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; flex-shrink: 0; }
.nav-arrow svg { width: 15px; height: 15px; }
.day-pill { flex: 1; text-align: center; padding: 8px 2px; border-radius: 12px; cursor: pointer; color: var(--text-muted); }
.day-pill .dn { font-size: 10.5px; font-weight: 600; letter-spacing: .03em; }
.day-pill .dd { font-size: 15px; font-weight: 700; margin-top: 3px; }
.day-pill.selected { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.day-pill.today { background: var(--accent); border-color: var(--accent); }
.day-pill.today .dn, .day-pill.today .dd { color: #fff; }

.legend { display: flex; flex-wrap: nowrap; gap: 6px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.legend::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 20px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.chip.morning { color: var(--morning-fg); }
.chip.extra { color: var(--extra-fg); }
.chip.zone { color: var(--zone-fg); }
.chip.focus { color: var(--focus-fg); }
.chip.night { color: var(--night-fg); }
.chip.inactive { opacity: .4; }

.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; transition: opacity .2s ease, max-height .2s ease; }
.plan-card.filtered-out { display: none; }
.plan-card .eyebrow { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 8px; }
.plan-card .eyebrow svg { width: 15px; height: 15px; }
.plan-task { display: flex; align-items: center; gap: 11px; padding: 8px 0; }
.plan-task .task-text { font-size: 14.5px; }

.focus-card-plan { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; cursor: pointer; }
.focus-card-plan.filtered-out { display: none; }
.focus-card-plan .fi { width: 34px; height: 34px; border-radius: 11px; background: var(--surface-2); color: var(--focus-fg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.focus-card-plan .fi svg { width: 18px; height: 18px; }
.focus-card-plan .ft { flex: 1; min-width: 0; }
.focus-card-plan .eyebrow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: .05em; }
.focus-card-plan .title { font-weight: 600; font-size: 14.5px; margin-top: 2px; }
.focus-card-plan .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.swipe-row { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.swipe-row::-webkit-scrollbar { display: none; }
.swipe-track { display: flex; min-width: 100%; }
.swipe-content { display: flex; align-items: center; gap: 11px; padding: 8px 0; min-width: 100%; scroll-snap-align: start; flex-shrink: 0; }
.swipe-actions-inline { display: flex; align-items: center; gap: 6px; flex-shrink: 0; scroll-snap-align: end; padding-left: 8px; }
.swipe-edit, .swipe-delete { width: 34px; height: 34px; border-radius: 10px; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.swipe-edit svg, .swipe-delete svg { width: 15px; height: 15px; color: #fff; }
.swipe-edit { background: var(--accent-2); }
.swipe-delete { background: var(--danger); }

/* zonas */
.zonas-subpanel { display: none; }
.zonas-subpanel.active { display: block; }
.nav-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 15px 16px; margin-bottom: 20px; cursor: pointer; }
.nc-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nc-ic svg { width: 18px; height: 18px; }
.nc-body { flex: 1; min-width: 0; }
.nc-title { font-weight: 600; font-size: 14.5px; }
.nc-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.nc-chev { color: var(--text-muted); flex-shrink: 0; }
.nc-chev svg { width: 16px; height: 16px; }
.zonas-divider-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 4px 2px 10px; }

.zone-block { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.zone-block.other { opacity: .65; }
.zone-eyebrow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 6px; }
.zb-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.zb-head .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.zb-head .tt { flex: 1; font-weight: 600; font-size: 15px; }
.star-badge { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--surface-2); padding: 4px 9px; border-radius: 20px; }
.star-badge svg { width: 12px; height: 12px; }
.room { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.room:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.rn { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--text-muted); }
.rn svg { width: 15px; height: 15px; }
.room.readonly .rrow { color: var(--text-muted); }

.back-row { display: flex; align-items: center; gap: 8px; padding: 4px 0 18px; cursor: pointer; color: var(--text-muted); font-size: 14px; font-weight: 600; }
.back-row svg { width: 17px; height: 17px; }

.tab-switch { display: flex; gap: 6px; background: var(--surface-2); border-radius: 13px; padding: 4px; margin-bottom: 18px; }
.tab-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px; border: none; background: transparent; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.tab-btn svg { width: 15px; height: 15px; }
.tab-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.house-tab-panel { display: none; }
.house-tab-panel.active { display: block; }

.room-list-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 13px 14px; margin-bottom: 9px; cursor: pointer; }
.room-list-item.no-click { cursor: default; }
.rli-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rli-ic svg { width: 16px; height: 16px; }
.rli-body { flex: 1; min-width: 0; }
.rli-title { font-weight: 600; font-size: 14px; }
.rli-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rli-chev { color: var(--text-muted); flex-shrink: 0; }
.rli-chev svg { width: 15px; height: 15px; }
.add-zone-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1.5px dashed var(--border); background: transparent; border-radius: 16px; padding: 13px; font-weight: 600; font-size: 14px; color: var(--accent); cursor: pointer; margin-top: 4px; }
.add-zone-btn svg { width: 16px; height: 16px; }
.zones-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 7px; align-items: start; }
.zone-config-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 8px; margin-bottom: 10px; min-width: 0; }
.zones-grid .zone-config-card { margin-bottom: 0; }
.zones-grid .add-zone-btn { margin-top: 0; }
.zone-config-head { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border); min-width: 0; }
.zone-config-head .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.zone-config-head .rli-body { min-width: 0; }
.zone-config-head .rli-title { font-size: 13px; overflow-wrap: break-word; }
.zone-config-head .rli-sub { font-size: 11px; }
.zone-menu-btn { width: 20px; height: 20px; border: none; background: transparent; color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0; }
.zone-menu-btn svg { width: 13px; height: 13px; }
.zone-room-row { display: flex; align-items: center; gap: 5px; background: var(--surface-2); border-radius: 9px; padding: 6px 7px; margin-bottom: 5px; cursor: pointer; min-width: 0; }
.zrr-name { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.25; white-space: normal; overflow-wrap: break-word; word-break: break-word; }
.drag-handle { width: 18px; height: 18px; border: none; background: transparent; color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; flex-shrink: 0; padding: 0; }
.drag-handle svg { width: 13px; height: 13px; }
.zone-add-room-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1.5px dashed var(--border); background: transparent; border-radius: 9px; padding: 7px; font-weight: 600; font-size: 11.5px; color: var(--accent); cursor: pointer; margin-top: 2px; text-align: center; white-space: normal; line-height: 1.2; }
.zone-add-room-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.unassigned-card { border: 1.5px dashed rgba(193,123,114,0.55); background: rgba(193,123,114,0.12); }
.unassigned-card .zone-room-row { background: rgba(255,255,255,0.35); }
.zone-config-card.drop-target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.zone-room-row.dragging { opacity: 0.35; }
.zone-drag-ghost { position: fixed; z-index: 300; pointer-events: none; box-shadow: 0 10px 26px rgba(0,0,0,0.22); opacity: 0.95; }
.zones-drag-hint { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.zones-drag-hint svg { width: 15px; height: 15px; flex-shrink: 0; }
.room-action-row.danger { color: var(--danger); }
.room-action-row .ra-ic { display: flex; color: var(--text-muted); }
.room-action-row.danger .ra-ic { color: var(--danger); }
.room-action-row .ra-ic svg { width: 16px; height: 16px; }

.room-detail-name, .cfg-zone-name { width: 100%; border: none; border-bottom: 1.5px solid var(--border); background: transparent; font-family: 'Fraunces', serif; font-size: 19px; font-weight: 600; color: var(--text); padding: 4px 0 10px; margin-bottom: 18px; }
.detail-row { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 18px; cursor: pointer; }
.dr-label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.dr-value { font-size: 14px; font-weight: 600; margin-top: 3px; }
.dr-chev { color: var(--text-muted); }
.dr-chev svg { width: 15px; height: 15px; }
.detail-section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 8px; }
.delete-zone-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: none; background: transparent; color: var(--danger); font-weight: 600; font-size: 14px; padding: 14px; cursor: pointer; margin-top: 8px; }
.delete-zone-btn svg { width: 16px; height: 16px; }

.move-radio-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 4px; font-size: 14.5px; cursor: pointer; border-bottom: 1px solid var(--border); }
.move-radio-row:last-child { border-bottom: none; }
.move-radio-row .radio-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.6px solid var(--border); }

/* mais */
.subpanel { display: none; }
.subpanel.active { display: block; }
.menu-item { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 15px; margin-bottom: 10px; cursor: pointer; }
.mi-ic { width: 34px; height: 34px; border-radius: 11px; background: var(--surface-2); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mi-ic svg { width: 17px; height: 17px; }
.mi-ic.danger { color: var(--danger); }
#logout-menu-item .mi-t { color: var(--danger); }
.mi-t { flex: 1; font-weight: 600; font-size: 14.5px; }
.mi-chev { color: var(--text-muted); flex-shrink: 0; }
.mi-chev svg { width: 16px; height: 16px; }

.name-field { margin-bottom: 22px; }
.name-field label { display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 7px; font-weight: 600; }
.name-field input, .focos-edit-textarea { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 11px 13px; font-size: 16px; color: var(--text); font-family: inherit; }
.focos-edit-textarea { resize: vertical; line-height: 1.5; }

.focus-day-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 13px 15px; margin-bottom: 9px; cursor: pointer; }
.fdr-body { flex: 1; min-width: 0; }
.fdr-day { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--focus-fg); margin-bottom: 3px; }
.fdr-title { font-weight: 600; font-size: 14.5px; }
.fdr-chev { color: var(--text-muted); flex-shrink: 0; }
.fdr-chev svg { width: 16px; height: 16px; }

.theme-opt { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 13px 15px; margin-bottom: 9px; cursor: pointer; }
.theme-opt .label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.theme-opt .label svg { width: 17px; height: 17px; color: var(--text-muted); }
.radio-dot { width: 19px; height: 19px; border-radius: 50%; border: 1.6px solid var(--border); position: relative; flex-shrink: 0; }
.radio-dot.sel { border-color: var(--accent); }
.radio-dot.sel::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }

.btn-primary, .btn-secondary, .btn-danger { display: block; width: 100%; border-radius: 13px; padding: 13px; font-size: 14.5px; font-weight: 600; cursor: pointer; border: none; margin-bottom: 10px; font-family: inherit; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }

.about-card { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px 22px; margin-bottom: 18px; }
.about-logo { display: block; width: 160px; max-width: 70%; height: auto; margin: 0 auto 16px; }
.about-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 10px; }
.about-card p:last-child { margin-bottom: 0; }
.about-card .about-mission-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 6px; }

.about-author { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px 22px; margin-bottom: 16px; text-align: center; }
.about-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.about-name { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.about-ig { color: var(--accent); font-size: 14.5px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.about-ig svg { width: 17px; height: 17px; }
.about-author p { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 14px; text-align: left; }
.about-verse { font-style: italic; border-top: 1px solid var(--border); padding-top: 14px; margin-bottom: 0 !important; }
.about-footer { text-align: center; font-size: 12px; color: var(--text-muted); padding: 6px 0 4px; }

.support-intro { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 18px; }

.privacy-updated { font-size: 12px; color: var(--text-faint); margin: 0 0 18px; }
.privacy-content h3 { font-size: 14.5px; font-weight: 600; margin: 20px 0 8px; }
.privacy-content h3:first-of-type { margin-top: 0; }
.privacy-content p { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 10px; }
.support-link { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 15px; margin-bottom: 10px; text-decoration: none; color: var(--text); }
.support-link .si-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.support-link .si-ic svg { width: 18px; height: 18px; }
.support-link .si-body { flex: 1; min-width: 0; }
.support-link .si-title { font-weight: 600; font-size: 14px; }
.support-link .si-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; word-break: break-word; }

.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 15px; margin-bottom: 9px; cursor: pointer; }
.faq-item .q { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 14px; }
.faq-item .q svg { transform: rotate(0deg); }
.faq-item.open .q svg { transform: rotate(180deg); }
.faq-item .a { max-height: 0; overflow: hidden; font-size: 13.5px; color: var(--text-muted); line-height: 1.6; transition: max-height .2s ease; }
.faq-item.open .a { max-height: 400px; margin-top: 10px; }

/* bottom nav */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 20; }
.bottom-nav-inner { max-width: 480px; margin: 0 auto; display: flex; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; border: none; background: transparent; color: var(--text-muted); padding: 6px 2px; cursor: pointer; font-family: inherit; }
.nav-btn svg { width: 21px; height: 21px; }
.nav-btn span { font-size: 10.5px; font-weight: 600; }
.nav-btn.active { color: var(--accent); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 12px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 30px; font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,17,13,.5); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal-card { background: var(--surface); border-radius: 20px; padding: 22px; width: 100%; max-width: 380px; }
.modal-card h3 { font-size: 17px; margin-bottom: 10px; }
.modal-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 18px; }
.modal-card label { display: block; font-size: 12.5px; color: var(--text-muted); margin: 12px 0 6px; font-weight: 600; }
.modal-card input { width: 100%; border: 1px solid var(--border); background: var(--surface-2); border-radius: 11px; padding: 10px 12px; font-size: 16px; color: var(--text); font-family: inherit; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions button { flex: 1; margin-bottom: 0; }

.modal-overlay.sheet { align-items: flex-end; padding: 0; }
.sheet-card { max-width: 480px; margin: 0 auto; border-radius: 22px 22px 0 0; width: 100%; }
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 0 auto 14px; }

@media (min-width: 520px) {
  body { background: var(--surface-2); }
  .app { box-shadow: 0 0 0 1px var(--border); min-height: 100vh; }
}

/* auth */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 20px; padding: 30px 26px; box-shadow: var(--shadow); }
.auth-title { font-size: 21px; text-align: center; margin-bottom: 22px; }
.onboarding-text { font-size: 14.5px; color: var(--text-muted); text-align: center; margin: 0 0 16px; }
.onboarding-note { font-size: 12px; color: var(--text-faint); text-align: center; margin: 10px 0 20px; line-height: 1.5; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 13px; padding: 13px; font-size: 14.5px; font-weight: 600; cursor: pointer; font-family: inherit; margin-bottom: 18px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 12.5px; margin-bottom: 18px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-error { font-size: 13px; color: var(--danger); margin-bottom: 12px; }
.auth-support-link { font-size: 13px; color: var(--text-muted); margin: -6px 0 12px; }
.auth-support-link a { color: #25D366; font-weight: 600; text-decoration: none; }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 14px; }
.auth-switch a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-forgot { text-align: right; margin: -8px 0 16px; }
.auth-forgot a { font-size: 12.5px; color: var(--text-muted); text-decoration: none; }
.auth-consent { font-size: 12px; color: var(--text-faint); text-align: center; line-height: 1.5; margin: 2px 0 14px; }
.auth-consent a { color: var(--accent); text-decoration: none; font-weight: 600; }
.privacy-standalone-card { max-height: 78vh; overflow-y: auto; text-align: left; }
.privacy-standalone-card .back-row { cursor: pointer; }
