/* Mitavya web: the Android app's look in CSS. Colours come from the theme (themes.js sets the variables). */
@font-face { font-family: 'Nunito'; src: url(../fonts/nunito_regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(../fonts/nunito_semibold.ttf); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(../fonts/nunito_bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(../fonts/nunito_extrabold.ttf); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Kalam'; src: url(../fonts/kalam_regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Kalam'; src: url(../fonts/kalam_bold.ttf); font-weight: 700 800; font-display: swap; }

/* Telugu and Hindi letters (Noto Sans, SIL Open Font License); loaded only when those letters appear. */
@font-face { font-family: 'Noto Telugu'; src: url(../fonts/noto-telugu-400.woff2) format('woff2'); font-weight: 400 600; unicode-range: U+0C00-0C7F, U+200C-200D, U+25CC; font-display: swap; }
@font-face { font-family: 'Noto Telugu'; src: url(../fonts/noto-telugu-700.woff2) format('woff2'); font-weight: 700 900; unicode-range: U+0C00-0C7F, U+200C-200D, U+25CC; font-display: swap; }
@font-face { font-family: 'Noto Devanagari'; src: url(../fonts/noto-devanagari-400.woff2) format('woff2'); font-weight: 400 600; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; font-display: swap; }
@font-face { font-family: 'Noto Devanagari'; src: url(../fonts/noto-devanagari-700.woff2) format('woff2'); font-weight: 700 900; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; font-display: swap; }

:root {
  --bg: #F5F4F9; --card: #fff; --sheet: #fff; --ink: #1E1C2B; --sub: #686678; --faint: #C2C0CF; --line: #EAE8F1;
  --accent: #5653D4; --on-accent: #fff; --tint: #EDEDFC; --tint-ink: #4744C0; --heat1: #FCE0E2; --heat1-ink: #8E1D2A;
  --heat2: #F08C95; --heat2-ink: #560D16; --dot: #8B89EA; --alert: #D5384C; --good: #2E7D4B; --top-ink: #1E1C2B; --top-sub: #5B5969;
  --edge: rgba(0,0,0,.06); --glass: rgba(255,255,255,.6); --font: 'Nunito', 'Noto Telugu', 'Noto Devanagari', system-ui, sans-serif; --font-scale: 1;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-dark="1"] { color-scheme: dark; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body { font-family: var(--font); font-size: calc(16px * var(--font-scale)); line-height: 1.35; overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
small { font-size: .82em; }
b, strong, .strong { font-weight: 700; }
hr { border: 0; height: 1px; background: var(--line); margin: 0; }

/* wallpaper and particles behind everything */
#wall { position: fixed; inset: 0 0 auto 0; height: 62vh; background-size: cover; background-position: center top; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent); transition: opacity .3s; }
#wall[data-on="0"] { display: none; }
body[data-fade="mid"] #wall { opacity: .78; }
body[data-fade="faint"] #wall { opacity: .3; }
body[data-fade="deep"] #wall { opacity: .12; }
#particles { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
#main { position: relative; z-index: 2; min-height: 100vh; transition: filter .25s; }
#main.blurred { filter: blur(10px); }

.view { max-width: 640px; margin: 0 auto; }
.scroll { padding: calc(var(--safe-top) + 6px) 16px 32px; }
.pad-bottom { padding-bottom: calc(170px + var(--safe-bottom)); }
.pad { padding: 8px 6px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.baseline { align-items: baseline; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 10px; }
.small-gap { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.block { display: block; }
.mt { display: block; margin-top: 16px; margin-bottom: 8px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowrap { white-space: nowrap; }
.sub { color: var(--sub); } .faint { color: var(--faint); display: block; } .accent { color: var(--accent); }
.alert { color: var(--alert); } .good { color: var(--good); }
.label { font-size: .88em; color: var(--sub); margin: 12px 0 6px; }
.label.accent { color: var(--accent); } .label.alert { color: var(--alert); }
.ico { flex: none; display: inline-block; vertical-align: middle; }

/* headers */
header.top { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 4px 0; color: var(--top-ink); }
header.top h1 { font-size: 1.3em; font-weight: 800; }
header.top p { font-size: .9em; color: var(--top-sub); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--card) 55%, transparent); color: var(--top-ink); }
:root[data-dark="1"] .icon-btn { background: color-mix(in srgb, var(--card) 45%, transparent); }
.icon-btn.plain { background: none; color: var(--sub); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-space { width: 44px; flex: none; }
.month-bar { display: flex; align-items: center; min-height: 44px; }
.month-bar h2 { font-size: 1.12em; font-weight: 700; }
.month-bar.on-wall { color: var(--top-ink); } .month-bar.on-wall .icon-btn { color: var(--top-ink); }
.spaced { letter-spacing: 1.5px; font-size: .95em !important; }
h3.section { font-size: 1.12em; font-weight: 800; margin: 18px 6px 8px; }
.section-row { margin-top: 6px; padding-right: 6px; } .section-row h3 { margin-bottom: 8px; } .section-row b { margin-top: 10px; }
.title { font-size: 1.2em; font-weight: 800; }

/* cards and glass */
.card { background: var(--card); border: 1px solid var(--edge); border-radius: 22px; margin-top: 10px; }
.card.padded { padding: 16px; }
.card.list { padding: 0 16px; }
.card.tinted { background: var(--tint); }
.glass { display: block; width: 100%; margin-top: 10px; padding: 12px 16px; border-radius: 20px; background: var(--glass); border: 1px solid var(--edge);
  color: var(--top-ink); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.summary small { color: var(--top-sub); letter-spacing: .3px; }
.summary .see { color: var(--top-ink); font-weight: 700; white-space: nowrap; }
.summary .of { margin-left: 8px; }
.summary .bar { margin: 6px 0; }
.display { font-size: 2.5em; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; font-variant-numeric: tabular-nums; text-shadow: 0 0 8px color-mix(in srgb, var(--bg) 35%, transparent); }
.stat { font-size: 1.75em; font-weight: 800; font-variant-numeric: tabular-nums; }
.num { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num.big { font-size: 1.25em; }
.mini-total { width: auto; margin: 0; padding: 6px 12px; text-align: right; border-radius: 14px; }
.mini-total small { display: block; color: var(--top-sub); }
.bar { width: 100%; border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 9px; }

/* calendar */
.cal { padding: 0 6px 8px; touch-action: pan-y; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; justify-items: center; }
.cal-grid .wd { font-size: .78em; color: var(--sub); padding: 4px 0; }
.day { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: min(15px, 1em); font-variant-numeric: tabular-nums; }
.day.today { color: var(--accent); font-weight: 800; }
.day.h1 { background: var(--heat1); color: var(--heat1-ink); font-weight: 800; }
.day.h2 { background: var(--heat2); color: var(--heat2-ink); font-weight: 800; }
.day.sel { background: var(--accent); color: var(--on-accent); font-weight: 800; }
.day.sel.h1, .day.sel.h2 { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 5px var(--accent); }
.day.dot::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--dot); }

.day-box { padding: 10px 14px; margin-top: 12px; border-radius: 16px; }
.day-box.over { border-color: color-mix(in srgb, var(--alert) 60%, transparent); }
.day-box small { color: var(--sub); display: block; }
.day-box small.alert { color: var(--alert); margin-top: 4px; }
.empty-day { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 18px; color: var(--sub); margin-bottom: 7px; }
.pill { background: var(--accent); color: var(--on-accent); border-radius: 14px; padding: 8px 14px; font-weight: 700; font-size: .9em; white-space: nowrap; }

/* rows */
.item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 14px 9px 10px; margin-top: 7px; background: var(--card);
  border-radius: 18px; min-height: 56px; }
.item.slim { padding: 11px 14px; }
.item b { display: block; } .item small { display: block; color: var(--sub); }
.item .time { color: var(--sub); white-space: nowrap; }
.item .num.accent { color: var(--accent); }
.item.bill { padding: 10px 14px 10px 10px; }
.item .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.date-box { min-width: 46px; min-height: 48px; border-radius: 14px; background: var(--tint); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px; }
.date-box b { font-size: 1.12em; } .date-box small { color: var(--sub); }
.badge { --badge-ink: var(--hue); flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--hue) 15%, transparent); }
:root[data-dark="1"] .badge { background: color-mix(in srgb, var(--hue) 24%, transparent); --badge-ink: color-mix(in srgb, var(--hue) 78%, white); }
.round-icon { flex: none; border-radius: 12px; background: var(--tint); display: grid; place-items: center; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.list-row:first-child { border-top: 0; }
.list-row small { display: block; color: var(--sub); }
.setting-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 0; cursor: pointer; }
.setting-row b { display: block; } .setting-row small { display: block; color: var(--sub); }
div.setting-row { cursor: default; }

/* floating buttons and tabs */
.fab, .side-fab { position: fixed; bottom: calc(86px + var(--safe-bottom)); width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; z-index: 5; }
.fab { right: max(20px, calc(50vw - 300px)); background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .22s; }
.fab.turned { transform: rotate(45deg); }
.side-fab { left: max(20px, calc(50vw - 300px)); background: var(--sheet); color: var(--accent); border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: space-evenly; padding: 8px 0 calc(8px + var(--safe-bottom));
  background: color-mix(in srgb, var(--sheet) 96%, transparent); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.tabs button { min-width: 88px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--sub); font-size: .82em; padding: 4px 6px; border-radius: 14px; }
.tabs button.on { color: var(--accent); font-weight: 800; }
.undo { position: fixed; left: 16px; right: 16px; bottom: calc(92px + var(--safe-bottom)); max-width: 608px; margin: 0 auto; z-index: 7; display: flex; align-items: center;
  background: var(--ink); color: var(--bg); border-radius: 16px; padding: 4px 6px 4px 16px; }
.undo button { color: var(--dot); font-weight: 700; padding: 10px 12px; display: flex; gap: 6px; align-items: center; }
.install-banner { position: fixed; left: 12px; right: 12px; top: calc(var(--safe-top) + 8px); z-index: 8; max-width: 616px; margin: 0 auto; display: flex; align-items: center; gap: 6px;
  background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.15); font-size: .9em; }
.scrim { position: fixed; inset: 0; z-index: 4; background: color-mix(in srgb, var(--bg) 60%, transparent); }
.bloom { position: fixed; right: max(22px, calc(50vw - 298px)); bottom: calc(156px + var(--safe-bottom)); z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.bloom-chip { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 30px; background: var(--sheet); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  opacity: 0; transform: scale(.4); transform-origin: right bottom; transition: opacity .18s, transform .22s; font-size: .9em; }
.bloom.open { pointer-events: auto; }
.bloom.open .bloom-chip { opacity: 1; transform: none; transition-delay: var(--d); }
.plain-ico { width: 28px; height: 28px; display: grid; place-items: center; }

/* pocket ring */
.ring { position: relative; width: 196px; height: 196px; margin: 6px auto 0; color: var(--top-ink); }
.ring-arc { transition: stroke-dashoffset .9s cubic-bezier(.4,0,.2,1); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-text small { color: var(--top-sub); }
.inout { justify-content: space-around; margin: 6px 0 4px; }
.inout span { display: flex; flex-direction: column; align-items: center; } .inout small { color: var(--top-sub); }
.inout .num { font-size: 1.12em; }

/* chips, segments, switches */
.chips { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 30px; border: 1px solid var(--line); font-size: .9em; white-space: nowrap; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cat-chip { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 30px; font-size: .9em; white-space: nowrap;
  background: color-mix(in srgb, var(--hue) 13%, transparent); color: var(--ink); }
.cat-chip .ico { color: var(--hue); }
.cat-chip.on { background: var(--hue); color: #fff; } .cat-chip.on .ico { color: #fff; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--line); }
.seg button { flex: 1; min-height: 38px; border-radius: 11px; text-align: center; font-size: .88em; color: var(--sub); padding: 6px 4px; }
.seg button.on { background: var(--sheet); color: var(--ink); font-weight: 700; }
.switch { flex: none; width: 52px; height: 32px; border-radius: 16px; background: var(--sheet); border: 2px solid var(--faint); position: relative; transition: background .2s; }
.switch i { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--sub); transition: transform .2s, background .2s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on i { transform: translateX(20px); background: var(--on-accent); }
.text-btn { color: var(--accent); font-weight: 700; padding: 11px 12px; border-radius: 12px; }
.text-btn.sub { color: var(--sub); } .text-btn.alert { color: var(--alert); }
.filled { display: block; width: auto; min-height: 50px; margin-top: 14px; padding: 12px 20px; border-radius: 25px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-align: center; cursor: pointer; }
.filled.wide { width: 100%; }

/* inputs */
input.line { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 10px 0; outline: none; border-radius: 0; }
input.line::placeholder, .display-input::placeholder, input.box::placeholder { color: var(--faint); }
.amount-row { margin-top: 6px; }
.display-input { flex: 1; min-width: 0; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; outline: none; font-size: 2.4em; font-weight: 800; padding: 4px 0; border-radius: 0; }
.display-input.small { font-size: 1.7em; }
input.box, .amount-box { width: 112px; min-height: 42px; border: 0; border-radius: 12px; background: var(--line); padding: 8px 12px; text-align: right; font-weight: 700; outline: none; }
.amount-box { display: flex; align-items: center; gap: 4px; color: var(--sub); }
.amount-box input { width: 100%; min-width: 0; border: 0; background: none; text-align: right; font-weight: 700; color: var(--ink); outline: none; }
.amount-box input::placeholder { color: var(--faint); }
.picker-row { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px 0; }
.picker-row input[type="time"], .picker-row input[type="date"] { border: 0; background: none; color: var(--accent); font-weight: 700; text-align: right; min-height: 30px; }
.overlay { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.select-box { position: relative; padding: 10px 12px; border-radius: 12px; background: var(--line); font-weight: 700; white-space: nowrap; }

/* sheets */
#sheet { position: fixed; inset: 0; z-index: 20; display: none; }
#sheet.open { display: block; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.28); animation: fade .2s; }
.sheet-box { position: absolute; left: 50%; bottom: calc(12px + var(--safe-bottom)); transform: translateX(-50%); width: calc(100% - 24px); max-width: 600px;
  max-height: calc(100% - var(--safe-top) - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--sheet); border-radius: 28px; padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: rise .24s cubic-bezier(.2,.8,.2,1); }
.sheet-box.big { height: 86%; }
.sheet-box h2 { font-size: 1.3em; font-weight: 800; margin-bottom: 6px; }
@keyframes rise { from { transform: translate(-50%, 30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.confirm { background: color-mix(in srgb, var(--alert) 10%, transparent); border-radius: 16px; padding: 12px 4px 4px 14px; margin-top: 14px; }
.confirm .row.end { margin-top: 2px; }
.table { margin-top: 6px; }
.th { padding: 8px 0; color: var(--sub); font-size: .88em; border-bottom: 1px solid var(--line); }
.th.total { color: var(--ink); border-bottom: 0; border-top: 1px solid var(--line); font-size: 1em; padding: 10px 0; }
.pct { width: 52px; text-align: right; flex: none; }
.trow { display: block; width: 100%; padding: 9px 0; border-radius: 12px; }
.trow .indent { display: block; padding-left: 38px; padding-right: 52px; margin-top: 4px; }
.trow small.indent { padding-right: 0; }
.pick-head { gap: 14px; margin: 10px 0 12px; }
.type-row { padding: 6px 0; }
.news { margin: 4px 0 0; padding-left: 20px; } .news li { margin: 4px 0; }
.steps { padding-left: 22px; } .steps li { margin: 8px 0; }

/* settings */
.profile { display: flex; align-items: center; gap: 14px; padding: 18px 10px 18px 16px; }
.avatar { flex: none; border-radius: 50%; overflow: hidden; background: var(--tint); display: grid; place-items: center; }
.avatar.letter { color: var(--tint-ink); font-weight: 800; }
.themes { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.theme-card { flex: none; width: 88px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--sub); }
.theme-card.on { color: var(--ink); font-weight: 700; }
.theme-swatch { position: relative; width: 88px; height: 104px; border-radius: 16px; background-size: cover; background-position: center; border: 3px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); display: block; overflow: hidden; }
.theme-card.on .theme-swatch { border-color: var(--accent); }
.theme-swatch i { position: absolute; left: 8px; top: 8px; width: 34px; height: 7px; border-radius: 4px; opacity: .75; }
.theme-swatch em { position: absolute; left: 8px; right: 8px; top: 22px; height: 30px; border-radius: 7px; border: 1px solid; }
.theme-swatch .dot { position: absolute; left: 50%; bottom: 8px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.avatar-tile { aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--tint); border: 3px solid transparent; display: grid; place-items: center; padding: 3px; }
.avatar-tile.on { border-color: var(--accent); }
.avatar-tile .letter { font-size: 1.6em; font-weight: 800; color: var(--tint-ink); }
.health { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: var(--hue); background: color-mix(in srgb, var(--hue) 18%, transparent); margin-right: 6px; }
.search-box { margin: 0; padding: 0 14px; }

/* PIN */
.pin { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: calc(var(--safe-top) + 20px) 28px calc(var(--safe-bottom) + 12px); color: var(--top-ink); text-align: center; }
.pin .grow { flex: 1; }
.pin h1 { font-size: 1.4em; font-weight: 800; } .pin p { margin-top: 6px; color: var(--top-sub); } .pin p.accent { color: var(--accent); }
.dots { display: flex; gap: 20px; margin-top: 26px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--top-sub); }
.dots i.on { background: var(--top-ink); border-color: var(--top-ink); }
.dots.shake { animation: shake .25s; }
@keyframes shake { 25% { transform: translateX(14px); } 50% { transform: translateX(-10px); } 75% { transform: translateX(6px); } }
.keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 6px 16px; padding: 10px 6px; background: var(--card); border-radius: 32px; color: var(--ink); }
.key { width: 72px; height: 72px; border-radius: 50%; font-size: min(28px, 1.75em); font-weight: 700; display: grid; place-items: center; }
.key:active { background: var(--tint); }
.pin .gap { height: 12px; }

#toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-bottom)); transform: translate(-50%, 20px); z-index: 30; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 14px; opacity: 0; transition: .25s; pointer-events: none; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { .scroll { padding-left: 24px; padding-right: 24px; } }
.row.mt { display: flex; margin-bottom: 0; }
.intro { position: fixed; inset: 0; z-index: 50; transition: opacity .22s; cursor: pointer; }
.intro canvas { display: block; }
.intro.out { opacity: 0; }

/* Fit the PIN screen inside the visible area, even with the browser's toolbar showing (100dvh), and shrink keys on short screens. */
#main { min-height: 100dvh; }
.pin { min-height: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.keys { grid-template-columns: repeat(3, min(72px, 8.5dvh)); row-gap: min(6px, 0.6dvh); }
.key { width: min(72px, 8.5dvh); height: min(72px, 8.5dvh); }
.dots { margin-top: min(26px, 2.5dvh); }

/* 2.6.0 */
.tabs button { min-width: 72px; }
.month-bar .jump { color: inherit; padding: 4px 8px; border-radius: 12px; }
.month-bar .today-pill { padding: 5px 12px; font-size: .82em; font-weight: 700; }
.item.picked { outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.select-bar { position: fixed; left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 8; display: flex; align-items: center; gap: 10px;
  max-width: 600px; margin: 0 auto; padding: 8px 12px; border-radius: 18px; background: var(--sheet); color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.select-bar b, .select-bar small { display: block; } .select-bar small { color: var(--sub); }
.view-amount { font-size: 2.2em; margin: 14px 0 6px; }
.view-note { background: var(--tint); color: var(--tint-ink); padding: 10px 14px; border-radius: 14px; margin: 8px 0 14px; }
.month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.month-grid .chip { text-align: center; }
.month-grid .chip:disabled { opacity: .35; }
.icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 10px 0; }
.icon-pick { display: grid; place-items: center; padding: 4px; border-radius: 14px; border: 2px solid transparent; }
.icon-pick.on { border-color: var(--accent); }
#guess { min-height: 4px; margin: 2px 0; }
#guess .ico { vertical-align: -2px; }
textarea.qtype { width: 100%; resize: none; font: inherit; font-size: 1.2em; font-weight: 700; }
.hand { font-family: 'Kalam', var(--font); font-size: 1.35em; text-align: center; color: var(--ink); margin: 18px 0 10px; line-height: 1.4; }
.hand span { color: var(--accent); }

/* ---------------- 2.9.0 ---------------- */

/* Five tabs (with Mirai) share the width evenly. */
.tabs.five button { min-width: 0; flex: 1; padding: 4px 2px; font-size: .78em; }

/* Text that sits straight on the page (not on a card). Yoru has light cards on a dark page. */
.on-page { color: var(--top-ink); }
.on-page.sub, .on-page .sub { color: var(--top-sub); }
:root[data-bgdark="1"] h3.section, :root[data-bgdark="1"] .scroll > p.sub, :root[data-bgdark="1"] .scroll > p.pad { color: var(--top-ink); }
:root[data-bgdark="1"] .scroll > small.sub { color: var(--top-sub); }

/* Mirai home: four tall tiles with drawings. */
.mi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.mi-tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 228px; padding: 14px; border-radius: 24px;
  background: color-mix(in srgb, var(--hue) 12%, var(--card)); border: 1px solid var(--edge); color: var(--ink); text-align: left; }
:root[data-dark="1"] .mi-tile { background: color-mix(in srgb, var(--hue) 20%, var(--card)); }
.mi-tile svg { width: 100%; height: 124px; }
.mi-tile-title { font-size: 1.25em; font-weight: 800; margin-top: 10px; }
.mi-tile small { color: var(--sub); }
.mi-tile.soon { background: color-mix(in srgb, var(--card) 72%, transparent); }
.mi-tile.soon svg { opacity: .5; }
.mi-tile.soon .mi-tile-title { color: var(--sub); }
.mi-soon { align-self: flex-start; margin-top: 6px; font-size: .78em; color: var(--sub); background: var(--sheet); border-radius: 30px; padding: 4px 10px; }
:root[data-paper="1"] .mi-tile { border-radius: 18px; }

.mi-card { border: 1px solid var(--edge); border-radius: 20px; padding: 14px; margin-top: 10px; }
.mi-card .bar { margin: 8px 0 2px; }
.mi-fold { margin-top: 14px; padding: 14px 16px; border-radius: 16px; }
.mi-hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
.mi-hero .display { text-shadow: none; margin-top: 14px; color: var(--ink); }
.mi-ring { width: 144px; height: 144px; color: var(--ink); }
.mi-ring .ring-text small { color: var(--sub); }
.mi-ring-icon { margin-top: 4px; }
.mi-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 16px; text-align: left; }
.mi-stats span { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 14px; padding: 10px 12px; }
.mi-stats small { display: block; color: var(--sub); }
.mi-pace { margin-top: 12px; font-weight: 700; }
.mi-note { font-family: 'Kalam', var(--font); font-size: 1.2em; line-height: 1.4; color: var(--accent); margin: 2px 0; }
.mi-note-box { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 18px; padding: 14px 16px; margin: 12px 0 4px; }
.mi-actions { margin-top: 14px; gap: 10px; }
.mi-day { margin: 16px 6px 2px; font-weight: 700; }
.mi-icons { gap: 6px; padding: 8px 0; }
.mi-icon { border-radius: 50%; padding: 2px; border: 2px solid transparent; flex: none; }
.mi-icon.on { border-color: var(--accent); }
.right-col { text-align: right; }
.pill.big { min-height: 50px; border-radius: 25px; font-size: 1em; padding: 12px 18px; text-align: center; }
.pill.outline { background: none; color: var(--accent); border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.block-btn { display: block; width: 100%; margin-top: 14px; }
.center-row { justify-content: center; margin-top: 4px; }
.stat-input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--line); background: none; outline: none; font-size: 1.6em; font-weight: 800; padding: 6px 0; border-radius: 0; }
.stat-input::placeholder { font-size: .6em; font-weight: 600; color: var(--faint); }
hr.mt-s { margin: 12px 0 4px; }

/* Backup reminder on Spending. */
.notice { display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 14px; }

/* The weekly / monthly switch in the category view. */
.bd-seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--line); margin: 8px 0 4px; }
.bd-seg button { flex: 1; min-height: 38px; border-radius: 11px; text-align: center; font-size: .9em; color: var(--sub); }
.bd-seg button.on { background: var(--sheet); color: var(--ink); font-weight: 700; }

/* Bottom of Settings: the two lines with the theme's colours flowing through them, then "a product of HAYUZEN". */
.brand-foot { text-align: center; margin: 30px 0 10px; }
.brand-dash { display: block; width: 36px; height: 3px; border-radius: 2px; margin: 0 auto 14px; background: color-mix(in srgb, var(--bg-accent, var(--accent)) 50%, transparent); }
.living-quote { font-size: 1em; font-weight: 800; line-height: 1.4; margin: 0;
  background: linear-gradient(90deg, var(--bg-accent, var(--accent)), var(--dot), #6FB7E8, #FF9AB8, var(--bg-accent, var(--accent)));
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: quote-drift 4.8s linear infinite alternate; }
@keyframes quote-drift { from { background-position: 0% 0; } to { background-position: 100% 0; } }
@media (prefers-reduced-motion: reduce) { .living-quote { animation: none; } }
.wordmark { margin-top: 26px; color: var(--top-ink); }
.wordmark small { display: block; letter-spacing: 1px; opacity: .55; }
.wordmark b { display: block; font-size: 1.35em; font-weight: 800; letter-spacing: 6px; opacity: .72; margin-top: 2px; }

/* Paper look (Yoru, Sakura Neko): solid cream cards, a floating tab bar and a ringed + button. */
:root[data-paper="1"] .card, :root[data-paper="1"] .item { border-radius: 18px; border: 1px solid var(--edge); }
:root[data-paper="1"] .tabs { left: 14px; right: 14px; bottom: calc(10px + var(--safe-bottom)); padding: 8px 4px; border-radius: 32px; max-width: 612px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--edge); box-shadow: 0 10px 28px rgba(0,0,0,.22); }
:root[data-paper="1"] .fab { background: linear-gradient(var(--fab-top), var(--fab-bottom)); border: 3px solid var(--fab-ring); color: var(--fab-ring); width: 64px; height: 64px; bottom: calc(98px + var(--safe-bottom)); }
:root[data-paper="1"] .side-fab { bottom: calc(98px + var(--safe-bottom)); }
:root[data-paper="1"] .undo { bottom: calc(104px + var(--safe-bottom)); }
:root[data-paper="1"] .glass { background: var(--card); color: var(--ink); }
:root[data-paper="1"] .glass small, :root[data-paper="1"] .glass .see { color: var(--sub); }
:root[data-paper="1"] .icon-btn:not(.plain) { border-radius: 14px; background: var(--card); color: var(--ink); border: 1px solid var(--edge); }
.day-box { position: relative; overflow: hidden; }
.day-art { position: absolute; right: 0; bottom: 0; pointer-events: none; }
.day-box .row { position: relative; z-index: 1; }

/* The monthly statement page (prints as a clean A4 PDF). */
.statement { --st-ink: #1E1C2B; --st-sub: #686678; background: var(--st-page); color: var(--st-ink); border: 1px solid var(--st-line); border-radius: 18px;
  padding: 22px 18px; margin-top: 14px; font-size: 14px; line-height: 1.45; }
.statement h3 { font-size: 1.05em; margin: 0 0 8px; }
.statement p { color: var(--st-sub); margin: 0; }
.st-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; border-bottom: 2px solid var(--st-brand); padding-bottom: 10px; }
.st-brand { color: var(--st-brand); font-size: 1.6em; font-weight: 800; }
.st-head span { color: var(--st-sub); font-size: .9em; }
.st-summary { margin: 12px 0 !important; color: var(--st-ink) !important; font-weight: 600; }
.st-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.st-cards div, .statement section { background: var(--st-card); border: 1px solid var(--st-line); border-radius: 12px; padding: 10px 12px; }
.st-cards small { display: block; color: var(--st-sub); }
.st-cards b { font-size: 1.15em; }
.statement section { margin-top: 10px; break-inside: avoid; }
.st-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 10px; }
.st-row { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-top: 1px solid var(--st-line); }
.st-row:first-of-type { border-top: 0; }
.st-row span:first-child { flex: 1; min-width: 0; }
.st-row small { display: block; color: var(--st-sub); }
.st-pct { width: 40px; text-align: right; color: var(--st-sub); }
.st-big { font-size: 1.2em; }
.st-all table { width: 100%; border-collapse: collapse; font-size: .9em; }
.st-all th, .st-all td { text-align: left; padding: 5px 4px; border-bottom: 1px solid var(--st-line); }
.st-all th { color: var(--st-sub); font-weight: 700; }
.st-all .r { text-align: right; white-space: nowrap; }
.st-all tfoot td { font-weight: 800; border-bottom: 0; }
.st-all section, .statement .st-all { break-inside: auto; }
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { background: #fff !important; }
  #wall, #particles, .no-print, .tabs, .fab, .side-fab, .undo, .install-banner, #toast, #sheet { display: none !important; }
  #main { min-height: 0; }
  .scroll { padding: 0 !important; }
  .statement { border: 0; margin: 0; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.day-box.with-art { min-height: 72px; }
.day-box.with-art > .row, .day-box.with-art > small { padding-right: var(--art-w); }
