@font-face { font-family: "DM Sans"; src: url(/fonts/dm-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(/fonts/dm-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url(/fonts/dm-serif-display-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url(/fonts/patrick-hand-latin-400-normal.woff2) format("woff2"); font-display: swap; }

:root {
  --ink: #0b0b0b; --paper: #ffffff; --orange: #ff5a00; --magenta: #ff2d8a; --blue: #1e5bff; --lime: #8bdc1f; --gold: #ffc400; --red: #f2242c;
  --soft: #f6f4f1; --line: #e7e3dd; --mute: #77716a; --body: #4c4844;
  --f-display: "DM Serif Display", Georgia, serif;
  --f-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-hand: "Patrick Hand", "Comic Sans MS", cursive;
  --tabs-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 15px; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
#app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 8px) max(20px, env(safe-area-inset-right, 0px)) calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 24px) max(20px, env(safe-area-inset-left, 0px)); }
.view { display: none; }
.view.on { display: block; animation: in .2s ease; }
@keyframes in { from { opacity: .4; transform: translateX(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.on { animation: none; } }

.top { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 16px; min-height: 36px; }
.logo { font-family: var(--f-display); font-size: 26px; letter-spacing: -.01em; }
.logo i { font-style: normal; position: relative; }
.logo i::after { content: ""; position: absolute; left: 50%; top: -1px; width: 7px; height: 7px; background: var(--orange); border-radius: 50% 50% 50% 0; transform: translateX(-50%) rotate(-30deg); }
.back { all: unset; cursor: pointer; font-size: 16px; font-weight: 700; padding: 6px 0; }
.avatar { all: unset; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
h1 { font-family: var(--f-display); font-weight: 400; font-size: 32px; line-height: 1.05; margin: 0 0 8px; text-wrap: balance; }
h1.h-sm { font-size: 24px; margin-bottom: 14px; }
.sub { color: var(--mute); font-size: 14px; line-height: 1.45; margin: 0 0 18px; }
.hand { font-family: var(--f-hand); font-size: 19px; color: var(--orange); margin: 0; }
.label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); font-weight: 700; margin: 22px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { all: unset; cursor: pointer; border: 1.5px solid var(--ink); border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); color: #fff; }
.chip.add { border-style: dashed; color: var(--mute); border-color: #bdb7af; font-weight: 400; }
.chip .x { opacity: .55; font-weight: 400; }
.field { width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 14px; font-size: 16px; background: var(--soft); }
.field:focus { outline: 2px solid var(--orange); border-color: transparent; }
.select { border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--paper); font-weight: 700; font-size: 14px; max-width: 55%; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.row small { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; }
.sw { width: 48px; height: 30px; border-radius: 999px; background: #d8d3cc; position: relative; flex: none; cursor: pointer; border: 0; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sw[aria-pressed="true"] { background: var(--lime); }
.sw[aria-pressed="true"]::after { left: 21px; }
.cta { all: unset; cursor: pointer; box-sizing: border-box; display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; background: var(--orange); color: #fff; font-weight: 700; font-size: 16px; border-radius: 16px; padding: 16px; margin-top: 20px; text-align: center; }
.cta.dark { background: var(--ink); }
.cta.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.cta[disabled] { opacity: .5; pointer-events: none; }
.cta:focus-visible, .chip:focus-visible, .back:focus-visible, .sw:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.btn-sm { all: unset; cursor: pointer; background: var(--ink); color: #fff; border-radius: 14px; padding: 0 18px; font-weight: 700; display: grid; place-items: center; }
.link { all: unset; cursor: pointer; display: block; margin: 18px auto 0; color: var(--mute); font-size: 14px; text-decoration: underline; text-align: center; }
.link.danger { color: var(--red); }
.cost { font-size: 12px; color: var(--mute); text-align: center; margin: 8px 0 0; }
.own, .add-niche { display: flex; gap: 8px; }
.own .field, .add-niche .field { flex: 1; min-width: 0; }
.add-niche { margin-top: 10px; }

.idea { all: unset; cursor: pointer; display: block; box-sizing: border-box; width: 100%; border: 1.5px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 10px; }
.idea:active, .idea:focus-visible { border-color: var(--ink); }
.meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.pill { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 9px; letter-spacing: .02em; white-space: nowrap; }
.p-reel { background: #ffe3ef; color: #b0105a; } .p-channel { background: #e3ebff; color: #1440b8; } .p-lesson { background: #eaf7d6; color: #3d6e07; } .p-iso { background: #fff1c2; color: #7a5c00; }
.p-time { background: var(--soft); color: var(--mute); }
.p-done { background: #eaf7d6; color: #3d6e07; } .p-run { background: #fff0e6; color: #b23f00; } .p-fail { background: #ffe5e6; color: #b0141a; }
.idea h3 { font-family: var(--f-display); font-weight: 400; font-size: 21px; line-height: 1.15; margin: 0 0 6px; }
.idea p { margin: 0; font-size: 13px; color: var(--body); line-height: 1.4; }
.score { margin-left: auto; font-family: var(--f-hand); font-size: 20px; color: var(--orange); line-height: 1; }

.styles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sty { all: unset; cursor: pointer; border: 2px solid var(--line); border-radius: 18px; overflow: hidden; display: block; }
.sty.on { border-color: var(--orange); box-shadow: 0 0 0 3px #ffd9c4; }
.sty svg { display: block; width: 100%; height: 88px; }
.sty .nm { padding: 8px 10px 10px; font-weight: 700; font-size: 14px; border-top: 1px solid var(--line); }
.sty .nm small { display: block; font-weight: 400; color: var(--mute); font-size: 11px; margin-top: 2px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--soft); border-radius: 12px; padding: 3px; }
.seg button { all: unset; cursor: pointer; text-align: center; padding: 10px 0; border-radius: 10px; font-size: 14px; }
.seg button.on { background: var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 700; }
.checks { display: grid; gap: 10px; }
.ck { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.ck input { width: 22px; height: 22px; accent-color: var(--orange); margin: 0; }

.bar { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; margin: 14px 0 6px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--magenta)); transition: width .6s; }
.st { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; }
.dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--mute); }
.st.done .dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.st.run .dot { border-color: var(--orange); border-top-color: transparent; animation: spin 1s linear infinite; }
.st.fail .dot { background: var(--red); border-color: var(--red); color: #fff; }
.st b { font-size: 15px; } .st small { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; }
.st .tm { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .st.run .dot, .spin { animation: none; } }
.tip { background: var(--soft); border-radius: 14px; padding: 12px 14px; font-size: 13px; color: var(--body); line-height: 1.45; margin-top: 14px; }
.alert { background: #ffe5e6; color: #7d0d11; border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.45; margin-top: 14px; }
.alert a { color: inherit; font-weight: 700; }

.player { border-radius: 18px; overflow: hidden; background: #111; display: grid; place-items: center; }
.player video { width: 100%; max-height: 70dvh; display: block; background: #111; }
.player img { width: 100%; display: block; }
.fmt { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0 4px; padding-bottom: 4px; }
.fmt button { all: unset; cursor: pointer; flex: none; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 700; }
.fmt button.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two .cta { margin-top: 12px; padding: 14px; font-size: 15px; text-decoration: none; }
.file { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.file .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; flex: none; font-size: 10px; font-weight: 700; color: var(--mute); }
.file .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file small { display: block; color: var(--mute); font-size: 12px; }
.file a { font-weight: 700; color: var(--orange); font-size: 14px; text-decoration: none; }

.lib { all: unset; cursor: pointer; box-sizing: border-box; display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); width: 100%; }
.lib .th { width: 64px; height: 64px; border-radius: 12px; background: var(--soft) center/cover no-repeat; border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--f-display); font-size: 22px; color: var(--mute); }
.lib b { font-size: 15px; line-height: 1.25; display: block; }
.lib small { color: var(--mute); font-size: 12px; }
.empty { text-align: center; color: var(--mute); padding: 40px 12px; line-height: 1.5; }
.empty b { display: block; color: var(--ink); font-family: var(--f-display); font-weight: 400; font-size: 24px; margin-bottom: 6px; }
.small-print { font-size: 12px; color: var(--mute); margin-top: 16px; line-height: 1.45; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding: 8px max(8px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); z-index: 5; }
.tabs button { all: unset; cursor: pointer; text-align: center; font-size: 11px; color: var(--mute); display: grid; justify-items: center; gap: 3px; padding: 2px 0; }
.tabs button svg { width: 22px; height: 22px; }
.tabs button.on { color: var(--ink); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 14px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); text-align: center; }
.busy { position: fixed; inset: 0; background: rgba(255,255,255,.88); display: grid; place-items: center; z-index: 15; padding: 24px; }
.busy-card { display: grid; justify-items: center; gap: 8px; text-align: center; }
.busy-card b { font-family: var(--f-display); font-weight: 400; font-size: 24px; }
.busy-card small { color: var(--mute); max-width: 30ch; line-height: 1.4; }
.spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--orange); animation: spin 1s linear infinite; }
