html,
body {
  background: var(--mio-bg, #070708) !important;
  color: var(--mio-text-1, #f2f0eb);
}

body {
  background-image:
    radial-gradient(760px 420px at 52% -10%, rgba(var(--mio-gold-rgb), .055), transparent 72%) !important;
}

.page {
  width: auto;
  min-height: 100vh;
  margin-left: var(--mio-app-sidebar-width, 64px);
}

.page > main {
  min-width: 0;
}

.hero {
  min-height: 390px;
  padding: 66px 20px 48px;
}

.hero-title,
.hero.prompt-active .hero-title {
  margin-bottom: 27px;
  color: var(--mio-text-1, #f2f0eb);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: clamp(30px, 2.6vw, 42px);
  font-weight: 620;
  line-height: 1.2;
  letter-spacing: -.035em;
  animation: none;
}

.hero-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin: 18px auto 0;
  background: linear-gradient(90deg, transparent, var(--mio-gold-400, #b8893f), transparent);
}

.prompt-wrap { max-width: 760px; }
.prompt-wrap.active { max-width: 940px; }

.prompt-bar {
  padding: 15px 17px 11px;
  border: 1px solid var(--mio-line, rgba(255,255,255,.1));
  border-radius: 15px;
  background: rgba(16,16,17,.92);
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 16px 42px rgba(0,0,0,.25);
}

.prompt-bar.focused {
  border-color: rgba(var(--mio-gold-rgb), .44);
  box-shadow: 0 0 0 3px rgba(var(--mio-gold-rgb), .065), 0 20px 54px rgba(0,0,0,.34);
}

.prompt-input {
  color: var(--mio-text-1, #f2f0eb);
  font-size: 14px;
}
.prompt-input::placeholder { color: var(--mio-text-4, #6d6b67); }

.ptool-btn,
.suggest-tag,
.suggest-icon {
  color: var(--mio-text-3, #918f89) !important;
  border-color: var(--mio-line-soft, rgba(255,255,255,.06)) !important;
  background: rgba(255,255,255,.025) !important;
}
.ptool-btn:hover,
.suggest-tag:hover {
  color: var(--mio-text-1, #f2f0eb) !important;
  border-color: rgba(var(--mio-gold-rgb), .22) !important;
  background: rgba(var(--mio-gold-rgb), .055) !important;
}
.ptool-btn.active { color: var(--mio-gold-300, #d7b56d) !important; }
.multi-switch { background: var(--mio-surface-4, #252527) !important; }
.ptool-btn.active .multi-switch { background: var(--mio-gold-400, #b8893f) !important; }

.param-menu {
  background: var(--mio-surface-2, #151517) !important;
  border-color: var(--mio-line, rgba(255,255,255,.1)) !important;
  box-shadow: var(--mio-shadow-3, 0 20px 60px rgba(0,0,0,.5)) !important;
}
.param-option:hover { background: var(--mio-surface-4, #252527) !important; }
.param-option.selected { color: var(--mio-gold-300, #d7b56d) !important; background: rgba(var(--mio-gold-rgb), .07) !important; }

.prompt-send {
  color: var(--mio-text-inverse, #17120a) !important;
  border-color: var(--mio-gold-400, #b8893f) !important;
  background: var(--mio-gold-400, #b8893f) !important;
  box-shadow: none !important;
}
.prompt-send:hover { background: var(--mio-gold-300, #d7b56d) !important; }

.section { margin-top: 26px; }
.section-head { margin-bottom: 16px; }
.section-title {
  color: var(--mio-text-1, #f2f0eb);
  font-size: 17px;
  font-weight: 610;
  letter-spacing: -.015em;
}
.section-title svg path { fill: var(--mio-gold-400, #b8893f) !important; }

.search-wrap,
.toolbar-btn,
.toolbar-select {
  height: 36px;
  color: var(--mio-text-2, #c9c7c1);
  border: 1px solid var(--mio-line-soft, rgba(255,255,255,.06));
  border-radius: var(--mio-radius-sm, 8px);
  background-color: var(--mio-surface-1, #101011);
  backdrop-filter: none;
}
.search-wrap:hover,
.toolbar-btn:hover,
.toolbar-select:hover {
  color: var(--mio-text-1, #f2f0eb);
  border-color: var(--mio-line-strong, rgba(255,255,255,.16));
  background-color: var(--mio-surface-2, #151517);
}
.search-wrap input { color: var(--mio-text-1, #f2f0eb); }
.search-wrap input::placeholder { color: var(--mio-text-4, #6d6b67); }

.sort-control { position: relative; }
.sort-trigger {
  min-width: 116px;
  justify-content: space-between;
  padding: 0 10px 0 12px;
  background-image: none !important;
}
.sort-trigger svg { color: var(--mio-text-3, #918f89); transition: transform .2s ease; }
.sort-control.is-open .sort-trigger svg { transform: rotate(180deg); }
.sort-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: 0;
  width: 116px;
  padding: 5px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  border: 1px solid var(--mio-line, rgba(255,255,255,.1));
  border-radius: 10px;
  background: var(--mio-surface-2, #151517);
  box-shadow: var(--mio-shadow-3, 0 20px 60px rgba(0,0,0,.5));
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.sort-control.is-open .sort-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.sort-menu button {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--mio-text-2, #c9c7c1);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.sort-menu button:hover { color: var(--mio-text-1, #f2f0eb); background: var(--mio-surface-4, #252527); }
.sort-menu button.is-active { color: var(--mio-gold-300, #d7b56d); background: rgba(var(--mio-gold-rgb), .07); }

.grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--mio-line-soft, rgba(255,255,255,.06));
  border-radius: var(--mio-radius-lg, 14px);
  background: var(--mio-surface-1, #101011);
  box-shadow: none;
}
.card.is-series {
  overflow: visible;
  z-index: 1;
}
.card.is-series > .cover { border-radius: 13px 13px 0 0; }
.card.is-series > .card-info { border-radius: 0 0 13px 13px; }
.card.is-series::before,
.card.is-series::after {
  content: "";
  position: absolute;
  height: 10px;
  pointer-events: none;
  border: 1px solid var(--mio-line-soft, rgba(255,255,255,.06));
  border-radius: var(--mio-radius-md, 10px) var(--mio-radius-md, 10px) 0 0;
  transition: top var(--mio-duration, .2s) var(--mio-ease, ease), background var(--mio-duration, .2s) var(--mio-ease, ease);
}
.card.is-series::before {
  top: -4px;
  right: 6px;
  left: 6px;
  z-index: -1;
  background: var(--mio-surface-4, #222226);
}
.card.is-series::after {
  top: -8px;
  right: 12px;
  left: 12px;
  z-index: -2;
  background: var(--mio-surface-2, #151517);
}
.card.is-series:hover::before { top: -6px; background: var(--mio-surface-4, #222226); }
.card.is-series:hover::after { top: -12px; background: var(--mio-surface-3, #1b1b1e); }
.card:hover {
  border-color: rgba(var(--mio-gold-rgb), .26);
  background: var(--mio-surface-2, #151517);
  box-shadow: var(--mio-shadow-2, 0 14px 38px rgba(0,0,0,.34));
  transform: translateY(-2px);
}

.cover {
  height: auto;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 55% 35%, rgba(var(--mio-gold-rgb), .09), transparent 34%),
    var(--mio-surface-2, #151517);
}

.card-mode-corner {
  position: absolute;
  right: 17px;
  bottom: 17px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--mio-text-4, #6d6b67);
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 7px;
  background: rgba(255,255,255,.018);
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.card-mode-corner svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card:hover .card-mode-corner {
  color: var(--mio-gold-300, #d7b56d);
  border-color: rgba(var(--mio-gold-rgb), .16);
  background: rgba(var(--mio-gold-rgb), .035);
}

.card-edit,
.card-select {
  position: absolute;
  z-index: 4;
  top: 9px;
  right: 9px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 8px;
  color: var(--mio-text-2, #c9c7c1);
  background: rgba(10,10,11,.78);
  backdrop-filter: blur(10px);
  cursor: pointer;
}
.card-edit {
  right: 47px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .18s ease, transform .18s ease, color .18s ease, border-color .18s ease, background .18s ease;
}
.card:hover .card-edit,
.card:focus-within .card-edit {
  opacity: 1;
  transform: translateY(0);
}
.card-edit:hover {
  color: var(--mio-gold-300, #d7b56d);
  border-color: rgba(var(--mio-gold-rgb), .34);
  background: rgba(var(--mio-gold-rgb), .12);
}
.card-edit svg,
.card-select svg {
  width: 15px;
  height: 15px;
}

.project-name-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
}
.project-name-modal.open { display: flex; }
.project-name-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--mio-line, rgba(255,255,255,.12));
  border-radius: 14px;
  color: var(--mio-text-1, #f5f3ed);
  background: var(--mio-surface-1, #151515);
  box-shadow: 0 24px 70px rgba(0,0,0,.58);
  overflow: hidden;
  animation: projectNameModalIn .2s cubic-bezier(.22,1,.36,1);
}
.project-name-dialog__form { padding: 0; }
.project-name-dialog__head { height:54px; padding:0 20px; display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; border-bottom:1px solid var(--mio-line); }
.project-name-dialog__title { font-size:16px; font-weight:650; }
.project-name-dialog__close { border:0; background:transparent; color:var(--mio-text-3); cursor:pointer; font-size:20px; }
.project-name-dialog__label { display:block; margin:0 20px 8px; color:var(--mio-text-3); font-size:12px; }
.project-name-dialog__input {
  width:calc(100% - 40px); height:42px; margin:0 20px; padding:0 12px; border:1px solid var(--mio-line);
  border-radius:9px; outline:0; color:var(--mio-text-1); background:var(--mio-surface-2); font:inherit;
}
.project-name-dialog__input:focus { border-color:rgba(var(--mio-gold-rgb),.55); }
.project-name-dialog__actions { display:flex; justify-content:flex-end; gap:8px; margin-top:20px; padding:0 20px 20px; }
.project-name-dialog__btn { height:34px; padding:0 14px; border:1px solid var(--mio-line); border-radius:8px; cursor:pointer; color:var(--mio-text-2); background:var(--mio-surface-2); }
.project-name-dialog__btn.primary { color:#17130c; border-color:var(--mio-gold-400); background:var(--mio-gold-400); font-weight:650; }
.project-name-dialog__btn:disabled { opacity:.5; cursor:wait; }
@keyframes projectNameModalIn {
  from { opacity:0; transform:scale(.97) translateY(6px); }
  to { opacity:1; transform:scale(1) translateY(0); }
}
.card-select svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0;
}
.card.is-selecting { cursor: pointer; }
.card.is-selected {
  border-color: rgba(var(--mio-gold-rgb), .62);
  box-shadow: 0 0 0 2px rgba(var(--mio-gold-rgb), .1);
}
.card.is-selected .card-select {
  color: #17120a;
  border-color: var(--mio-gold-400, #b8893f);
  background: var(--mio-gold-400, #b8893f);
}
.card.is-selected .card-select svg { opacity: 1; }

.toolbar-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.batch-cancel-btn[hidden] { display: none !important; }

.folder-art {
  width: 70px;
  height: 52px;
  border: 1px solid rgba(var(--mio-gold-rgb), .28);
  border-radius: 9px 9px 11px 11px;
  background: linear-gradient(160deg, rgba(var(--mio-gold-rgb), .2), rgba(var(--mio-gold-rgb), .07));
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 14px 28px rgba(0,0,0,.22);
}
.folder-art::before {
  top: -7px;
  width: 34px;
  height: 12px;
  border: 1px solid rgba(var(--mio-gold-rgb), .25);
  border-bottom: 0;
  background: rgba(var(--mio-gold-rgb), .16);
}
.folder-art::after {
  top: 8px;
  height: 1px;
  background: rgba(var(--mio-gold-rgb), .18);
}

.card-info {
  position: relative;
  padding: 13px 52px 14px 14px;
  border-top: 1px solid var(--mio-line-soft, rgba(255,255,255,.06));
  background: var(--mio-surface-1, #101011);
}
.card-title {
  overflow: hidden;
  color: var(--mio-text-2, #c9c7c1);
  font-size: 13px;
  font-weight: 580;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.card-time { color: var(--mio-text-4, #6d6b67); font-size: 10px; }
.empty-tip { color: var(--mio-text-3, #918f89); }

.floating-tools { display: none !important; }

@media (max-width: 1240px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .hero { min-height: 330px; padding-top: 48px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
