/* LifeTakes styles. Four looks: Paper, Vintage, Night, Meadow. Colours come from variables set by [data-look]. */
:root, [data-look=paper] { --bg:#F3F5F7; --card:#fff; --ink:#14202B; --mute:#55626F; --line:#C9D1D8; --acc:#1F4E79; --acc-ink:#fff; --soft:#E4ECF3; --bad:#B3261E; --ok:#1F7A4D; --dot:#C9D1D8; --font:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; --serif:Georgia,"Times New Roman",serif; --rule:transparent }
[data-look=vintage] { --bg:#F1E6CC; --card:#FBF4E2; --ink:#2E2418; --mute:#6B5A43; --line:#CDB98F; --acc:#7A4B1E; --acc-ink:#FFF8E8; --soft:#EADBB8; --bad:#9B2C1F; --ok:#4D6B2A; --dot:#CDB98F; --rule:#DCCB9F }
[data-look=night] { --bg:#101820; --card:#1A2530; --ink:#E8EEF3; --mute:#9DB0BF; --line:#32424F; --acc:#7DB7F0; --acc-ink:#0B1722; --soft:#223140; --bad:#FF8A80; --ok:#7FD6A4; --dot:#32424F }
[data-look=meadow] { --bg:#EAF2E3; --card:#F8FBF4; --ink:#1B2E1F; --mute:#52695A; --line:#BBD0B2; --acc:#2E6B3A; --acc-ink:#fff; --soft:#D8E8CC; --bad:#A93226; --ok:#2E6B3A; --dot:#BBD0B2 }
* { box-sizing:border-box }
html { color-scheme:light }
html[data-look=night] { color-scheme:dark }
body { margin:0; background:var(--bg); color:var(--ink); font:16px/1.45 var(--font); -webkit-text-size-adjust:100% }
[hidden] { display:none !important }
a { color:var(--acc) }
h1,h2 { margin:0; line-height:1.2; text-wrap:balance }
h1 { font:700 22px/1.2 var(--serif) }
button,input,select,textarea { font:inherit; color:inherit }
.screen { min-height:100vh; min-height:100dvh; background:var(--bg); color:var(--ink); display:flex; flex-direction:column; padding-bottom:calc(76px + env(safe-area-inset-bottom,0px)) }
.screen.plain { padding-bottom:24px }
.head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:calc(14px + env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) 8px max(16px,env(safe-area-inset-left,0px)) }
.head-t { min-width:0 } .head-t h1 { overflow:hidden; text-overflow:ellipsis }
.sub { color:var(--mute); font-size:14px }
.head-r { display:flex; align-items:center; gap:6px }
.content { width:100%; max-width:640px; margin:0 auto; padding:8px max(16px,env(safe-area-inset-right,0px)) 24px max(16px,env(safe-area-inset-left,0px)); display:flex; flex-direction:column; gap:14px; flex:1 }
.content.center { align-items:stretch; text-align:center; justify-content:center; gap:16px }
.content.form { gap:12px }
.stack { display:flex; flex-direction:column; gap:12px } .stack.tight { gap:6px }
.row { display:flex; gap:10px; flex-wrap:wrap } .row > * { flex:1; min-width:120px }
.row-end { display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap }
.row-between { display:flex; justify-content:space-between; align-items:center; gap:10px }
.muted { color:var(--mute) } .fine { color:var(--mute); font-size:13px; margin:0 } .mono { font-variant-numeric:tabular-nums; font-family:ui-monospace,Menlo,Consolas,monospace } .huge { font-size:40px; font-weight:700; margin:6px 0 12px }
.label,.eyebrow { font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--mute) }
.sec { font:700 15px var(--font); color:var(--mute); margin:6px 0 0 }
.err { background:color-mix(in srgb,var(--bad) 12%,transparent); color:var(--bad); border:1px solid var(--bad); border-radius:10px; padding:10px 12px; font-size:14px }
.warn { color:var(--bad); font-weight:600; margin:0 }
.bad { color:var(--bad) }
.brand { font:700 34px var(--serif); letter-spacing:.01em } .tag { color:var(--mute); margin:0 }
.hills { border-radius:14px; overflow:hidden }
.btn { min-height:48px; padding:0 18px; border-radius:12px; border:1px solid var(--line); background:var(--card); color:var(--ink); font-weight:600; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px; text-decoration:none; text-align:center }
.btn:disabled { opacity:.5; cursor:not-allowed }
.btn.primary { background:var(--acc); border-color:var(--acc); color:var(--acc-ink) }
.btn.danger { color:var(--bad); border-color:var(--bad) } .btn.primary.danger { color:#fff; background:var(--bad) }
.btn.ghost { border-color:transparent; background:transparent; color:var(--acc); padding:0 12px } .btn.ghost.danger { color:var(--bad) }
.btn.link { border:0; background:transparent; color:var(--acc); text-decoration:underline; font-weight:500 }
.btn.big { min-height:54px; font-size:17px } .btn.small { min-height:44px }
.btn:focus-visible,.chip:focus-visible,.tile:focus-visible,.cal-d:focus-visible,.nav-i:focus-visible,.mood:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,a:focus-visible { outline:3px solid var(--acc); outline-offset:2px }
.iconbtn { position:relative; width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; color:var(--ink); background:transparent; border:0 }
.bell-n { position:absolute; top:4px; right:2px; min-width:18px; height:18px; border-radius:9px; background:var(--bad); color:#fff; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; padding:0 4px }
.pill { font-size:12px; font-weight:600; padding:4px 10px; border-radius:999px; background:var(--soft); color:var(--mute) } .pill.warn { color:var(--bad); background:color-mix(in srgb,var(--bad) 12%,transparent); font-weight:600 }
.back { display:inline-flex; align-items:center; gap:4px; min-height:44px; text-decoration:none; font-weight:700; color:var(--acc) }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px; display:flex; flex-direction:column; gap:8px }
.link-card { text-decoration:none; color:var(--ink) } .notice { background:var(--soft) }
.field { display:flex; flex-direction:column; gap:6px } .field label { font-weight:600; font-size:14px } .hint { color:var(--mute); font-size:13px }
input[type=text],input[type=password],input[type=email],input[type=search],input[type=date],input[type=datetime-local],select,textarea { width:100%; min-height:48px; border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:var(--card); font-size:16px }
textarea { resize:vertical; line-height:1.55; font-family:var(--serif); font-size:17px }
input.pin { text-align:center; font-size:22px; letter-spacing:.2em }
.check { display:flex; align-items:flex-start; gap:10px; text-align:left } .check input { width:24px; height:24px; margin-top:2px; flex:none; accent-color:var(--acc) }
.quick { display:flex; gap:8px } .quick input { flex:1; min-width:0 }
.chips { display:flex; flex-wrap:wrap; gap:8px; justify-content:inherit }
.chip { min-height:44px; padding:0 14px; border-radius:999px; border:1px solid var(--line); background:var(--card); font-size:14px; cursor:pointer; display:inline-flex; align-items:center; gap:6px }
.chip.on { background:var(--acc); color:var(--acc-ink); border-color:var(--acc) }
.dot { width:10px; height:10px; border-radius:50%; display:inline-block; flex:none }
.badge { font-size:12px; font-weight:700; padding:3px 8px; border-radius:6px; background:var(--soft); color:var(--acc) }
.k-dream { background:#ECE8F6; color:#5B4B8A } .k-idea { background:#E4F1EA; color:#1F6B4A } .k-aspiration { background:#FBEBD2; color:#8A5A10 } .k-date { background:#E2EEFA; color:#1F5C99 } .k-diary { background:#F3E5DA; color:#7A4B1E } .k-anything { background:var(--soft); color:var(--mute) }
[data-look=night] .badge { filter:brightness(.8) }
.row-card { display:block; text-decoration:none; color:var(--ink); background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px 14px; min-height:48px }
.row-top { display:flex; align-items:center; gap:8px; margin-bottom:4px; color:var(--mute); font-size:13px }
.row-title { font:600 17px/1.3 var(--serif) } .row-body { color:var(--mute); font-size:14px; margin-top:2px; white-space:pre-wrap; overflow-wrap:anywhere }
.row-tags { display:flex; gap:10px; flex-wrap:wrap; margin-top:6px; font-size:13px; color:var(--mute) } .tagdot { display:inline-flex; align-items:center; gap:5px }
.when { color:var(--mute); font-size:13px }
mark { background:#FFE58F; color:#14202B; border-radius:3px; padding:0 1px }
.dates summary { min-height:44px; display:flex; align-items:center; cursor:pointer; color:var(--acc); font-weight:600 }
/* diary */
.month-bar { display:flex; align-items:center; justify-content:space-between } .month-l { font:700 18px var(--serif) }
.cal { display:grid; grid-template-columns:repeat(7,1fr); gap:4px }
.cal-h { text-align:center; font-size:12px; color:var(--mute); padding:4px 0 }
.cal-d { position:relative; min-height:44px; border:1px solid transparent; border-radius:10px; background:var(--card); cursor:pointer; font-size:15px }
.cal-d.today { border-color:var(--acc); font-weight:700 } .cal-d.sel { background:var(--acc); color:var(--acc-ink) }
.cal-dot { position:absolute; bottom:5px; left:50%; width:5px; height:5px; margin-left:-2.5px; border-radius:50%; background:var(--acc) } .cal-d.sel .cal-dot { background:var(--acc-ink) }
[data-tab=diary] textarea,[data-look=vintage] textarea { background-image:repeating-linear-gradient(transparent 0,transparent 27px,var(--rule) 28px); line-height:28px }
.moods { display:flex; gap:8px; justify-content:space-between } .mood { flex:1; min-height:48px; font-size:26px; border-radius:12px; border:1px solid var(--line); background:var(--card); cursor:pointer } .mood.on { border-color:var(--acc); background:var(--soft); outline:2px solid var(--acc) }
/* time */
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:10px }
.tile { min-height:84px; border-radius:14px; border:1px solid var(--line); background:var(--card); display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:4px; padding:12px 14px; cursor:pointer; text-align:left } .tile.on { background:var(--acc); color:var(--acc-ink); border-color:var(--acc) }
.big-timer { text-align:center }
/* voice */
.voice { display:flex; align-items:center; gap:10px; flex-wrap:wrap } .voice audio { max-width:100% } .recdot { width:12px; height:12px; border-radius:50%; background:var(--bad); animation:pulse 1s infinite } @keyframes pulse { 50% { opacity:.3 } }
/* verse */
.verse { background:var(--soft); border-color:transparent } .verse-t { font:italic 19px/1.5 var(--serif); margin:0 } .verse-r { color:var(--mute); font-size:13px }
.keybox { font:700 19px/1.6 ui-monospace,Menlo,Consolas,monospace; background:var(--card); border:2px dashed var(--acc); border-radius:12px; padding:16px; text-align:center; word-break:break-word; user-select:all }
/* looks */
.look-sw { min-height:96px; border-radius:14px; border:2px solid var(--line); background:var(--bg); color:var(--ink); display:flex; flex-direction:column; align-items:flex-start; gap:8px; padding:12px; cursor:pointer; font-weight:600 } .look-sw.on { border-color:var(--acc); box-shadow:0 0 0 2px var(--acc) }
.look-prev { display:flex; gap:4px } .look-prev i { width:22px; height:14px; border-radius:4px; background:var(--card); border:1px solid var(--line) } .look-prev i:nth-child(2) { background:var(--acc) } .look-prev i:nth-child(3) { background:var(--soft) }
/* sheet, toast */
.sheet-back { position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:50; display:flex; align-items:flex-end; justify-content:center }
.sheet { width:100%; max-width:560px; max-height:90vh; overflow:auto; background:var(--card); color:var(--ink); border-radius:18px 18px 0 0; padding:16px max(16px,env(safe-area-inset-right,0px)) calc(16px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px)); display:flex; flex-direction:column; gap:12px }
.sheet-head { display:flex; justify-content:space-between; align-items:center } .sheet-head h2 { font:700 18px var(--serif) }
.steps { margin:0; padding-left:20px; display:flex; flex-direction:column; gap:8px } .ring-t { font:700 22px var(--serif); margin:0 }
.toast { position:fixed; left:50%; transform:translateX(-50%); bottom:calc(92px + env(safe-area-inset-bottom,0px)); max-width:calc(100% - 32px); z-index:60; background:var(--ink); color:var(--bg); padding:12px 16px; border-radius:12px; display:flex; gap:14px; align-items:center }
.toast-undo { background:transparent; border:0; color:inherit; font-weight:700; text-decoration:underline; min-height:44px; cursor:pointer }
/* bottom navigation */
.nav { position:fixed; left:0; right:0; bottom:0; z-index:20; background:var(--card); border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-around; padding:6px max(8px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px)) }
.nav-i { flex:1; min-height:52px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; font-size:12px; text-decoration:none; color:var(--mute) } .nav-i.on { color:var(--acc); font-weight:700 }
.nav-add { width:56px; height:56px; border-radius:50%; background:var(--acc); color:var(--acc-ink); display:flex; align-items:center; justify-content:center; margin-top:-22px; box-shadow:0 4px 10px rgba(0,0,0,.25); text-decoration:none }
/* wide screens: the bar becomes a rail on the left, the page stays a centred column */
@media (min-width:900px) {
  .screen { padding-bottom:24px; padding-left:96px }
  .nav { top:0; right:auto; bottom:0; width:88px; flex-direction:column; justify-content:flex-start; gap:10px; padding:20px 6px; border-top:0; border-right:1px solid var(--line) }
  .nav-i { flex:none; width:100%; } .nav-add { margin-top:0; order:-1 }
  .toast { bottom:24px } .sheet-back { align-items:center } .sheet { border-radius:18px }
}
@media (prefers-reduced-motion:reduce) { .recdot { animation:none } * { scroll-behavior:auto !important } }
