/* LiksaVahti visual parity. Load after style.css; all assets stay local. */
:root {
  color-scheme: dark;
  --bg: #0b0b0a;
  --bg2: #121211;
  --surface: #141413;
  --surface2: #1d1c1a;
  --border: #24231f;
  --text: #edeae4;
  --muted: #8c877e;
  --accent: #b8975a;
  --gold: #b8975a;
  --gold2: #e9d8b4;
  --good: #86c2a0;
  --warn: #d1b27a;
  --bad: #e08a83;
  --serif: Georgia, 'Times New Roman', serif;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f5f2;
  --bg2: #efede8;
  --surface: #fff;
  --surface2: #f0eeea;
  --border: #e7e4de;
  --text: #161513;
  --muted: #7a766e;
  --good: #2f6f4f;
  --warn: #8b681e;
  --bad: #a8423f;
}
html { min-height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  min-height: 100dvh;
  background: radial-gradient(800px 360px at 85% -160px, var(--bg2), transparent 70%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, small, strong, b, label, summary { overflow-wrap: anywhere; }
h1 { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.2; letter-spacing: -.005em; }
h2 { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
h3 { font-size: .95rem; font-weight: 700; line-height: 1.4; }
p { margin-bottom: 14px; }
small { color: var(--muted); }
.eyebrow { color: var(--gold); font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 3px; }
.sidebar { display: none; }
.workspace { margin-left: 0; min-width: 0; }
main {
  width: 100%; max-width: 560px; min-width: 0; margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(150px + env(safe-area-inset-bottom, 0px));
}
.topbar { max-width: 560px; margin: 0 auto; padding: 14px 16px; background: transparent; border: 0; flex-wrap: wrap; }
.mobile-brand { display: flex; min-width: 0; color: var(--text); }
.brand, .mobile-brand { font-family: var(--serif); font-weight: 600; }
.save-state, .device-label { color: var(--muted); }
.page-title, .liksa-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 4px 2px 18px; }
.page-title > div, .liksa-top > div { min-width: 0; max-width: 100%; }
.page-title .eyebrow { display: block; }
.liksa-top h1 { margin: 0; }
.liksa-top .eyebrow { display: block; margin-bottom: 3px; }
.local-pill { border-color: var(--border); color: var(--muted); white-space: normal; }
.month-picker, .liksa-month {
  display: flex; align-items: center; justify-content: center; gap: 2px; flex: 0 1 auto;
  max-width: 100%; min-width: 0; margin-left: 0; padding: 3px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-size: .85rem; font-weight: 700;
}
.month-picker > span { display: block; min-width: 0; text-align: center; overflow-wrap: anywhere; }
.month-picker button { min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.month-picker input { width: 9.25rem; max-width: 100%; min-height: 44px; padding: 6px; border: 0; border-radius: 999px; background: transparent; font-size: 1rem; }
.month-picker button:hover { background: var(--surface2); }
.liksa-month button { flex: 0 0 44px; min-width: 44px; min-height: 44px; border: 0; padding: 0; background: transparent; color: var(--muted); border-radius: 50%; }
.liksa-month button:hover { background: var(--surface2); }
.liksa-month label { position: relative; display: flex; align-items: center; justify-content: center; flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 6px; text-align: center; cursor: pointer; }
.liksa-month label span { min-width: 0; font-size: .85rem; overflow-wrap: anywhere; }
.liksa-month input[type='month'] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 44px; max-width: 100%; padding: 0; opacity: 0; cursor: pointer; }
.liksa-month label:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 12px; }
.liksa-alerts { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 44px; min-height: 44px; gap: 6px; padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 700; }
.liksa-alerts svg { width: 17px; height: 17px; }
.liksa-alerts b { min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; background: var(--gold); color: #141413; border-radius: 999px; font-size: .72rem; }
.liksa-alerts.warn b { color: #fff; background: var(--bad); }
.liksa-footer { text-align: center; font-size: .76rem; color: var(--muted); padding: 18px 0 0; overflow-wrap: anywhere; }
.liksa-footer a, .liksa-footer button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 4px 6px; font-size: .875rem; color: inherit; }
.liksa-disclaimer { text-align: center; color: var(--muted); font-size: .84rem; line-height: 1.5; margin: 8px 4px 16px; }
.liksa-disclaimer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; }
.shift-presets { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shift-presets > span { width: 100%; font-size: .8rem; color: var(--muted); font-weight: 700; }
.shift-presets .button { border-radius: 999px; padding: 8px 12px; }
dialog .fields > details, dialog .fields > p { grid-column: 1 / -1; }
dialog .fields > details .field { margin-top: 12px; }
dialog form[data-entity='shifts'] .field:has(input[name='date']), dialog form[data-entity='shifts'] .field:has(input[name='breakMinutes']) { grid-column: 1 / -1; }
.liksa-future > div { display: flex; flex-direction: column; gap: 8px; }
.liksa-future strong { font-family: var(--serif); font-size: 2.3rem; color: var(--gold); font-weight: 600; line-height: 1.1; }
.card { border: 1px solid var(--border); border-radius: 18px; padding: 18px 16px; margin-bottom: 14px; background: var(--surface); box-shadow: none; }
.card-heading { gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.card-heading h2 { margin: 0; max-width: 100%; }
.card-heading .button { padding: 4px 8px; background: transparent; color: var(--muted); border-color: transparent; }
.grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
.grid .card { height: auto; }
.grid.metrics {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: 10px; margin: 14px 0;
}
.metric { min-width: 0; padding: 12px 12px 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.metric > span { color: var(--muted); font-size: .74rem; font-weight: 650; line-height: 1.4; }
.metric strong { font-family: var(--serif); font-size: 1.45rem; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.metric small { font-size: .75rem; line-height: 1.4; margin-top: 5px; }
.metric.good strong, .metric.in strong, .good-text { color: var(--good); }
.metric.bad strong, .metric.out strong, .bad-text { color: var(--bad) !important; }
.liksa-stats, .liksa-stats.metric3 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6rem), 1fr));
  gap: 10px; margin: 0 0 14px;
}
.liksa-stats .metric > span { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.liksa-stats .metric strong { font-size: 1.4rem; }
.liksa-stats button.metric { text-align: left; cursor: pointer; }
.liksa-ticker {
  margin: 0 -16px 16px; padding: 9px 16px; max-width: calc(100% + 32px);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; gap: 30px; overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: thin; white-space: nowrap; color: var(--muted);
}
.liksa-ticker .track { display: flex; gap: 30px; }
.liksa-ticker span { flex: 0 0 auto; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.liksa-ticker b { color: var(--text); margin-left: 8px; font-variant-numeric: tabular-nums; }
.liksa-ticker .up { color: var(--good); }
.liksa-ticker .dn { color: var(--bad); }
.liksa-hero, .overview {
  display: block; position: relative; min-width: 0; margin-bottom: 14px; border-radius: 26px; padding: 24px 22px 22px;
  background: radial-gradient(380px 180px at 100% 0%, rgba(184, 151, 90, .16), transparent 65%), linear-gradient(160deg, #171614, #0e0e0d);
  border: 1px solid rgba(184, 151, 90, .28); color: #ede8de;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.hero-label, .liksa-hero .eyebrow, .overview .eyebrow { display: block; color: #a89f8e; font-size: .66rem; line-height: 1.5; letter-spacing: .12em; font-weight: 700; text-transform: uppercase; }
.hero-amount, .overview h2 {
  display: block; color: #e9d8b4; font-family: var(--serif); font-size: 3.3rem;
  font-weight: 600; line-height: 1.1; letter-spacing: -.01em; margin: 6px 0 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
}
.hero-daily { border-top: 1px solid rgba(184, 151, 90, .38); padding-top: 10px; margin-top: 14px; color: #b5afa3; font-size: .92rem; }
.hero-rule { height: 1px; background: linear-gradient(90deg, rgba(184, 151, 90, .5), transparent); margin: 14px 0 10px; }
.hero-rule + .hero-daily { border-top: 0; padding-top: 0; margin-top: 0; }
.hero-days { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; color: #9c968b; font-size: .7rem; }
.hero-days b, .hero-days strong { font-family: var(--serif); color: #e9d8b4; font-size: 1.3rem; font-weight: 600; }
.overview p:last-child { color: #b5afa3; font-size: .92rem; }
.overview-side { max-width: none; gap: 10px; margin-top: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
.overview-side .metric { border-color: #2f2c27; color: #ede8de; padding: 12px; }
.overview-side .metric > span, .overview-side .metric small { color: #b5afa3; }
.liksa-quick {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 4rem), 1fr));
  gap: 8px; margin: 0 0 14px;
}
.liksa-quick button, .liksa-quick a {
  min-width: 0; min-height: 80px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 16px; padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; font-size: .74rem; font-weight: 700; text-align: center;
}
.liksa-quick svg { width: 20px; height: 20px; flex: none; color: var(--gold); }
.liksa-quick button > span:first-child { min-height: 30px; display: grid; place-items: center; color: var(--gold); }
.liksa-future .future-value, .liksa-future .fut-head b { font-family: var(--serif); font-size: 2.3rem; color: var(--gold); font-weight: 600; line-height: 1.1; }
.liksa-future .fut-head { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: end; gap: 12px; }
.liksa-future .gain { color: var(--good); text-align: right; }
.allocation { align-items: center; justify-content: center; gap: 18px; }
.donut { width: 132px; height: 132px; }
.donut > div { width: 104px; height: 104px; gap: 4px; background: var(--surface); }
.donut strong { font-family: var(--serif); font-size: 1.3rem; }
.donut span { font-size: .65rem; text-align: center; }
.legend { flex: 1 1 11rem; min-width: 0; width: auto; }
.legend > div { min-width: 0; gap: 8px; flex-wrap: wrap; font-size: .86rem; padding: 4px 0; }
.legend span { min-width: 0; overflow-wrap: anywhere; }
.legend strong { font-size: .86rem; overflow-wrap: anywhere; }
.legend i, figcaption i { width: 10px; height: 10px; border-radius: 50%; }
.pairs > div { gap: 12px; border-color: var(--border); flex-wrap: wrap; padding: 8px 0; }
.pairs dt { color: var(--muted); min-width: min(100%, 8rem); font-size: .9rem; }
.pairs dd { font-size: .9rem; max-width: 100%; overflow-wrap: anywhere; }
.note { font-size: .9rem; line-height: 1.55; margin: 10px 0 0; color: var(--muted); }
.health, .target-list, .milestones { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 12px; }
.health article, .target-list article, .milestones article { min-width: 0; background: var(--bg); border-color: var(--border); border-radius: 14px; padding: 14px; }
.health article > div, .target-list article > div { display: flex; align-items: start; flex-wrap: wrap; gap: 8px; }
.health strong, .milestones strong, .goal-value { font-family: var(--serif); font-weight: 600; }
.health strong { font-size: 1.55rem; margin: 12px 0 8px; }
.health p { font-size: .85rem; }
.badge { border-radius: 999px; padding: 3px 8px; font-size: .72rem; font-weight: 700; }
.badge.good { background: rgba(93, 148, 113, .15); color: var(--good); }
.badge.warn { background: rgba(184, 151, 90, .16); color: var(--warn); }
.badge.bad { background: rgba(168, 66, 63, .15); color: var(--bad); }
.badge.neutral { background: var(--surface2); color: var(--muted); }
.progress { height: 8px; background: var(--surface2); border-radius: 6px; margin-top: 8px; }
.progress i { border-radius: 6px; background: linear-gradient(90deg, #8f7442, var(--gold)); }
.progress.warn i { background: linear-gradient(90deg, #b8903f, #d9b46a); }
.progress.bad i { background: var(--bad); }
.button {
  min-height: 44px; min-width: 0; max-width: 100%; padding: 11px 16px; border-radius: 14px;
  background: var(--gold); border: 1px solid var(--gold); color: #141413; font-weight: 700; font-size: .9rem;
  white-space: normal; overflow-wrap: anywhere;
}
.button.subtle { background: var(--surface2); border-color: var(--border); color: var(--text); }
.button.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.button:hover { filter: brightness(1.08); }
:root[data-theme='light'] .button:not(.subtle):not(.danger) { background: #141413; color: #e9d8b4; border-color: rgba(184, 151, 90, .35); }
.actions { gap: 8px; margin: 14px 0; }
.actions > * { max-width: 100%; min-width: 0; }
.actions .field { min-width: min(100%, 10rem); max-width: 100%; }
.fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 12px; margin: 14px 0; }
.field { gap: 5px; }
.field > span { font-size: .8rem; font-weight: 700; color: var(--muted); }
input, select, textarea {
  min-width: 0; max-width: 100%; min-height: 46px; font-size: 1rem; padding: 11px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px; color: var(--text);
}
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
input[type='checkbox'] { width: 22px; height: 22px; min-height: 22px; flex: 0 0 22px; accent-color: var(--gold); }
.toggle { min-height: 44px; gap: 10px; align-items: center; }
.toggle span { min-width: 0; overflow-wrap: anywhere; }
.row-title { flex-wrap: wrap; gap: 10px; }
.row-title > div { min-width: 0; }
.row-numbers { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); gap: 12px; margin-top: 12px; }
.row-numbers .metric strong { font-size: 1.25rem; }
.budget-list article { padding: 14px 0; }
.car-banner { padding: 22px; border-radius: 18px; background: var(--surface); border-color: var(--good); margin-bottom: 14px; }
.car-banner.warn { background: var(--surface); border-color: var(--warn); }
.car-banner.bad { background: var(--surface); border-color: var(--bad); }
.car-banner h2 { font-family: var(--serif); font-size: 1.7rem; line-height: 1.25; letter-spacing: -.01em; }
.car-banner p:last-child { color: var(--muted); }
.table-wrap { border-radius: 10px; margin: 14px 0; }
thead { background: var(--surface2); }
table, .table-wrap table { font-size: .8125rem; }
th, td { border-color: var(--border); padding: 10px 12px; }
.chart { margin-top: 14px; }
.chart svg { overflow: visible; }
.chart [stroke='#25313f'] { stroke: var(--border); }
.chart [fill='#9caec1'] { fill: var(--muted); }
.chart [stroke='#54e0bc'] { stroke: var(--gold); }
.chart [stroke='#6787ff'] { stroke: var(--muted); stroke-dasharray: 4 4; }
.chart [stroke='#ebbe65'] { stroke: var(--warn); }
.chart figcaption i[style*='#54e0bc'] { background: var(--gold) !important; }
.chart figcaption i[style*='#6787ff'] { background: var(--muted) !important; }
.chart figcaption i[style*='#ebbe65'] { background: var(--warn) !important; }
figcaption { gap: 12px; font-size: .76rem; }
.goal-mini { margin-bottom: 18px; }
.goal-mini > span { float: none; display: inline-block; margin-left: 8px; }
.list article { min-width: 0; padding: 12px 0; gap: 10px; border-color: var(--border); }
.list article > div:first-child { min-width: min(100%, 8rem); }
.list article .actions { flex-wrap: wrap; }
.warning, .notice { background: rgba(184, 151, 90, .1); border-color: rgba(184, 151, 90, .45); color: var(--warn); border-radius: 12px; padding: 12px; }
.notice { margin: 12px 16px; max-width: 528px; }
.demo-banner { background: var(--surface2); color: var(--warn); padding: 10px 16px; gap: 10px; flex-wrap: wrap; max-width: 560px; margin: 0 auto; }
.more-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.more-grid > a { padding: 18px 16px; gap: 16px; border-radius: 18px; }
.more-grid svg { color: var(--gold); }
details { border-color: var(--border); padding: 14px 0; }
summary { color: var(--text); min-height: 44px; font-size: .9375rem; }
.empty { color: var(--muted); padding: 18px 0; }
dialog {
  max-width: 560px; width: calc(100% - 24px); max-height: calc(100dvh - 32px);
  padding: 22px 18px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  overscroll-behavior: contain; overflow-wrap: anywhere;
}
dialog::backdrop { background: rgba(8, 8, 7, .6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dialog-heading { gap: 12px; margin-bottom: 16px; align-items: start; flex-wrap: wrap; }
.dialog-heading h2 { font-family: inherit; font-size: 1.15rem; font-weight: 700; }
.dialog-heading > * { max-width: 100%; }
.form-error { color: var(--bad); }
#toast { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); background: var(--surface2); color: var(--text); border-color: var(--border); border-radius: 12px; }
.skip { background: var(--gold); color: #141413; }
.bottom-nav {
  display: flex; grid-template-columns: none; align-items: stretch; gap: 0;
  position: fixed; z-index: 30; left: 50%; right: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); width: calc(100% - 20px); max-width: 540px; padding: 6px;
  border: 1px solid var(--border); border-radius: 22px; background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .16); overflow-x: auto; scrollbar-width: thin; overscroll-behavior-x: contain;
}
.bottom-nav a, .bottom-nav button {
  position: relative; flex: 1 0 auto; min-width: 44px; min-height: 44px; max-width: none;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px;
  border: 0; border-radius: 14px; background: transparent; padding: 7px 4px 9px;
  color: var(--muted); font-size: .875rem; font-weight: 700; text-align: center; white-space: nowrap;
}
.bottom-nav span { white-space: nowrap; }
.bottom-nav svg { width: 21px; height: 21px; flex: none; }
.bottom-nav .active, .bottom-nav [aria-current='page'] { color: var(--text); background: transparent; }
.bottom-nav .active::after, .bottom-nav [aria-current='page']::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--gold);
}
.fab, .floating-plus, .floating-add, .liksa-fab {
  display: grid; place-items: center; position: fixed; z-index: 31;
  right: max(18px, calc(50% - 262px)); bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  width: 58px; height: 58px; min-width: 44px; min-height: 44px; padding: 0;
  border: 1px solid rgba(184, 151, 90, .4); border-radius: 18px; background: #141413; color: #e9d8b4;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}
.fab svg, .floating-plus svg, .floating-add svg, .liksa-fab svg { width: 28px; height: 28px; }
@media (max-width: 560px) {
  dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: 560px; max-height: 90dvh; margin: 0 auto; border-radius: 26px 26px 0 0; padding: 30px 18px calc(22px + env(safe-area-inset-bottom, 0px)); }
  dialog::before { content: ''; position: absolute; width: 40px; height: 5px; border-radius: 3px; background: var(--border); top: 10px; left: 50%; transform: translateX(-50%); }
  .pairs > div { align-items: baseline; }
}
@media (max-width: 380px) {
  main { padding-left: 12px; padding-right: 12px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .liksa-ticker { margin-left: -12px; margin-right: -12px; max-width: calc(100% + 24px); }
  .liksa-stats { gap: 6px; }
  .liksa-stats .metric { padding: 10px 6px; }
  .hero-amount { font-size: 2.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
