:root {
  color-scheme: light dark;
  --bg: #f5f3f4;
  --surface: #ffffff;
  --elevated: #ffffff;
  --ink: #242127;
  --muted: #716a74;
  --line: #e9e3e8;
  --rose: #a62e5e;
  --primary: #ab3564; --primary-ink: #fff8fb;
  --tint: #f7e8ee;
  --dock: #fdfbfd;
  --dock-glass: #fdfbfdec;
  --feature-a: #f2dce6;
  --feature-b: #f9eff3;
  --shadow: #41203110;
  --selection: #ffffff;
  background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151518; --surface: #232327; --elevated: #303035;
  --ink: #f3eff3; --muted: #aaa3ad; --line: #37323b; --rose: #f4a2bf;
  --tint: #382730; --dock: #29272e; --dock-glass: #29272eeb;
  --feature-a: #402a36; --feature-b: #2b232c; --shadow: #00000028; --selection: #49424c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #151518; --surface: #232327; --elevated: #303035;
    --ink: #f3eff3; --muted: #aaa3ad; --line: #37323b; --rose: #f4a2bf;
    --tint: #382730; --dock: #29272e; --dock-glass: #29272eeb;
    --feature-a: #402a36; --feature-b: #2b232c; --shadow: #00000028; --selection: #49424c;
  }
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled, input:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.entry { display: grid; justify-items: center; align-content: center; gap: 20px; min-height: 100svh; max-width: 420px; margin: 0 auto; padding: 28px; text-align: center; }
.entry .brand-mark { width: 48px; height: 48px; font-size: 40px; border-radius: 17px; }
.entry h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.7px; }
.entry a { text-decoration: none; }
.shell { position: relative; display: grid; grid-template-rows: 64px minmax(0, 1fr) auto; width: 100%; max-width: 900px; height: var(--app-height, var(--tg-viewport-stable-height, 100dvh)); margin: 0 auto; overflow: hidden; padding-top: max(env(safe-area-inset-top, 0px), var(--safe-top, 0px)); padding-left: max(env(safe-area-inset-left, 0px), var(--safe-left, 0px)); padding-right: max(env(safe-area-inset-right, 0px), var(--safe-right, 0px)); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 19px; }
.wordmark { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -.3px; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 10px; background: var(--tint); color: var(--rose); font: italic 25px/.8 Georgia, serif; }
.limits-button { display: flex; align-items: center; gap: 6px; min-height: 38px; border: 1px solid var(--line); border-radius: 24px; padding: 7px 11px; background: var(--surface); font-size: 12px; font-weight: 600; }
.limits-button .icon { width: 15px; height: 15px; color: var(--rose); }
.content { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 8px 19px 22px; }
.page { animation: page-in 200ms cubic-bezier(.2,.8,.2,1) both; }
h1, h2, h3, p { margin: 0; }
.heading { margin: 3px 0 22px; }
.heading h1 { margin-bottom: 9px; font-size: 30px; line-height: 1.12; letter-spacing: -.85px; font-weight: 720; overflow-wrap: anywhere; }
h2 { font-size: 16px; line-height: 1.3; letter-spacing: -.2px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.press { transition: transform 180ms cubic-bezier(.2,.8,.2,1), background-color 180ms ease; }
.press:not(:disabled):active { transform: scale(.975); transition-duration: 65ms; }
.feature { display: block; width: 100%; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 25px; padding: 19px; min-height: 164px; text-align: left; background: linear-gradient(125deg,var(--feature-a),var(--feature-b)); }
.feature-copy { position: relative; z-index: 1; display: block; max-width: 72%; }
.eyebrow { display: block; color: var(--rose); font-size: 11px; font-weight: 650; letter-spacing: 1px; text-transform: uppercase; }
.feature-title { display: block; margin-top: 8px; font-size: 25px; line-height: 1.12; font-weight: 720; letter-spacing: -.65px; }
.feature-description { display: block; margin-top: 7px; font-size: 12px; color: var(--muted); }
.feature-cta { display: block; margin-top: 15px; font-size: 13px; font-weight: 650; color: var(--rose); }
.record { position: absolute; right: -21px; top: 23px; width: 122px; height: 122px; border-radius: 50%; background: repeating-radial-gradient(circle at center,#27222c 0 2px,#34303b 3px 4px); box-shadow: -9px 12px 24px #21102020; transform: rotate(-22deg); display: grid; place-items: center; }
.record::before { content: ""; position: absolute; inset: 1px; border-radius: inherit; background: linear-gradient(115deg,#ffffff22,transparent 38%,#ffffff0b 55%,transparent 75%); }
.record span { width: 46px; height: 46px; border: 1px solid #f4ccd633; border-radius: 50%; display: grid; place-items: center; background: #bf6c8c; color: #fff2f6; font: italic 35px/1 Georgia,serif; }
.paper-art { position: absolute; right: -12px; top: 30px; width: 93px; height: 122px; border: 5px solid #f7e5ec; border-radius: 12px; transform: rotate(15deg); background: linear-gradient(155deg,#bc7d9d 0 38%,#8b6287 38% 65%,#d99aab 65%); box-shadow: -7px 7px 18px #21102020; }
.feature[data-kind="sing"] .paper-art, .feature:not([data-kind="sing"]) .record { display: none; }
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.shortcut { display: flex; align-items: center; gap: 10px; padding: 14px 12px; min-height: 66px; border-radius: 19px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.shortcut .icon { color: var(--rose); }
.shortcut strong { display: block; font-size: 13px; font-weight: 600; }
.shortcut small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 23px 0 10px; }
.group { background: var(--surface); border-radius: 20px; border: 1px solid var(--line); overflow: hidden; }
.row { position: relative; display: flex; align-items: center; width: 100%; min-height: 65px; gap: 12px; border: 0; padding: 13px 14px; background: transparent; text-align: left; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 54px; right: 0; height: 1px; background: var(--line); }
.row-icon { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 11px; background: var(--tint); color: var(--rose); }
.row-icon .icon { width: 18px; height: 18px; }
.row-copy { flex: 1; min-width: 0; }
.row-copy strong { display: block; font-size: 14px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.row-copy small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.chevron { width: 15px; height: 15px; color: var(--muted); opacity: .65; }
.dock-area { padding: 9px 12px max(12px, env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px)); background: var(--bg); }
.dock { position: relative; width: 100%; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 5px; min-height: 65px; border: 1px solid var(--line); border-radius: 28px; background: var(--dock); box-shadow: 0 5px 15px var(--shadow); isolation: isolate; }
.dock-highlight { position: absolute; z-index: -1; inset: 5px auto 5px 5px; width: calc((100% - 10px)/4); border-radius: 23px; background: var(--selection); box-shadow: 0 1px 4px var(--shadow); transition: transform 280ms cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.dock[data-active="create"] .dock-highlight { transform: translateX(100%); }
.dock[data-active="works"] .dock-highlight { transform: translateX(200%); }
.dock[data-active="profile"] .dock-highlight { transform: translateX(300%); }
.tab { min-width: 0; min-height: 53px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; border: 0; border-radius: 23px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 500; }
.tab .icon { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--rose); }
.back { display: inline-flex; align-items: center; gap: 3px; min-height: 36px; margin: -5px 0 9px -6px; border: 0; padding: 5px; background: transparent; color: var(--rose); font-size: 13px; }
.back .icon { width: 17px; height: 17px; }
.primary, .secondary { width: 100%; min-height: 48px; border-radius: 16px; padding: 12px 16px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; }
.primary { background: var(--primary); color: var(--primary-ink); border: 1px solid transparent; }
.secondary { border: 1px solid var(--line); background: var(--surface); }
.secondary .icon { width: 17px; height: 17px; }
.help { margin-top: 10px; font-size: 11px; text-align: center; color: var(--muted); line-height: 1.5; }
.note, .identity { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
.note .muted { margin-top: 7px; }
.identity { margin-bottom: 14px; display: grid; gap: 5px; }
.identity strong { font-size: 17px; overflow-wrap: anywhere; }
.identity .muted { overflow-wrap: anywhere; }
.role-label { color: var(--rose); font-size: 12px; }
.spaced { margin-top: 12px; }
.empty { text-align: center; padding: 26px 12px; }
.empty > .icon { width: 35px; height: 35px; margin: 0 auto 18px; color: var(--rose); }
.empty .muted { margin: 10px 0 22px; }
.quota-list { padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; }
.quota-list > div { padding: 15px; }
.quota-list > div + div { border-top: 1px solid var(--line); }
.quota-list dt { font-size: 13px; color: var(--muted); }
.quota-list dd { margin: 4px 0 0; font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.notice { padding: 13px; border-radius: 15px; margin-bottom: 12px; background: var(--tint); color: var(--rose); font-size: 13px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 30px; font-size: 14px; }
input[role="switch"] { appearance: none; flex: 0 0 40px; width: 40px; height: 24px; margin: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--line); position: relative; transition: background-color 160ms ease; }
input[role="switch"]::after { content: ""; width: 18px; height: 18px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #00000022; transition: transform 160ms ease; }
input[role="switch"]:checked { background: var(--primary); border-color: var(--primary); }
input[role="switch"]:checked::after { transform: translateX(16px); }
.field-label { display: block; font-size: 13px; font-weight: 600; margin: 18px 0 8px; }
.poem-length { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.poem-length .field-label { margin: 0 0 6px; }
.poem-length output { display: block; color: var(--rose); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.poem-length input[type="range"] { display: block; width: 100%; min-height: 44px; margin: 0; accent-color: var(--rose); cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin: -3px 0 8px; }
.poem-text { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); font: 17px/1.75 Georgia, "Times New Roman", serif; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
textarea { width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 17px; padding: 13px 14px; font-size: 16px; line-height: 1.45; resize: vertical; }
.facts-list { display: grid; gap: 9px; margin-top: 12px; }
.works-toolbar { display: flex; align-items: center; gap: 10px; }
.works-toolbar .field-label { margin: 0; }
.works-toolbar select { min-width: 0; flex: 1; max-width: 100%; padding: 11px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.works-toolbar button { flex: 0 0 44px; width: 44px; min-width: 44px; min-height: 44px; padding: 10px; }
.works-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.work-card { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.work-cover { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-bottom: 1px solid var(--line); color: var(--rose); background: var(--tint); overflow: hidden; }
.work-cover > .icon { width: 34px; height: 34px; }
.poem-cover { padding: 13px; text-align: left; color: var(--ink); }
.poem-cover span { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; overflow-wrap: anywhere; width: 100%; font: 14px/1.5 Georgia, serif; }
.work-media .poem-text { max-height: 52dvh; overflow-y: auto; margin: 0; }
.work-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; color: transparent; font-size: 0; }
.work-copy { padding: 11px; overflow-wrap: anywhere; }
.work-copy h2 { font-size: 14px; margin-bottom: 4px; }
.work-copy .muted { font-size: 11px; }
.work-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.work-heading h2 { min-width: 0; overflow-wrap: anywhere; }
.work-heading button { width: auto; min-height: 44px; }
@media (max-width: 360px) {
  .sheet .work-heading h2 { font-size: 18px; }
  .work-heading button { padding: 10px 12px; font-size: 12px; }
}
.work-media { margin-top: 15px; }
.work-media img, .work-media video { display: block; max-width: 100%; max-height: 52dvh; margin: 0 auto; border-radius: 13px; object-fit: contain; }
.work-media audio { width: 100%; }
.work-actions { display: grid; gap: 10px; margin-top: 18px; }
.image-expand { display: block; width: 100%; border: 0; padding: 0; border-radius: 17px; background: transparent; cursor: zoom-in; }
.edit-source { margin: 18px 0; }
.upload-picker input[type="file"] { display: block; width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); font: inherit; }
.upload-picker input::file-selector-button { min-height: 40px; border: 0; border-radius: 9px; padding: 8px 12px; margin-right: 10px; background: var(--tint); color: var(--rose); font: inherit; }
.upload-consent { display: flex; align-items: flex-start; gap: 10px; padding-block: 12px; margin-top: 8px; cursor: pointer; }
.upload-consent input { width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--rose); }
.edit-source img { display: block; width: 100%; max-height: 180px; object-fit: contain; border-radius: 13px; }
dialog.image-viewer { inset: 0; margin: 0; width: 100%; max-width: none; height: var(--app-height, 100dvh); max-height: 100%; border: 0; border-radius: 0; background: #111014; color: #fff; overflow: hidden; }
.image-stage { position: absolute; inset: max(64px, var(--safe-top, 0px)) 0 max(110px, var(--safe-bottom, 0px)); overflow: hidden; touch-action: none; user-select: none; cursor: grab; }
.image-stage:active { cursor: grabbing; }
.image-stage img { position: absolute; left: 50%; top: 50%; max-width: none; pointer-events: none; transform-origin: center; }
.viewer-close { position: absolute; top: max(12px, env(safe-area-inset-top, 0px), var(--safe-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px), var(--safe-right, 0px)); width: 44px; height: 44px; border: 1px solid #ffffff40; border-radius: 50%; background: #29272e; color: #fff; font-size: 30px; line-height: 1; }
.viewer-controls { position: absolute; bottom: calc(42px + max(env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px))); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.viewer-controls button { min-width: 48px; height: 44px; border: 1px solid #ffffff40; border-radius: 12px; padding: 0 12px; background: #29272e; color: #fff; }
.viewer-help { position: absolute; bottom: max(12px, env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px)); left: 10px; right: 10px; text-align: center; color: #d3cdd8; font-size: 12px; }
.image-progress { display: flex; align-items: center; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.image-progress p { margin: 5px 0 0; font-size: 13px; }
.loading-ring { width: 26px; height: 26px; flex: 0 0 26px; border: 3px solid var(--line); border-top-color: var(--rose); border-radius: 50%; animation: image-working 1s linear infinite; }
.image-result img { display: block; width: 100%; max-height: 55dvh; object-fit: contain; border-radius: 17px; margin-bottom: 13px; }
@keyframes image-working { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-ring { animation: none; } }
@media (min-width: 600px) { .works-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fact { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); padding: 13px; }
.fact p { flex: 1; min-width: 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fact-delete { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border: 0; border-radius: 10px; padding: 4px; background: transparent; color: var(--rose); }
.fact-delete .icon { width: 17px; height: 17px; }
.toast { position: absolute; z-index: 3; left: 15px; right: 15px; bottom: calc(88px + max(env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px))); border-radius: 17px; padding: 12px 14px; border: 1px solid var(--line); background: var(--elevated); box-shadow: 0 4px 20px var(--shadow); font-size: 12px; display: flex; align-items: center; gap: 10px; }
.toast span { flex: 1; }
.toast button { background: transparent; color: var(--rose); border: 0; padding: 6px; font-size: 12px; min-height: 32px; }
dialog { inset: auto 0 0; width: min(100%, 520px); max-height: 90%; padding: 0; margin: auto auto 0; color: var(--ink); border: 1px solid var(--line); border-radius: 29px 29px 0 0; background: var(--elevated); box-shadow: 0 -10px 40px var(--shadow); }
dialog::backdrop { background: #16091766; }
.sheet { padding: 12px 22px max(22px, env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px)); }
.sheet-grip { width: 30px; height: 4px; margin: 0 auto 18px; border-radius: 3px; background: var(--line); }
.sheet h2 { margin-bottom: 12px; font-size: 23px; letter-spacing: -.6px; }
.sheet p { overflow-wrap: anywhere; white-space: pre-wrap; }
.dialog-actions { display: flex; gap: 10px; margin-top: 22px; }
@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) { .dock { background: var(--dock-glass); backdrop-filter: blur(16px) saturate(125%); -webkit-backdrop-filter: blur(16px) saturate(125%); } }
@keyframes page-in { from { opacity: .75; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } *, *::before, *::after { transition-duration: 0s !important; } .press:not(:disabled):active { transform: none; } }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) { .dock { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--dock); } }
@media (pointer: coarse) { .limits-button, .back, .fact-delete { min-height: 44px; } .fact-delete { width: 44px; flex-basis: 44px; } }
@media (max-width: 360px) { .topbar { padding-inline: 15px; } .content { padding-inline: 15px; } .shortcut { gap: 8px; padding-inline: 10px; } .record { right: -39px; } .feature-copy { max-width: 75%; } .quota-list dd { font-size: 18px; } }
@media (min-width: 640px) { .content { padding-inline: 28px; } .topbar { padding-inline: 28px; } .shortcuts { gap: 14px; } .feature-copy { max-width: 65%; } .feature { min-height: 177px; } .record { right: 30px; top: 28px; } .paper-art { right: 35px; } .dock-area { padding-inline: 24px; } }
