:root {
    color-scheme: light; font: 16px system-ui, sans-serif;
    --canvas: #f7f1ed; --paper: #fffcf9; --ink: #382d3b; --accent: #684c67; --line: #e2d6de;
    background: var(--canvas); color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#app { min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); display: grid; place-items: center; }
.shell { display: flex; flex-direction: column; width: min(100%, (100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 430 / 626); aspect-ratio: 430 / 626; }
.portrait-notice { display: none; }
header { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 4px 8px 4px 13px; }
header .brand { position: relative; margin-right: auto; padding: 0; background: transparent; border: 0; }
.brand img { width: 32px; height: 32px; display: block; }
.brand i { position: absolute; right: 2px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: #c76073; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
button { min-height: 44px; padding: 6px 12px; color: var(--accent); cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--accent); color: white; }
button.icon { min-width: 44px; display: grid; place-content: center; }
svg.icon { width: 19px; height: 19px; fill: none; stroke: var(--accent); stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.stage { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.art { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 18px; background: #eee0d0; touch-action: none; }
.metrics { position: absolute; inset: auto 12px 18px; pointer-events: none; }
.metric-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metric { min-width: 0; overflow: hidden; padding: 7px; background: #fffcf9e9; border-radius: 9px; font-size: .82rem; }
.metric svg { vertical-align: middle; margin-right: 3px; }
progress { width: 100%; height: 5px; accent-color: #b38ca8; display: block; margin-top: 3px; }
.corner { position: absolute; width: 56px; height: 56px; bottom: 8px; left: 8px; background: transparent; border: 0; }
.overlay { position: absolute; inset: 0; background: #382d3b66; display: grid; align-items: end; padding: 10px 18px; }
.menu, .card { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 10px; }
.menu { display: grid; gap: 5px; max-height: min(390px, 90%); overflow: auto; }
.menu button { display: flex; align-items: center; gap: 11px; text-align: left; }
.sheet { position: absolute; inset: 0; background: var(--canvas); display: flex; flex-direction: column; }
.sheet h1 { font-size: 1.05rem; margin: auto; }
.scroll { overflow: auto; padding: 8px 18px 20px; flex: 1; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-block: 6px; min-width: 0; }
input, select, textarea { min-height: 44px; padding: 6px 9px; max-width: 100%; }
input[type=checkbox], input[type=range] { min-height: 24px; }
textarea { width: 100%; min-height: 130px; resize: vertical; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 8px; }
.stack { display: grid; gap: 8px; }
.letter { white-space: pre-wrap; overflow-wrap: anywhere; }
p { margin: 8px 0; }
.fingerprint { overflow-wrap: anywhere; font-family: ui-monospace, monospace; font-size: .85rem; }
@media (orientation: landscape) and (pointer: coarse) {
    .shell { display: none; }
    .portrait-notice { display: block; }
}
.appearance-preview { display: block; width: 100%; height: clamp(130px, 34dvh, 380px); background: #eee0d0; border-radius: 18px; }
[hidden] { display: none !important; }
header .brand:disabled { opacity: 1; }
.sheet header { padding: 5px 14px; gap: 12px; }
.sheet h1 { font-size: 1.25rem; margin: 0; }
.sheet header > svg.icon { width: 21px; height: 21px; }
.composer { display: grid; gap: 8px; }
.composer > button { justify-self: end; }
.composer textarea { min-height: 88px; resize: vertical; border: 0; }
.inbox-entry { display: grid; gap: 3px; }
fieldset.card { min-width: 0; }
.appearance-preview { border-radius: 24px; }
.appearance-preview.cat { background: linear-gradient(135deg, #fff0db, #f2dcdc); }
.appearance-preview.rabbit { background: linear-gradient(135deg, #f9e9ec, #e8ddeb); }
