:root {
  --pine: #1F3D2E; --pine-2: #2C5441; --cream: #FBF6EC; --paper: #FFFDF8; --ink: #24211C; --muted: #6A6358;
  --line: #E7DDCB; --berry: #A32638; --gold: #B57F24; --green: #24704F; --amber: #94610B; --grey: #6B675F;
  --green-bg: #E2F1E8; --amber-bg: #FBEFD5; --grey-bg: #EFEBE2; --berry-bg: #F8E3E5;
  --radius: 16px; --shadow: 0 1px 2px rgba(40,30,10,.07), 0 6px 18px rgba(40,30,10,.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.45 var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; line-height: 1.18; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--pine-2); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* Shell */
.shell { max-width: 880px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
.top { background: var(--pine); color: #FBF6EC; padding: calc(14px + env(safe-area-inset-top)) 0 14px; }
.top-in { max-width: 880px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top h1 { font-size: 21px; }
.who-btn { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.13); border: 0; color: inherit; padding: 6px 12px 6px 6px; border-radius: 999px; min-height: 44px; font-weight: 600; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.nav-in { display: flex; width: 100%; max-width: 880px; }
.nav button { flex: 1; border: 0; background: none; padding: 9px 2px 8px; color: var(--muted); font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 58px; position: relative; }
.nav button .ic { font-size: 22px; line-height: 1; }
.nav button.on { color: var(--berry); }
.nav .badge { position: absolute; top: 5px; left: calc(50% + 8px); background: var(--berry); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; }

/* Common */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.section-title { font-size: 22px; margin: 26px 0 10px; }
.sub { color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--paper); padding: 10px 16px; border-radius: 12px; font-weight: 600; min-height: 44px; }
.btn.primary { background: var(--berry); border-color: var(--berry); color: #fff; }
.btn.pine { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--berry); }
.btn:disabled { opacity: .55; cursor: default; }
.chip { border: 1px solid var(--line); background: var(--paper); padding: 8px 13px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; min-height: 40px; color: var(--muted); }
.chip.on { background: var(--pine); color: #fff; border-color: var(--pine); }
.scroll-x { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 3px 9px; border-radius: 999px; background: var(--grey-bg); color: var(--grey); font-weight: 600; white-space: nowrap; }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.berry { background: var(--berry-bg); color: var(--berry); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 16px; color: #fff; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 13px; margin-left: -6px; border: 2px solid var(--paper); }
.avatars { display: inline-flex; padding-left: 6px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
input[type=text], input[type=url], input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; min-height: 46px; font-size: 16px; }
textarea { resize: vertical; min-height: 80px; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: linear-gradient(170deg, var(--pine) 0%, #24483a 55%, #33604e 100%); }
.login .box { width: min(420px, 100%); background: var(--paper); padding: 28px 24px; border-radius: 22px; }
.login h1 { font-size: 30px; margin-bottom: 4px; }
.people-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.person-btn { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-weight: 600; min-height: 60px; text-align: left; }

/* Home */
.hero { background: linear-gradient(135deg, var(--pine) 0%, #2d5a47 100%); color: #FBF6EC; border-radius: 20px; padding: 22px 20px; margin-top: 16px; }
.hero .count { font-family: var(--serif); font-size: 46px; line-height: 1; }
.hero p { margin: 6px 0 0; opacity: .92; }
.flight { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.flight div { background: rgba(255,255,255,.1); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.flight b { display: block; font-size: 15px; }
.list-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item.tap { cursor: pointer; }
.rank { font-family: var(--serif); font-size: 20px; color: var(--gold); width: 22px; flex: none; text-align: center; }

/* Ideas */
.idea { padding: 0; overflow: hidden; margin-bottom: 12px; }
.idea-head { width: 100%; text-align: left; background: none; border: 0; padding: 15px 16px 10px; display: block; }
.idea-head h3 { font-size: 19px; margin: 6px 0 4px; }
.idea-head p { margin: 0; color: #4c463c; font-size: 15px; }
.idea-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.vote-row { display: flex; align-items: center; gap: 8px; padding: 8px 16px 14px; flex-wrap: wrap; }
.vote { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 7px 10px; min-height: 44px; font-weight: 600; font-size: 14px; color: var(--muted); }
.vote.on.love { background: var(--berry-bg); border-color: var(--berry); color: var(--berry); }
.vote.on.like { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.vote.on.no { background: var(--grey-bg); border-color: var(--grey); color: var(--grey); }
.score { font-family: var(--serif); font-size: 18px; margin-left: auto; color: var(--pine-2); }
.detail { border-top: 1px dashed var(--line); padding: 14px 16px 16px; font-size: 15px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 12px 0; }
.facts div span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.access-box { background: var(--green-bg); padding: 11px 13px; border-radius: 12px; margin: 10px 0; }
.access-box.parcial { background: var(--amber-bg); } .access-box.confirmar { background: var(--grey-bg); } .access-box.no { background: var(--berry-bg); }
.comment { padding: 8px 0; display: flex; gap: 8px; }
.comment p { margin: 0; }
.researching { color: var(--amber); font-weight: 600; font-size: 14px; }
.fab { position: fixed; right: max(16px, calc(50% - 424px)); bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--berry); color: #fff; border: 0; border-radius: 999px; padding: 14px 20px; font-weight: 700; box-shadow: 0 8px 22px rgba(120,20,30,.3); z-index: 15; min-height: 52px; }

/* Calendar */
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 10px; margin: 8px -16px 0; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip button { flex: none; width: 54px; border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 8px 0 7px; text-align: center; min-height: 66px; }
.strip button b { display: block; font-size: 18px; font-family: var(--serif); }
.strip button span { font-size: 12px; color: var(--muted); }
.strip .dots { display: flex; justify-content: center; gap: 3px; height: 7px; margin-top: 3px; }
.strip i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.day { margin-bottom: 14px; scroll-margin-top: 12px; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.day-head h3 { font-size: 20px; }
.event { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.event .time { flex: none; width: 64px; font-weight: 700; font-size: 14px; color: var(--pine-2); }
.event h4 { margin: 0; font-size: 16px; font-weight: 600; }
.event.sugerido h4 { color: #5d5649; }
.warn { background: var(--amber-bg); color: var(--amber); padding: 8px 11px; border-radius: 10px; font-size: 14px; margin-top: 8px; font-weight: 600; }
.empty-day { color: var(--muted); font-size: 15px; padding: 8px 0 2px; }
.who-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.who-picker button { border: 1px solid var(--line); background: #fff; padding: 7px 12px 7px 7px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; font-weight: 600; font-size: 14px; color: var(--muted); }
.who-picker button.on { background: var(--pine); color: #fff; border-color: var(--pine); }

/* Tasks */
.task { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.check { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--pine-2); background: #fff; flex: none; display: grid; place-items: center; color: #fff; font-size: 17px; margin-top: 1px; padding: 0; }
.task.done .check { background: var(--pine-2); }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.t-body { flex: 1; min-width: 0; }
.t-title { font-weight: 600; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(25,20,10,.5); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--cream); width: min(560px, 100%); max-height: 92dvh; overflow: auto; border-radius: 22px 22px 0 0; padding: 20px 18px calc(22px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 23px; margin-bottom: 14px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.sheet-actions .btn.primary { flex: 1; }
@media (min-width: 640px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 86vw; font-size: 15px; }
#toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
