:root {
  color-scheme: dark;
  --bg: #111311;
  --surface: #181a18;
  --surface-2: #1e211e;
  --surface-3: #272a27;
  --line: rgba(255,255,255,.085);
  --line-strong: rgba(255,255,255,.14);
  --text: #f2f3ef;
  --muted: #9b9e99;
  --dim: #666a65;
  --accent: #f1f2ee;
  --accent-text: #171917;
  --green: #4ce47c;
  --orange: #f5a449;
  --radius: 24px;
  --card-min: 310px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #090a09; color: var(--text); font-family: ui-rounded, "SF Pro Rounded", "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif; }
button, textarea, select, input { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid rgba(255,255,255,.7); outline-offset: 2px; }

.app-shell { width: min(1900px, calc(100vw - 36px)); height: calc(100vh - 36px); margin: 18px auto; display: grid; grid-template-columns: 320px minmax(0, 1fr) 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 26px; background: var(--bg); box-shadow: 0 36px 100px rgba(0,0,0,.45); transition: grid-template-columns .28s cubic-bezier(.22,.8,.22,1); }
.app-shell.detail-open { grid-template-columns: 320px minmax(520px, 1fr) minmax(360px, 30vw); }

.sidebar { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 26px 18px 20px; background: #151915; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; font-size: 21px; font-weight: 720; letter-spacing: -.4px; }
.brand-icon { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
nav { display: grid; gap: 3px; }
.nav-item { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; border: 0; border-radius: 11px; background: transparent; padding: 11px 12px; text-align: left; font-size: 15px; cursor: pointer; color: #d9dbd6; }
.nav-item:hover { background: rgba(255,255,255,.055); }
.nav-item.active { background: rgba(255,255,255,.14); color: white; }
.nav-item span { font-size: 18px; color: #bdc0ba; }
.nav-item b { color: var(--dim); font-size: 13px; font-weight: 600; }
.nav-label { margin: 22px 12px 5px; color: #5e625d; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.status { margin-top: auto; display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 12px; padding: 10px 12px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(76,228,124,.25); }
.status.busy i { background: var(--orange); }

.main { min-width: 0; height: 100%; overflow: auto; background: #121412; scroll-behavior: smooth; }
.view { display: none; min-height: 100%; padding: 46px 52px 80px; }
.view.active { display: block; }
.explore-wrap { max-width: 1020px; margin: 4vh auto; }
.hero { display: flex; gap: 20px; align-items: center; margin-bottom: 30px; }
.hero-mark { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, #292d29, #1b1e1b); color: #e9ebe6; font-size: 28px; box-shadow: inset 0 1px rgba(255,255,255,.05), 0 18px 50px rgba(0,0,0,.2); }
.eyebrow { margin: 0 0 8px; color: #777b75; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(34px, 4vw, 52px); letter-spacing: -.045em; line-height: 1.02; }
.hero p:last-child, .simple-header > p:last-child, .generation-brief { color: var(--muted); margin: 8px 0 0; font-size: 16px; line-height: 1.5; }

.generator-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(26,29,26,.8); box-shadow: inset 0 1px rgba(255,255,255,.025); }
.field-row { display: grid; grid-template-columns: 130px 1fr; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
label, .option-label { color: #b9bcb6; font-size: 12px; font-weight: 720; }
select { appearance: none; color: var(--text); background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='none' stroke='%23aaa' stroke-width='1.5' d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat calc(100% - 16px) center; border: 1px solid var(--line); border-radius: 11px; padding: 11px 40px 11px 14px; }
.brief-field { padding: 24px 0 0; }
.brief-field label { display: block; margin-bottom: 11px; text-transform: uppercase; letter-spacing: .1em; color: #898d86; font-size: 11px; }
.brief-field label span { color: #626660; font-weight: 600; }
textarea { resize: vertical; width: 100%; min-height: 136px; color: var(--text); background: #161916; border: 1px solid var(--line); border-radius: 17px; padding: 17px 18px; font-size: 16px; line-height: 1.5; }
textarea::placeholder { color: #555a54; }
.baby-options { display: grid; gap: 20px; padding: 23px 0 4px; }
.option-group { display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid transparent; border-radius: 999px; background: #272a27; padding: 8px 13px; color: #b8bbb5; font-size: 12px; cursor: pointer; }
.chip.selected { background: #edeee9; color: #191b19; }
.volume { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.volume-copy { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.volume-copy strong { font-size: 17px; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: #e8eae5; }
.volume > input { margin: 18px 0 5px; }
.volume-meta { display: flex; justify-content: space-between; color: #777b75; font-size: 12px; }
.actions { display: flex; gap: 10px; margin-top: 28px; }
.primary, .secondary, .discover-more { border: 0; border-radius: 13px; padding: 13px 18px; cursor: pointer; font-weight: 720; }
.primary { background: var(--accent); color: var(--accent-text); min-width: 220px; box-shadow: 0 8px 28px rgba(255,255,255,.06); }
.primary:hover { background: white; }
.secondary { background: #252825; border: 1px solid var(--line); color: #d3d5d0; }
.progress-wrap { margin-top: 22px; }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 9px; }
.progress-track { height: 6px; overflow: hidden; background: #292c29; border-radius: 99px; }
.progress-track div { width: 0; height: 100%; background: linear-gradient(90deg, #f2f3ef, #9ca69e); border-radius: inherit; transition: width .18s ease-out; }

.results-header { display: flex; align-items: start; justify-content: space-between; gap: 28px; margin: 8px 0 28px; }
.results-header h1 { max-width: 850px; }
.generation-brief { max-width: 780px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.header-actions { display: flex; gap: 9px; flex-shrink: 0; }
.toolbar { position: sticky; top: 0; z-index: 4; display: flex; gap: 20px; align-items: center; margin: 0 -8px 28px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(24,27,24,.9); backdrop-filter: blur(18px); }
.quality-control { display: grid; grid-template-columns: auto minmax(120px, 280px) 42px; gap: 12px; align-items: center; flex: 1; }
.quality-control strong { color: var(--text); font-variant-numeric: tabular-nums; }
.segmented { display: flex; padding: 3px; background: #101210; border-radius: 9px; }
.segmented button { border: 0; background: transparent; border-radius: 7px; padding: 6px 10px; cursor: pointer; color: #7e827c; }
.segmented button.selected { background: #303330; color: white; }
.density { display: flex; gap: 8px; align-items: center; }
.density input { width: 80px; }

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr)); gap: 16px; }
.results-grid.list { display: grid; grid-template-columns: 1fr; gap: 8px; }
.name-card { min-width: 0; min-height: 265px; display: flex; flex-direction: column; padding: 23px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.name-card:hover { border-color: var(--line-strong); background: #1b1e1b; transform: translateY(-1px); }
.name-card h2 { margin: 25px 0 4px; font-size: 34px; letter-spacing: -.04em; }
.pronunciation { margin: 0 0 20px; color: #878b85; font-size: 12px; text-transform: uppercase; }
.card-top, .card-bottom { display: flex; align-items: center; }
.card-top { justify-content: space-between; }
.availability { color: #777b76; font-size: 11px; font-weight: 700; }
.favorite-button, .copy-button, .open-button { border: 0; background: transparent; cursor: pointer; color: #9a9e98; }
.favorite-button { font-size: 23px; line-height: 1; }
.favorite-button.saved { color: #fff; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { padding: 7px 10px; border-radius: 999px; background: #252825; color: #a9aca6; font-size: 11px; }
.card-bottom { margin-top: auto; padding-top: 22px; gap: 10px; }
.score { color: #aeb1ab; font-size: 12px; }
.copy-button { margin-left: auto; font-size: 18px; }
.open-button { font-size: 12px; font-weight: 700; }
.results-grid.list .name-card { min-height: 0; display: grid; grid-template-columns: minmax(150px, .6fr) minmax(180px, 1fr) auto; grid-template-rows: auto auto; column-gap: 20px; align-items: center; padding: 16px 20px; border-radius: 15px; }
.results-grid.list .card-top { grid-column: 3; grid-row: 1 / span 2; gap: 12px; }
.results-grid.list .availability { display: none; }
.results-grid.list h2 { grid-column: 1; grid-row: 1; margin: 0; font-size: 24px; }
.results-grid.list .pronunciation { grid-column: 1; grid-row: 2; margin: 2px 0 0; }
.results-grid.list .tags { grid-column: 2; grid-row: 1 / span 2; }
.results-grid.list .card-bottom { grid-column: 3; grid-row: 1 / span 2; margin: 0; padding: 0; }
.results-grid.list .favorite-button { display: none; }
.discover-more { display: block; margin: 26px auto 0; background: #252825; border: 1px solid var(--line); }
.empty-state { min-height: 380px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); text-align: center; }
.empty-state > span { font-size: 32px; color: #747872; }
.empty-state h2 { margin: 0; color: #d4d6d1; }
.empty-state p { margin: 0; }
.simple-header { margin: 8px 0 34px; }
.history-list { display: grid; gap: 12px; max-width: 1000px; }
.history-item { display: grid; grid-template-columns: 68px 1fr auto; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); cursor: pointer; }
.history-item:hover { background: var(--surface-2); }
.history-number { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; background: #292c29; color: #dfe1dc; font-size: 18px; font-weight: 760; }
.history-item h3 { margin: 0 0 5px; }
.history-item p { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.history-item time { color: #70746e; font-size: 12px; }

.detail-panel { position: relative; min-width: 0; overflow: hidden auto; border-left: 1px solid var(--line); background: #171917; opacity: 0; transition: opacity .18s ease; }
.detail-open .detail-panel { opacity: 1; }
.close-detail { position: absolute; top: 22px; right: 22px; border: 0; background: transparent; color: #999d97; font-size: 26px; cursor: pointer; }
#detail-content { min-width: 340px; padding: 58px 38px 50px; }
.detail-name { font-size: 52px; margin: 12px 0 3px; }
.detail-pronunciation { color: var(--muted); text-transform: uppercase; }
.detail-score { margin: 32px 0; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #1d201d; }
.detail-score strong { display: block; font-size: 30px; margin-bottom: 3px; }
.detail-section { padding: 20px 0; border-top: 1px solid var(--line); }
.detail-section h4 { color: #777b75; font-size: 11px; letter-spacing: .12em; }
.detail-section p { color: #c4c7c1; line-height: 1.6; }
.detail-actions { display: flex; gap: 8px; margin-top: 22px; }

.hidden { display: none !important; }

@media (max-width: 1080px) {
  .app-shell, .app-shell.detail-open { grid-template-columns: 88px minmax(0, 1fr) 0; }
  .app-shell.detail-open { grid-template-columns: 88px minmax(420px, 1fr) minmax(320px, 42vw); }
  .sidebar { padding-inline: 12px; }
  .brand { padding-inline: 8px; justify-content: center; }
  .brand span, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .nav-item { display: flex; justify-content: center; padding: 12px; }
  .nav-item span { font-size: 19px; }
  .nav-item b, .nav-label, .status span { display: none; }
  .status { justify-content: center; }
  .view { padding-inline: 30px; }
}

@media (max-width: 720px) {
  body { background: var(--bg); }
  .app-shell, .app-shell.detail-open { width: 100%; height: 100vh; margin: 0; border: 0; border-radius: 0; grid-template-columns: 1fr; grid-template-rows: 1fr 68px; }
  .sidebar { grid-row: 2; z-index: 10; padding: 8px 12px; border: 0; border-top: 1px solid var(--line); }
  .brand, .nav-label, .status { display: none; }
  .sidebar nav { display: flex; justify-content: space-around; }
  .nav-item { width: auto; display: grid; grid-template-columns: 1fr; gap: 2px; font-size: 10px; text-align: center; padding: 7px 13px; }
  .nav-item span { font-size: 18px; }
  .nav-item b { display: none; }
  .main { grid-row: 1; }
  .view { padding: 28px 18px 80px; }
  .explore-wrap { margin: 0; }
  .hero-mark { width: 52px; height: 52px; }
  h1 { font-size: 34px; }
  .generator-card { padding: 20px; }
  .field-row { grid-template-columns: 1fr; gap: 8px; }
  .volume-copy, .results-header { display: block; }
  .volume-copy strong { display: block; margin-top: 6px; }
  .header-actions { margin-top: 18px; overflow-x: auto; }
  .toolbar { flex-wrap: wrap; }
  .quality-control { flex-basis: 100%; }
  .results-grid { --card-min: 100%; }
  .app-shell.detail-open .detail-panel { position: fixed; inset: 0 0 68px; z-index: 20; opacity: 1; }
  #detail-content { min-width: 0; }
}
