/* LIFE OS X — "Pearl Glass" design system (light + dark). */
:root {
  --bg: #f3f4fa;
  --bg-mesh: radial-gradient(900px 520px at 100% -10%, #e5e1ff 0%, transparent 60%), radial-gradient(800px 480px at -10% 30%, #dff4fb 0%, transparent 55%), linear-gradient(180deg, #f7f8fc, #f1f2f9);
  --surface: rgba(255, 255, 255, 0.9);
  --surface-2: rgba(255, 255, 255, 0.55);
  --solid: #ffffff;
  --sunken: #eef0f7;
  --line: rgba(22, 26, 58, 0.08);
  --line-2: rgba(22, 26, 58, 0.14);
  --ink: #12152b;
  --ink-2: #2d3252;
  --muted: #646b88;
  --accent: #6553f5;
  --accent-2: #19b6e6;
  --accent-soft: rgba(101, 83, 245, 0.1);
  --accent-ink: #ffffff;
  --grad: linear-gradient(135deg, #6553f5 0%, #8a5cf6 45%, #19b6e6 100%);
  --pos: #0c9467;
  --neg: #d23f5b;
  --warn: #b7790b;
  --pos-soft: rgba(12, 148, 103, 0.1);
  --neg-soft: rgba(210, 63, 91, 0.1);
  --warn-soft: rgba(201, 138, 18, 0.12);
  --r-xl: 28px;
  --r-lg: 22px;
  --r: 16px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(18, 21, 43, 0.04), 0 8px 28px -12px rgba(30, 30, 80, 0.18);
  --shadow-lg: 0 30px 80px -20px rgba(28, 24, 90, 0.35);
  --blur: saturate(160%) blur(18px);
  --art-bg: transparent;
  --art-blend: multiply;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --side: 264px;
  color-scheme: light;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Ethiopic", "Nyala", "Abyssinica SIL", sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
[data-theme="dark"] {
  --bg: #0b0d18;
  --bg-mesh: radial-gradient(900px 520px at 100% -10%, rgba(101, 83, 245, 0.28) 0%, transparent 60%), radial-gradient(800px 480px at -10% 35%, rgba(25, 182, 230, 0.14) 0%, transparent 55%), linear-gradient(180deg, #0d0f1d, #090b14);
  --surface: rgba(24, 28, 48, 0.92);
  --surface-2: rgba(30, 35, 60, 0.55);
  --solid: #161a2d;
  --sunken: #10131f;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --ink: #eef0fb;
  --ink-2: #c9cde3;
  --muted: #959cbb;
  --accent: #8b7dff;
  --accent-soft: rgba(139, 125, 255, 0.16);
  --pos: #34d399;
  --neg: #fb7185;
  --warn: #fbbf24;
  --pos-soft: rgba(52, 211, 153, 0.12);
  --neg-soft: rgba(251, 113, 133, 0.12);
  --warn-soft: rgba(251, 191, 36, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  --art-bg: linear-gradient(160deg, #f6f7fb, #dfe3ef);
  --art-blend: normal;
  color-scheme: dark;
}

/* ---------- base & native-app behaviour ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg-mesh);
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  opacity: 0;
  transition: opacity 0.2s;
}
body.ready {
  opacity: 1;
}
input,
textarea,
[contenteditable],
.selectable,
.selectable * {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
img {
  -webkit-user-drag: none;
  user-select: none;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
a {
  color: var(--accent);
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 10px;
}
h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h1 {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 800;
}
h2 {
  font-size: 18px;
  font-weight: 750;
}
h3 {
  font-size: 16px;
  font-weight: 700;
}
p {
  margin: 0.35em 0;
}
.ico {
  width: 20px;
  height: 20px;
  flex: none;
}
.sr-only,
.native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

/* ---------- utility ---------- */
.muted {
  color: var(--muted);
}
.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.small {
  font-size: 12px;
}
.center {
  text-align: center;
}
.pad {
  padding: 22px 12px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.row.between,
.between {
  justify-content: space-between;
}
.row.gap {
  gap: 8px;
  flex-wrap: wrap;
}
.top {
  margin-top: 14px;
}
.full {
  grid-column: 1 / -1;
}
.w90 {
  width: 90px;
  flex: none;
}
.pos {
  color: var(--pos);
}
.neg {
  color: var(--neg);
}
.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  letter-spacing: 0;
}
.wrap {
  word-break: break-all;
}
.link {
  color: var(--accent);
  font-weight: 650;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.plain {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-width: 0;
}
.plain.left {
  display: block;
}
.stack {
  display: grid;
  gap: 10px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.eyebrow.light {
  color: #fff;
  opacity: 0.85;
}

/* ---------- crystal artwork ---------- */
.art {
  width: 56px;
  height: 56px;
  object-fit: contain;
  mix-blend-mode: var(--art-blend);
  background: var(--art-bg);
  border-radius: 14px;
  flex: none;
}
.art.sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

/* ---------- layout ---------- */
#sidebar {
  display: none;
}
main {
  padding: calc(var(--safe-t)) 0 calc(96px + var(--safe-b));
  min-height: 100dvh;
}
#top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  padding-top: calc(10px + var(--safe-t));
  margin-top: calc(-1 * var(--safe-t));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}
.topbrand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.topbrand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
}
.topbrand strong,
.top-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.langbtn {
  height: 36px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
}
#page {
  padding: 16px 16px 8px;
  max-width: 1180px;
  margin: 0 auto;
  animation: pagein 0.22s ease backwards;
}
@keyframes pagein {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
#bottom {
  position: fixed;
  z-index: 30;
  left: 10px;
  right: 10px;
  bottom: calc(10px + var(--safe-b));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--solid) 82%, transparent);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 7px 2px 6px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  transition: color 0.15s, background 0.15s;
}
.tab .ico {
  width: 22px;
  height: 22px;
}
.tab.on {
  color: var(--accent);
  background: var(--accent-soft);
}
.tab span {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 1024px) {
  #sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side);
    padding: 22px 14px;
    background: color-mix(in srgb, var(--solid) 70%, transparent);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    z-index: 25;
    scrollbar-width: thin;
  }
  main {
    margin-left: var(--side);
    padding-bottom: 40px;
  }
  #bottom {
    display: none;
  }
  #top {
    padding: 14px 32px;
  }
  #top .topbrand img {
    display: none;
  }
  #page {
    padding: 26px 32px 40px;
  }
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
}
.brand img {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.brand b {
  display: block;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.brand small {
  color: var(--muted);
  font-size: 12px;
}
.side-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--sunken);
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.side-search span {
  flex: 1;
  text-align: left;
}
kbd {
  font: 600 11px ui-monospace, monospace;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
}
.side-nav {
  display: grid;
  gap: 2px;
}
.nav-label {
  margin: 16px 10px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 14px;
  color: var(--ink-2);
  font-weight: 650;
  text-align: left;
  transition: background 0.15s;
}
.side-btn .art.sm {
  width: 30px;
  height: 30px;
}
.side-btn:hover {
  background: var(--sunken);
}
.side-btn.on {
  background: var(--accent-soft);
  color: var(--accent);
}
.sidefoot {
  margin-top: auto;
  padding: 18px 10px 0;
  font-size: 12px;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pos);
  margin-right: 6px;
}

/* ---------- surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card + .card {
  margin-top: 12px;
}
.card.list {
  padding: 6px;
}
.pagehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 2px 18px;
}
.pagehead p {
  color: var(--muted);
  max-width: 560px;
}
.pagehead-art {
  width: 86px;
  height: 86px;
  object-fit: contain;
  mix-blend-mode: var(--art-blend);
  background: var(--art-bg);
  border-radius: 22px;
  flex: none;
}
.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.sectionhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 4px 10px;
}
.sectionhead h2 {
  font-size: 17px;
}
.list-label {
  padding: 12px 12px 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  transition: transform 0.08s, filter 0.15s, background 0.15s;
  position: relative;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--grad);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px -10px rgba(101, 83, 245, 0.8);
}
.btn.primary:hover {
  filter: brightness(1.06);
}
.btn.soft {
  background: var(--accent-soft);
  color: var(--accent);
}
.btn.ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.btn.danger,
.btn.ghost.danger {
  color: var(--neg);
}
.btn.danger:not(.ghost) {
  background: var(--neg);
  color: #fff;
}
.btn.light {
  background: #fff;
  color: #141833;
}
.btn.glass {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
}
.btn.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 11px;
}
.btn.block {
  display: flex;
  width: 100%;
  margin-top: 10px;
}
.btn.link {
  min-height: 32px;
  padding: 0 4px;
  color: var(--accent);
  font-size: 14px;
}
.btn.loading {
  opacity: 0.85;
}
.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--ink-2);
  flex: none;
  transition: background 0.15s;
}
.iconbtn:hover {
  background: var(--sunken);
}
.iconbtn.soft {
  background: var(--accent-soft);
  color: var(--accent);
}
.iconbtn.danger {
  color: var(--neg);
}
.iconbtn.primary {
  background: var(--grad);
  color: #fff;
}
.iconbtn.glass {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  backdrop-filter: blur(8px);
}
.chipbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 650;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}
.chipbtn .ico {
  width: 17px;
  height: 17px;
  color: var(--accent);
}
.chipbtn.on {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--sunken);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip .ico {
  width: 14px;
  height: 14px;
}
.chip.ok {
  background: var(--pos-soft);
  color: var(--pos);
}
.chip.bad {
  background: var(--neg-soft);
  color: var(--neg);
}
.chip.warn {
  background: var(--warn-soft);
  color: var(--warn);
  margin-top: 4px;
}
.chip.glass {
  background: rgba(10, 12, 30, 0.45);
  color: #fff;
  backdrop-filter: blur(6px);
}
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips.wrap {
  flex-wrap: wrap;
  justify-content: center;
}
.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--sunken);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.segmented.wide {
  display: grid;
  width: 100%;
  max-width: 520px;
}
.segmented button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.segmented button.on {
  background: var(--solid);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
}
.spinner.light {
  color: #fff;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- forms ---------- */
.form {
  display: grid;
  gap: 12px;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.label-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea,
.picker {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--solid);
  color: var(--ink);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}
input[type="date"] {
  min-height: 48px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 28px;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}
.picker {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}
.picker .picker-label,
.picker > span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker.small {
  width: auto;
  min-height: 38px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 12px;
  max-width: 220px;
}
.picker .ico {
  color: var(--muted);
  width: 18px;
  height: 18px;
}
.inputrow {
  display: flex;
  align-items: center;
  gap: 6px;
}
.inputrow input {
  flex: 1;
}
.filepick {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px dashed var(--line-2);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  position: relative;
}
.filepick.has {
  border-style: solid;
  color: var(--accent);
  border-color: var(--accent);
}
.filepick.big {
  min-height: 96px;
  justify-content: center;
  margin-bottom: 8px;
}
.fname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}
.form-msg {
  min-height: 1px;
  margin: 0;
  color: var(--neg);
  font-weight: 600;
  font-size: 14px;
}
.form-msg:empty {
  display: none;
}
.form-actions {
  display: flex;
  gap: 8px;
}
.form-actions .grow {
  flex: 1;
}
.recorder {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.recdot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--neg);
  animation: blink 1s infinite;
}
@keyframes blink {
  50% {
    opacity: 0.2;
  }
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--sunken);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.searchbox .ico {
  color: var(--muted);
}
.searchbox input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-left: 0 !important;
}

/* ---------- sheets & dialogs ---------- */
#layers {
  position: relative;
  z-index: 100;
}
.layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 24, 0.45);
  opacity: 0;
  transition: opacity 0.2s;
  backdrop-filter: blur(2px);
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 24px - var(--safe-t));
  display: flex;
  flex-direction: column;
  background: var(--solid);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.25, 1);
  padding-bottom: var(--safe-b);
}
.layer.in .scrim {
  opacity: 1;
}
.layer.in .sheet {
  transform: none;
}
.layer.out .scrim {
  opacity: 0;
}
.layer.out .sheet {
  transform: translateY(100%);
}
.grab {
  width: 40px;
  height: 5px;
  border-radius: 9px;
  background: var(--line-2);
  margin: 8px auto 0;
  flex: none;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 18px 8px;
  flex: none;
}
.sheet-head > div {
  flex: 1;
  min-width: 0;
  padding-top: 6px;
}
.sheet-head p {
  color: var(--muted);
  font-size: 13px;
}
.sheet-body {
  padding: 6px 18px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (min-width: 700px) {
  .layer {
    align-items: center;
    padding: 24px;
  }
  .sheet {
    border-radius: 26px;
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: transform 0.2s, opacity 0.2s;
    padding-bottom: 0;
  }
  .layer.in .sheet {
    opacity: 1;
  }
  .layer.out .sheet {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  .sheet.wide {
    max-width: 820px;
  }
  .grab {
    display: none;
  }
}
.sheet.dialog .sheet-body {
  text-align: center;
  padding-top: 18px;
}
.dialog-ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.dialog-ico .ico {
  width: 28px;
  height: 28px;
}
.dialog-ico.danger {
  background: var(--neg-soft);
  color: var(--neg);
}
.dialog-ico.ok {
  background: var(--pos-soft);
  color: var(--pos);
}
.dialog-title {
  font-size: 19px;
}
.dialog-text {
  color: var(--muted);
  margin: 8px 0 4px;
  line-height: 1.5;
  word-break: break-word;
}
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.pick-list {
  display: grid;
  gap: 2px;
}
.pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 8px 12px;
  border-radius: 14px;
  text-align: left;
  color: var(--ink);
}
button.pick-row:hover,
.pick-row:hover {
  background: var(--sunken);
}
.pick-row b {
  display: block;
  font-weight: 650;
}
.pick-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-check {
  color: var(--accent);
  opacity: 0;
}
.pick-row.on {
  background: var(--accent-soft);
}
.pick-row.on .pick-check {
  opacity: 1;
}
.pick-row > .ico:first-child {
  color: var(--accent);
}
.viewer .sheet {
  background: #05060c;
  max-width: 980px;
}
.viewer .sheet-body {
  padding: 10px;
  display: grid;
  place-items: center;
}
.viewer-img {
  max-width: 100%;
  max-height: 80dvh;
  border-radius: 14px;
  object-fit: contain;
}
.prose p {
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0 0 12px;
}
.plain {
  white-space: normal;
}
.vault-view .plain {
  padding: 14px;
  border-radius: 14px;
  background: var(--sunken);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 12px;
  line-height: 1.6;
  display: block;
}

/* ---------- toast ---------- */
#toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(100px + var(--safe-b));
  transform: translate(-50%, 20px);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 460px);
  padding: 12px 16px;
  border-radius: 16px;
  background: #171a2e;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.toast-act {
  color: #b9b0ff;
  font-weight: 800;
  padding: 4px 6px;
}
@media (min-width: 1024px) {
  #toast {
    bottom: 28px;
    left: calc(50% + var(--side) / 2);
  }
}

/* ---------- lists ---------- */
.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  width: 100%;
  text-align: left;
  min-width: 0;
}
.row-item.top {
  align-items: flex-start;
}
.row-item + .row-item {
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.row-item b {
  display: block;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.row-item small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.row-item small.neg {
  color: var(--neg);
  font-weight: 650;
}
.row-item .right {
  text-align: right;
  flex: none;
}
.row-item.done b {
  text-decoration: line-through;
  color: var(--muted);
}
button.row-item:hover {
  background: var(--sunken);
}
.row-actions {
  display: flex;
  gap: 2px;
  flex: none;
  margin-left: auto;
}
.entry .row-actions,
.vcard .row-actions {
  justify-content: flex-end;
}
.checkbox {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border: 2px solid var(--line-2);
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
}
.checkbox .ico {
  width: 16px;
  height: 16px;
}
.checkbox.on {
  background: var(--pos);
  border-color: var(--pos);
}
.badge-n {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.badge-n.done {
  background: var(--pos-soft);
  color: var(--pos);
}
.cat-ico,
.id-ico,
.w-avatar {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent);
}
.c-food {
  background: #ffedd5;
  color: #c2410c;
}
.c-rent,
.c-bills {
  background: #e0e7ff;
  color: #4338ca;
}
.c-transport {
  background: #dbeafe;
  color: #1d4ed8;
}
.c-family {
  background: #fce7f3;
  color: #be185d;
}
.c-shopping {
  background: #f3e8ff;
  color: #7e22ce;
}
.c-technology {
  background: #cffafe;
  color: #0e7490;
}
.c-health {
  background: #dcfce7;
  color: #15803d;
}
.c-education {
  background: #fef9c3;
  color: #a16207;
}
.c-savings {
  background: #d1fae5;
  color: #047857;
}
[data-theme="dark"] .cat-ico {
  filter: saturate(0.9) brightness(0.9);
}
.doc-ico {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.progress {
  height: 8px;
  border-radius: 9px;
  background: var(--sunken);
  overflow: hidden;
  margin: 10px 0;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 9px;
  background: var(--grad);
  transition: width 0.4s;
}
.ring {
  --p: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--sunken) 0);
}
.ring b {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--solid);
  display: grid;
  place-items: center;
  font-size: 12px;
}
.empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  padding: 26px 14px;
}
.empty .art {
  width: 84px;
  height: 84px;
  margin-bottom: 4px;
}
.empty b {
  font-size: 17px;
}
.empty p {
  color: var(--muted);
  max-width: 380px;
  margin-bottom: 10px;
}
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  margin: 10px 0;
  line-height: 1.45;
}
.banner .ico {
  flex: none;
  margin-top: 1px;
}
.banner span {
  flex: 1;
}
.banner.info {
  background: var(--accent-soft);
  color: var(--ink-2);
}
.banner.info .ico {
  color: var(--accent);
}
.banner.warn {
  background: var(--warn-soft);
  color: var(--ink-2);
}
.banner.warn .ico {
  color: var(--warn);
}
.banner.danger {
  background: var(--neg-soft);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--neg) 35%, transparent);
}
.banner.danger .ico {
  color: var(--neg);
}
.bad {
  color: var(--neg);
}

/* ---------- home ---------- */
.hello {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.hello b {
  display: block;
  font-size: 18px;
  font-weight: 800;
}
.hello small {
  color: var(--muted);
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--solid);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex: none;
}
.avatar .art {
  width: 42px;
  height: 42px;
}
.avatar.lg {
  width: 64px;
  height: 64px;
  border-radius: 20px;
}
.avatar.lg .art {
  width: 56px;
  height: 56px;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: -78px;
  position: relative;
  z-index: 2;
}
@media (min-width: 900px) {
  .tiles {
    grid-template-columns: repeat(4, 1fr);
  }
}
.tile {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-width: 0;
}
.tile .art {
  margin-bottom: 6px;
}
.tile span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
}
.tile strong {
  font-size: clamp(15px, 4.4vw, 20px);
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile small {
  font-size: 12px;
  color: var(--muted);
}
.card.cycle {
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 12px;
}
.card.cycle small {
  color: var(--muted);
}
.quick {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 2px 2px;
  scrollbar-width: none;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
.quick::-webkit-scrollbar,
.carousel::-webkit-scrollbar,
.chips::-webkit-scrollbar {
  display: none;
}
.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(86%, 420px);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 -16px;
  padding: 2px 16px 8px;
  scrollbar-width: none;
}
.slide {
  position: relative;
  scroll-snap-align: center;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  color: #fff;
  box-shadow: var(--shadow);
  isolation: isolate;
}
.slide.big {
  aspect-ratio: 16 / 11;
  margin-bottom: 10px;
}
.slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.slide-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 25%, rgba(8, 8, 28, 0.8));
}
.slide blockquote {
  position: absolute;
  left: 16px;
  right: 60px;
  bottom: 14px;
  margin: 0;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.slide-n {
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
}
.slide .iconbtn {
  position: absolute;
  right: 12px;
  bottom: 12px;
}
.modules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 640px) {
  .modules {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1100px) {
  .modules {
    grid-template-columns: repeat(4, 1fr);
  }
}
.module {
  display: grid;
  gap: 2px;
  justify-items: start;
  text-align: left;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.12s;
  min-width: 0;
}
.module:active {
  transform: scale(0.98);
}
.module .art {
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
}
.module b {
  font-weight: 750;
}
.module small {
  color: var(--muted);
  font-size: 12px;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-xl);
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-lg);
  margin-bottom: 8px;
}
.profile-card b {
  font-size: 19px;
  display: block;
}
.profile-card small {
  opacity: 0.85;
}
.profile-card .iconbtn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
}

/* ---------- stats & finance ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.stats .card + .card {
  margin-top: 0;
}
.stat {
  display: grid;
  gap: 2px;
  padding: 14px;
  min-width: 0;
}
.stat strong {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat small {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 560px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stats > :first-child {
    grid-column: 1 / -1;
  }
  .stats > :first-child strong {
    font-size: 26px;
  }
}
.bars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  align-items: end;
  height: 160px;
}
.bar {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  justify-items: center;
  gap: 6px;
}
.bar i {
  display: block;
  width: 100%;
  max-width: 44px;
  align-self: end;
  border-radius: 10px 10px 4px 4px;
  background: var(--grad);
  min-height: 3px;
}
.bar small {
  font-size: 11px;
  color: var(--muted);
}

/* ---------- vision, story, trade ---------- */
.vcats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 900px) {
  .vcats {
    grid-template-columns: repeat(4, 1fr);
  }
}
.vcat {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  color: #fff;
  text-align: left;
  isolation: isolate;
  box-shadow: var(--shadow);
}
.vcat img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}
.vcat span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 30px 12px 10px;
  background: linear-gradient(180deg, transparent, rgba(8, 8, 28, 0.8));
}
.vcat b {
  display: block;
}
.vcat small {
  opacity: 0.85;
  font-size: 12px;
}
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.cards .card + .card {
  margin-top: 0;
}
@media (min-width: 700px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1200px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
.vcard {
  padding: 0;
  overflow: hidden;
}
.vcard-img {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--sunken);
}
.vcard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vcard-img .media-wrap {
  display: block;
  height: 100%;
}
.vcard-img .chip {
  position: absolute;
  left: 10px;
  top: 10px;
}
.pad-in {
  padding: 14px;
}
.note {
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}
.entry h3 {
  margin: 10px 0 4px;
}
.entry audio {
  width: 100%;
  margin-top: 10px;
}
.media-wrap {
  display: block;
}
.media-wrap img {
  cursor: zoom-in;
}
.media-wrap.missing {
  display: none;
}
.entry-img img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 16px;
  margin-top: 10px;
  display: block;
}
.thumb img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
}
.masonry {
  columns: 2 160px;
  column-gap: 10px;
}
.masonry figure {
  margin: 0 0 10px;
  break-inside: avoid;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.masonry img {
  width: 100%;
  display: block;
}
.masonry figcaption {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 650;
}
.masonry figcaption small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}
.notes-grid {
  columns: 2 220px;
  column-gap: 12px;
}
.notecard {
  break-inside: avoid;
  margin: 0 0 12px !important;
  cursor: pointer;
}
.notecard p {
  color: var(--ink-2);
  white-space: pre-wrap;
  max-height: 220px;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.quickadd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.quickadd > .ico {
  color: var(--accent);
}
.quickadd input[name="title"] {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 8px 0 !important;
  flex: 1;
  min-width: 0;
}
.quickadd input[type="date"] {
  width: 140px !important;
  min-height: 40px !important;
  padding: 6px 8px !important;
  font-size: 14px !important;
  flex: none;
}
@media (max-width: 480px) {
  .quickadd input[type="date"] {
    display: none;
  }
}

/* ---------- settings ---------- */
.setgroup {
  margin-top: 18px;
}
.setgroup h3 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 6px 8px;
}
.setgroup,
.setlist {
  display: grid;
}
.setgroup > .setrow,
.setlist > .setrow {
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-width: 0;
}
.setgroup > h3 + .setrow,
.setlist > .setrow:first-child {
  border-radius: 18px 18px 0 0;
}
.setgroup > .setrow:last-child,
.setlist > .setrow:last-child {
  border-radius: 0 0 18px 18px;
  border-bottom-width: 1px;
}
.setgroup > h3 + .setrow:last-child {
  border-radius: 18px;
}
.setrow {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
}
.setrow b {
  display: block;
  font-weight: 650;
}
.setrow small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.setrow > .ico {
  color: var(--muted);
}
.setrow.danger b,
.setrow.danger .set-ico {
  color: var(--neg);
}
.set-ico {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.setrow.danger .set-ico {
  background: var(--neg-soft);
}
.switch {
  width: 48px;
  height: 28px;
  border-radius: 99px;
  background: var(--line-2);
  position: relative;
  flex: none;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.switch.on {
  background: var(--accent);
}
.switch.on::after {
  transform: translateX(20px);
}

/* ---------- lock / PIN ---------- */
.gate .sheet-body {
  text-align: center;
  padding-top: 18px;
}
.gate-top {
  margin-bottom: 14px;
}
.gate-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.gate-top h2 {
  font-size: 21px;
}
.pindots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 8px;
  min-height: 16px;
}
.pindots i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  transition: background 0.1s, border-color 0.1s;
}
.pindots i.on {
  background: var(--accent);
  border-color: var(--accent);
}
.shake {
  animation: shake 0.4s;
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}
.gate-msg {
  min-height: 22px;
  color: var(--neg);
  font-weight: 600;
  font-size: 14px;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  justify-content: center;
  gap: 12px 22px;
  margin: 6px 0 10px;
}
.key {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--sunken);
  font-size: 26px;
  font-weight: 600;
  display: grid;
  place-items: center;
  transition: background 0.1s, transform 0.08s;
}
.key:active {
  background: var(--accent-soft);
  transform: scale(0.94);
}
.key.ghostkey,
.key.blank {
  background: transparent;
}
.key .ico {
  width: 28px;
  height: 28px;
}
body.app-locked #page,
body.app-locked #sidebar,
body.app-locked #bottom,
body.app-locked #top {
  filter: blur(18px);
  pointer-events: none;
}

/* ---------- Crystal Wallet ---------- */
.w-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.w-top .segmented {
  margin: 0;
}
.w-top-actions {
  display: flex;
  gap: 2px;
}
.w-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  box-shadow: var(--shadow);
}
.w-switch b {
  display: block;
}
.w-switch small {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.w-avatar {
  background: var(--grad);
  color: #fff;
}
.w-hero {
  position: relative;
  border-radius: var(--r-xl);
  padding: 20px 18px 16px;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #1b1747 0%, #3b2aa8 45%, #0e8bbd 100%);
}
.w-hero.test {
  background: linear-gradient(135deg, #2b2f44 0%, #4a4f74 50%, #2a7d8f 100%);
}
.w-hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 65%);
  z-index: -1;
}
.w-hero-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 650;
  opacity: 0.85;
}
.w-hero-amt {
  font-size: clamp(32px, 8vw, 44px);
  font-weight: 850;
  letter-spacing: -0.03em;
  margin: 6px 0 2px;
  line-height: 1.1;
  word-break: break-all;
}
.w-hero-amt small {
  font-size: 18px;
  opacity: 0.8;
  font-weight: 700;
}
.w-hero-sub {
  font-size: 13px;
  opacity: 0.8;
}
.w-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.w-actions button {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.w-actions button:active {
  background: rgba(255, 255, 255, 0.24);
}
.w-actions .ico {
  width: 22px;
  height: 22px;
}
.tok-ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  flex: none;
  background: var(--sunken);
  color: var(--ink-2);
  letter-spacing: -0.02em;
}
.tok-trx {
  background: #eb0029;
  color: #fff;
}
.tok-usdt {
  background: #26a17b;
  color: #fff;
}
.tok-usdc {
  background: #2775ca;
  color: #fff;
}
.tx-ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.tx-ico.in {
  background: var(--pos-soft);
  color: var(--pos);
}
.tx-ico.out {
  background: var(--accent-soft);
  color: var(--accent);
}
.tx-ico.wait {
  background: var(--warn-soft);
  color: var(--warn);
}
.tx-ico.bad {
  background: var(--neg-soft);
  color: var(--neg);
}
b.in,
.review-amt.in {
  color: var(--pos);
}
.w-res {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.w-res small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 650;
}
.w-res b {
  font-size: 20px;
}
.w-lock,
.w-empty {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 26px 18px;
}
.w-lock .stack,
.w-empty .stack,
.w-lock .form {
  width: 100%;
  max-width: 380px;
  margin-top: 8px;
  text-align: left;
}
.w-lock-art img,
.w-empty > img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  mix-blend-mode: var(--art-blend);
  background: var(--art-bg);
  border-radius: 26px;
}
.w-lock p,
.w-empty p {
  max-width: 420px;
}
.linkrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.qrbox {
  display: grid;
  place-items: center;
  padding: 10px;
}
.qrbox canvas {
  width: min(250px, 70vw);
  height: auto;
  border-radius: 18px;
  box-shadow: var(--shadow);
  image-rendering: pixelated;
}
.addrbox {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--sunken);
  text-align: center;
  word-break: break-all;
  font-size: 14px;
  margin: 8px 0 12px;
}
.review {
  display: grid;
  gap: 8px;
}
.review-amt {
  text-align: center;
  font-size: 34px;
  font-weight: 850;
  letter-spacing: -0.03em;
  padding: 8px 0 12px;
  word-break: break-all;
}
.review-amt small {
  font-size: 17px;
  color: var(--muted);
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.kv span {
  color: var(--muted);
  flex: none;
}
.kv b {
  text-align: right;
  font-weight: 650;
  min-width: 0;
}
.kv em {
  font-style: normal;
  color: var(--accent);
}
.done {
  text-align: center;
  padding-top: 14px;
}
.done p {
  margin: 8px 0 12px;
}

/* ---------- Digital Identity ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.filters .searchbox {
  margin: 0;
}
@media (min-width: 640px) {
  .filters {
    grid-template-columns: 2fr 1fr;
  }
}
.meter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.meter i {
  flex: 1;
  height: 6px;
  border-radius: 9px;
  background: var(--sunken);
  position: relative;
  overflow: hidden;
}
.meter i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 9px;
  transition: width 0.2s;
}
.meter.s1 i::after {
  width: 25%;
  background: var(--neg);
}
.meter.s2 i::after {
  width: 50%;
  background: var(--warn);
}
.meter.s3 i::after {
  width: 75%;
  background: var(--pos);
}
.meter.s4 i::after {
  width: 100%;
  background: var(--grad);
}

/* ---------- Inspiration ---------- */
.daily-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 900px) {
  .daily-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.daily-tile {
  padding: 8px;
  margin: 0 !important;
}
.daily-tile canvas {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
  margin-bottom: 6px;
  background: var(--sunken);
}
.daily-tile .iconbtn {
  width: 36px;
  height: 36px;
}
.studio {
  display: grid;
  gap: 16px;
}
@media (min-width: 860px) {
  .studio {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
#quote-preview {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: var(--shadow);
  background: var(--sunken);
}

/* ---------- Life AI ---------- */
body[data-page="ai"] #page {
  padding-bottom: 0;
}
.ai-wrap {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 190px - var(--safe-b));
}
.ai-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0 14px;
}
.chat-empty {
  margin: auto;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 30px 6px;
}
.chat-empty .art {
  width: 96px;
  height: 96px;
}
.chat-empty b {
  font-size: 20px;
}
.msg {
  display: flex;
}
.msg.user {
  justify-content: flex-end;
}
.bubble {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 20px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  font-size: 15px;
}
.msg.user .bubble {
  background: var(--grad);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.msg.model .bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow);
}
.bubble code {
  font-family: ui-monospace, monospace;
  background: var(--sunken);
  padding: 1px 5px;
  border-radius: 6px;
  font-size: 0.9em;
}
.typing {
  display: flex;
  gap: 5px;
  padding: 16px;
}
.typing i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing 1s infinite;
}
.typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing {
  50% {
    opacity: 0.25;
    transform: translateY(-3px);
  }
}
.composer {
  position: sticky;
  bottom: calc(86px + var(--safe-b));
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--solid) 92%, transparent);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  margin-bottom: 8px;
}
.composer textarea {
  min-height: 44px !important;
  max-height: 160px;
  border: 0 !important;
  box-shadow: none !important;
  resize: none;
  background: transparent !important;
  padding: 10px !important;
}
.composer .iconbtn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}
@media (min-width: 1024px) {
  .composer {
    bottom: 16px;
  }
}
.steps {
  padding-left: 20px;
  color: var(--ink-2);
  line-height: 1.6;
}

/* ---------- reduced motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  #sidebar,
  #bottom,
  #top,
  #toast {
    display: none !important;
  }
  main {
    margin: 0 !important;
  }
}

.row-item.tap {
  cursor: pointer;
}
@media (max-width: 560px) {
  .card.list .row-item.tap .row-actions {
    display: none;
  }
}
.sheet:focus,
.sheet:focus-visible {
  outline: none;
}
.daily-tile .row.gap {
  flex-wrap: nowrap;
  gap: 6px;
}
.daily-tile small {
  font-size: 12px;
  line-height: 1.2;
}

/* ---------- full-bleed home hero (part of the app, not a card) ---------- */
.hero {
  position: relative;
  isolation: isolate;
  margin: calc(-16px - var(--safe-t)) -16px 0;
  min-height: min(620px, 86svh);
  padding: calc(76px + var(--safe-t)) 20px 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 50%;
  z-index: -3;
  animation: heroin 1.4s ease-out both;
}
@keyframes heroin {
  from {
    transform: scale(1.08);
  }
}
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, rgba(9, 8, 32, 0.62) 0%, rgba(9, 8, 32, 0.08) 26%, rgba(14, 10, 52, 0.25) 46%, rgba(12, 9, 44, 0.78) 72%, var(--bg) 100%);
}
.hero-hello {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-hello b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}
.hero-hello small {
  opacity: 0.85;
}
.avatar.glass {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.hero-copy {
  max-width: 600px;
}
.hero h1 {
  font-size: clamp(38px, 10vw, 64px);
  line-height: 1;
  letter-spacing: -0.045em;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}
.hero h1 span {
  background: linear-gradient(90deg, #e2dcff, #9fe9ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  font-size: 16px;
  opacity: 0.92;
  margin: 12px 0 18px;
  max-width: 440px;
  font-style: italic;
}
.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.orb {
  position: absolute;
  right: 18px;
  top: calc(150px + var(--safe-t));
  width: 128px;
  height: 128px;
  object-fit: contain;
  z-index: -1;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.45));
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  50% {
    transform: translateY(-10px) rotate(3deg);
  }
}
@media (min-width: 760px) {
  .orb {
    width: 250px;
    height: 250px;
    right: 6%;
    top: 22%;
  }
}
@media (min-width: 1024px) {
  .hero {
    margin: calc(-26px - var(--safe-t)) -32px 0;
    padding: 110px 48px 130px;
    min-height: 600px;
  }
  .tiles {
    grid-template-columns: repeat(4, 1fr);
  }
}
/* transparent top bar over the hero */
body[data-page="home"] #top {
  position: fixed;
  left: 0;
  right: 0;
  margin-top: 0;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #fff;
  transition: background 0.25s, color 0.25s;
}
body[data-page="home"] #top .langbtn {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}
body[data-page="home"] #top .iconbtn {
  color: #fff;
}
body[data-page="home"].scrolled #top {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom-color: var(--line);
  color: var(--ink);
}
body[data-page="home"].scrolled #top .iconbtn,
body[data-page="home"].scrolled #top .langbtn {
  color: var(--ink);
}
body[data-page="home"].scrolled #top .langbtn {
  background: var(--surface);
  border-color: var(--line);
}
@media (min-width: 1024px) {
  body[data-page="home"] #top {
    left: var(--side);
  }
}

/* ---------- health ---------- */
.health {
  display: grid;
  gap: 14px;
}
.hrings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.hring {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 6px 2px;
  border-radius: 16px;
  text-align: center;
}
.hring strong {
  font-size: 18px;
  font-weight: 800;
}
.hring small {
  font-size: 11px;
  color: var(--muted);
}
.ring.big {
  width: 66px;
  height: 66px;
}
.ring.big b {
  width: 52px;
  height: 52px;
  color: var(--accent);
}
.habit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.habit-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: var(--sunken);
  font-weight: 650;
  font-size: 14px;
}
.habit-chip i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
}
.habit-chip .ico {
  width: 18px;
  height: 18px;
}
.habit-chip.on {
  background: var(--pos-soft);
  color: var(--pos);
}
.habit-chip em {
  font-style: normal;
  font-size: 12px;
}
.checkbox.big {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}
.row-item.habit .week {
  display: flex;
  gap: 4px;
  flex: none;
}
.week i {
  width: 9px;
  height: 22px;
  border-radius: 5px;
  background: var(--sunken);
}
.week i.on {
  background: var(--pos);
}
.bars.seven {
  grid-template-columns: repeat(7, 1fr);
  height: 140px;
}
.spark {
  width: 100%;
  height: 70px;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}
.progress.near i {
  background: var(--warn);
}
.progress.over i {
  background: var(--neg);
}
.slide.make {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 16px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: none;
}
.slide.make span .ico {
  width: 34px;
  height: 34px;
}
.slide.make b {
  font-size: 17px;
}
.slide.make small {
  color: var(--muted);
  max-width: 220px;
}

.balance-card {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  margin-bottom: 14px;
}
.balance-card strong {
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 850;
  letter-spacing: -0.03em;
}
.head-actions .btn.ghost {
  min-height: 44px;
}
@media (max-width: 380px) {
  .segmented.wide button {
    padding: 0 6px;
    font-size: 13px;
  }
}

/* ---------- dates, loans, projects ---------- */
.date-badge {
  width: 48px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-content: center;
  text-align: center;
  background: var(--sunken);
  flex: none;
  line-height: 1.05;
}
.date-badge b {
  font-size: 19px;
  font-weight: 850;
}
.date-badge small {
  font-size: 11px !important;
  text-transform: uppercase;
  font-weight: 700;
}
.date-badge.soon {
  background: var(--accent-soft);
  color: var(--accent);
}
.date-badge.now {
  background: var(--grad);
  color: #fff;
}
.date-badge.now small {
  color: #fff !important;
}
.chips.left {
  justify-content: flex-start;
}
.right {
  text-align: right;
}
.row-item .right .btn {
  margin-top: 6px;
}
.proj {
  display: grid;
  gap: 10px;
}
.proj h3 {
  margin-bottom: 4px;
}
.next {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: 14px;
}
.next .ico {
  color: var(--accent);
  margin-top: 1px;
}
.chip.st-building {
  background: var(--accent-soft);
  color: var(--accent);
}
.chip.st-testing {
  background: var(--warn-soft);
  color: var(--warn);
}
.chip.st-live {
  background: var(--pos-soft);
  color: var(--pos);
}
.chip.st-paused {
  background: var(--sunken);
  color: var(--muted);
}
.proj .linkrow {
  align-items: center;
  margin-top: 0;
}

/* ---------- trading desk ---------- */
.sessions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 760px) {
  .sessions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.sess {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 16px;
  background: var(--sunken);
}
.sess b {
  font-size: 15px;
}
.sess .mono {
  font-size: 22px;
  font-weight: 800;
}
.sess small {
  font-size: 12px;
  color: var(--muted);
}
.sess.open {
  background: var(--pos-soft);
}
.sess.open small {
  color: var(--pos);
  font-weight: 700;
}
.calc {
  display: grid;
  gap: 14px;
}
@media (min-width: 860px) {
  .calc {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}
.lot {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 16px;
  border-radius: 18px;
  background: var(--grad);
  color: #fff;
}
.lot strong {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.lot small {
  opacity: 0.85;
  font-weight: 700;
}
.lot span {
  font-size: 14px;
  opacity: 0.95;
}
.lot .neg {
  color: #ffd1da;
}
.desk-ready {
  margin: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--sunken);
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}
.desk-ready.ok {
  background: var(--pos-soft);
  color: var(--pos);
}

/* ---------- focus ---------- */
.focus-card {
  display: grid;
  gap: 14px;
  justify-items: stretch;
}
.focus-ring {
  --p: 0;
  width: min(240px, 66vw);
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 6px auto 4px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--sunken) 0);
  transition: background 0.5s;
}
.focus-ring > div {
  width: 86%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--solid);
  display: grid;
  place-content: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--line);
}
.focus-ring strong {
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 850;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.focus-ring small {
  color: var(--muted);
  font-weight: 650;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disc {
  display: grid;
  gap: 14px;
}
.disc-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.disc-step .linkrow {
  margin-top: 8px;
}
