:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #211c2c;
  background: #f8f7fb;
  --accent: #7045d1;
  --line: #eae6f0;
  --muted: #696277;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #a38af1; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h2 { font-size: 20px; letter-spacing: -.03em; }
p, small { color: var(--muted); line-height: 1.5; }
small { display: block; }
.shell { min-height: 100dvh; }
aside { background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 15px 16px; font-weight: 800; font-size: 13px; letter-spacing: .035em; }
.brand small, .aside-foot small { font-size: 11px; font-weight: 500; letter-spacing: 0; }
.logo, .avatar { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; }
.logo { background: #251b38; color: #d6c2ff; font-size: 21px; }
.avatar { background: #eee6fb; color: #6137b8; }
nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: fixed; inset: auto 0 0; z-index: 2; background: #fff; border-top: 1px solid var(--line); padding: 5px 3px max(6px, env(safe-area-inset-bottom)); }
nav a { min-height: 53px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; padding: 4px 2px; border-radius: 9px; color: var(--muted); text-align: center; font-size: 10px; font-weight: 650; line-height: 1.1; }
nav a span:first-child { font-size: 20px; line-height: 1; }
nav a[aria-current] { color: #6137b8; background: #f0eafb; }
.aside-foot { display: none; }
main { min-width: 0; padding: 0 16px max(95px, calc(75px + env(safe-area-inset-bottom))); max-width: 1450px; margin-inline: auto; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 68px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; }
.primary, .secondary, .danger, .hero-link { border: 0; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; font-size: 13px; font-weight: 700; }
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: #5f36be; }
.primary:disabled { opacity: .48; cursor: default; }
.secondary { color: #6236bd; background: #f0eafb; }
.danger { color: #a32e50; background: #faeaf0; }
.heading { padding: 22px 0 19px; }
.heading h1 { font-size: clamp(30px, 5vw, 43px); letter-spacing: -.055em; line-height: 1.05; }
.heading p { margin-top: 8px; font-size: 14px; }
.hero { overflow: hidden; min-height: 278px; border-radius: 20px; color: white; background: linear-gradient(90deg, #191324 3%, #191324e6 34%, #19132420 100%), #21182f url("./assets/fitness-studio.webp") 68% center / cover no-repeat; }
.hero-copy { padding: 26px 22px; max-width: 390px; }
.hero-label { font-size: 10px; color: #d7c0ff; letter-spacing: .16em; font-weight: 750; }
.hero h2 { font-size: clamp(34px, 6vw, 53px); line-height: .99; letter-spacing: -.055em; margin: 11px 0; }
.hero p { max-width: 290px; color: #dfd8e9; font-size: 13px; }
.hero-link { margin-top: 17px; background: #e4d7ff; color: #29203a; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 17px 0 23px; }
.stat { display: flex; align-items: center; gap: 9px; min-height: 79px; background: white; border: 1px solid var(--line); border-radius: 13px; padding: 10px; }
.stat > div { min-width: 0; }
.stat strong { display: block; font-size: clamp(17px, 3vw, 24px); overflow-wrap: anywhere; line-height: 1.1; }
.stat div span { color: var(--muted); font-size: 11px; }
.stat-icon, .format { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
.purple, .reels { color: #6736bd; background: #efe7fc; }
.amber, .stories { color: #956122; background: #faf0dc; }
.green { color: #216c52; background: #e5f5ed; }
.blue, .post { color: #38669c; background: #e8f1fd; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 11px; }
.filter { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.filter select { width: auto; min-height: 44px; padding: 7px; }
.list, .panel, .empty { border: 1px solid var(--line); border-radius: 15px; background: white; }
.material { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 65px; background: transparent; border: 0; padding: 9px 10px; color: inherit; text-align: left; }
.material:first-child { border-radius: 15px 15px 0 0; }
.material:last-child { border-radius: 0 0 15px 15px; }
.material:only-child { border-radius: 15px; }
.material:hover { background: #faf7ff; }
.material + .material { border-top: 1px solid var(--line); }
.material strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.material small { font-size: 11px; margin-top: 2px; }
.status { border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status.idea { background: #f0edf4; color: #60576e; }
.status.ready { background: #e5f5ed; color: #216c52; }
.status.published { background: #e8f1fd; color: #38669c; }
.arrow { display: none; color: #887a9e; font-size: 22px; }
.empty, .panel { padding: 17px; }
.empty, .muted { color: var(--muted); font-size: 14px; }
.muted { margin-bottom: 12px; }
.generator, .product-grid { display: grid; gap: 14px; }
.generator-list { margin-top: 20px; }
.generator-list h2, .panel > h2 { margin-bottom: 12px; }
.panel button { margin-top: 10px; }
.product-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.product > strong { color: #6137b8; }
.product p { margin: 7px 0 12px; font-size: 14px; }
.product-stats { font-size: 13px; color: var(--muted); }
label { display: block; font-size: 12px; font-weight: 700; min-width: 0; }
form label, .panel label { margin-bottom: 10px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; margin-top: 4px; padding: 8px 9px; color: #211c2c; background: #fbfaff; border: 1px solid #ded7ea; border-radius: 9px; font-size: 16px; }
textarea { resize: vertical; }
dialog { width: min(calc(100% - 20px), 560px); max-height: min(90dvh, 760px); border: 1px solid var(--line); border-radius: 16px; color: inherit; padding: 16px; }
dialog::backdrop { background: #21172b99; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dialog-head { margin-bottom: 10px; }
.dialog-actions .primary { margin-left: auto; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#notice:not(:empty) { position: fixed; z-index: 4; bottom: max(76px, calc(62px + env(safe-area-inset-bottom))); right: 14px; max-width: calc(100% - 28px); background: #251b38; color: white; border-radius: 10px; padding: 12px; font-size: 14px; }
@media (min-width: 768px) {
  .shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  aside { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--line); border-bottom: 0; padding: 20px 13px; }
  .brand { padding: 6px 3px 32px; }
  nav { position: static; display: grid; grid-template-columns: 1fr; gap: 4px; border: 0; padding: 0; }
  nav a { flex-direction: row; justify-content: flex-start; gap: 11px; padding: 8px 11px; font-size: 13px; text-align: left; min-height: 45px; }
  nav a span:first-child { width: 19px; text-align: center; }
  .aside-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; font-size: 13px; font-weight: 700; }
  main { width: 100%; padding: 0 clamp(22px, 4vw, 55px) 30px; }
  .heading { padding: 26px 0 20px; }
  .hero { background-position: center, right 45%; }
  .hero-copy { padding: 27px 32px; }
  .material { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; padding: 9px 14px; }
  .arrow { display: inline; }
  .product-grid, .generator { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #notice:not(:empty) { bottom: 18px; }
}
@media (min-width: 1020px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
  .stat { padding: 13px; min-height: 84px; }
  .stat-icon { width: 38px; height: 38px; }
}

.top-actions { display: flex; gap: 7px; margin-left: auto; }
.library-panel { margin-bottom: 14px; }
.library-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.library-filters label { margin-bottom: 0; }
.status.script { background: #efe7fc; color: #6236a0; }
.status.shoot { background: #faf0dc; color: #835315; }
.status.edit { background: #faeaf0; color: #983753; }
.close-dialog { border: 0; border-radius: 10px; min-width: 44px; min-height: 44px; background: #f2eef7; font-size: 22px; }
@media (max-width: 767px) {
  nav a { font-size: 9px; }
  .top-actions .primary, .top-actions .secondary { padding-inline: 9px; }
}
@media (max-width: 390px) {
  .top > span { display: none; }
}
@media (min-width: 1020px) {
  .library-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
