:root {
  color-scheme: light;
  --bg: #f3f1e9;
  --surface: rgba(255, 253, 248, 0.9);
  --surface-solid: #fffdf8;
  --ink: #272a25;
  --muted: #777a71;
  --line: rgba(49, 56, 46, 0.13);
  --sage: #7b8f73;
  --sage-dark: #465343;
  --sage-soft: #e6ebdf;
  --sand: #d5b384;
  --danger: #a85548;
  --shadow: 0 22px 70px rgba(74, 70, 55, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(251, 249, 242, 0.96), rgba(239, 241, 231, 0.88)),
    var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  pointer-events: none;
}
.ambient-a { top: -18vw; right: -10vw; background: #bbd1b2; }
.ambient-b { bottom: -22vw; left: 14vw; background: #e0c5a3; }

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(249, 247, 240, 0.72);
  padding: 26px 22px;
  backdrop-filter: blur(22px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.8);
  font: 700 11px/1 Georgia, serif;
}
.brand > span:last-child { display: grid; gap: 4px; }
.brand strong { font-size: 14px; letter-spacing: 0.13em; }
.brand small { color: var(--muted); font-size: 7px; letter-spacing: 0.16em; }
.sidebar nav { display: grid; gap: 6px; margin-top: 54px; }
.nav-item {
  display: grid;
  min-height: 48px;
  grid-template-columns: 30px 1fr;
  align-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 0 14px;
  color: #666a61;
  cursor: pointer;
  text-align: left;
  transition: 160ms ease;
}
.nav-item span { color: #a0a399; font-size: 9px; letter-spacing: 0.08em; }
.nav-item:hover, .nav-item.is-active {
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 10px 28px rgba(79, 75, 58, 0.07);
  color: var(--ink);
}
.nav-link { text-decoration: none; }
.privacy-card {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.67);
  padding: 16px;
}
.privacy-card strong { display: block; margin: 9px 0 7px; font-size: 12px; }
.privacy-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 5px rgba(123, 143, 115, 0.12);
}

.main-shell { min-width: 0; padding: 0 clamp(20px, 4vw, 64px) 64px; }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 108px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(var(--bg) 55%, rgba(243, 241, 233, 0));
  padding: 18px 0 26px;
}
.topbar p, .panel-head p, .profile-hero p, .profile-note > p {
  margin: 0 0 6px;
  color: var(--sage);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.topbar h1 { margin: 0; font: 500 clamp(22px, 3vw, 34px)/1.1 Georgia, "Noto Serif SC", serif; }
.topbar-actions, .inline-actions, .hero-actions { display: flex; align-items: center; gap: 10px; }
.auth-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.68);
  padding: 9px 13px;
  color: var(--muted);
  font-size: 10px;
}
.auth-state i { width: 6px; height: 6px; border-radius: 50%; background: #a5a79e; }
.auth-state.is-authenticated i { background: var(--sage); }

.button, .text-button {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.button {
  min-height: 40px;
  border-radius: 11px;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 650;
}
.hero-actions .button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: 0.55; transform: none; }
.button.primary { background: var(--sage-dark); color: #fffdf8; box-shadow: 0 10px 24px rgba(70, 83, 67, 0.18); }
.button.secondary { background: var(--sage-soft); color: var(--sage-dark); }
.button.ghost { border: 1px solid var(--line); background: rgba(255, 253, 248, 0.72); color: #5f635b; }
.button.light { background: #fffdf8; color: var(--ink); }
.button.wide { width: 100%; }
.button.danger { border: 1px solid rgba(168, 85, 72, 0.2); background: rgba(168, 85, 72, 0.07); color: var(--danger); }
.text-button { background: transparent; padding: 7px 0; color: #687563; font-size: 11px; }

main { max-width: 1500px; margin: 0 auto; }
.view { display: none; animation: enter 260ms ease both; }
.view.is-active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

.hero {
  position: relative;
  display: grid;
  min-height: 410px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 28px;
  background: linear-gradient(125deg, #425046 0%, #596a5b 55%, #6e7c69 100%);
  box-shadow: var(--shadow);
  padding: clamp(32px, 5vw, 72px);
  color: #f8f5ec;
}
.eyebrow { margin: 0 0 18px; font-size: 9px; font-weight: 700; letter-spacing: 0.16em; }
.eyebrow i { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: #dfc49d; }
.hero h2 { max-width: 760px; margin: 0; font: 400 clamp(32px, 4vw, 58px)/1.2 Georgia, "Noto Serif SC", serif; }
.hero-copy { max-width: 620px; margin: 24px 0 28px; color: rgba(248,245,236,.72); font-size: 13px; line-height: 1.9; }
.hero .text-button { color: rgba(255,255,255,.78); }
.hero-orbit { position: relative; width: min(32vw, 390px); aspect-ratio: 1; justify-self: center; }
.orbit { position: absolute; inset: 18%; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.orbit-a { transform: rotate(22deg) scaleY(.48); animation: orbit 13s linear infinite; }
.orbit-b { inset: 9%; transform: rotate(-36deg) scaleY(.66); animation: orbit-reverse 17s linear infinite; }
.core { position: absolute; inset: 34%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f6e8cc, #b8c7ad 52%, #536153); color: #344036; font: 600 26px/1 Georgia, serif; box-shadow: 0 0 70px rgba(226, 237, 211, .3); }
.node { position: absolute; width: 10px; height: 10px; border: 2px solid #fff8e9; border-radius: 50%; background: var(--sand); box-shadow: 0 0 0 8px rgba(255,255,255,.08); }
.node-a { top: 18%; left: 23%; }.node-b { top: 54%; right: 7%; }.node-c { bottom: 12%; left: 38%; }
@keyframes orbit { to { transform: rotate(382deg) scaleY(.48); } }
@keyframes orbit-reverse { to { transform: rotate(-396deg) scaleY(.66); } }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.metrics article, .panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 50px rgba(76, 71, 54, 0.06);
  backdrop-filter: blur(18px);
}
.metrics article { display: grid; min-height: 132px; align-content: center; gap: 7px; border-radius: 18px; padding: 22px; }
.metrics span, .profile-grid span { color: var(--muted); font-size: 10px; }
.metrics strong, .profile-grid strong { font: 500 28px/1.1 Georgia, serif; }
.metrics small, .profile-grid small { color: #989a91; font-size: 9px; }

.panel { border-radius: 22px; padding: 26px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.panel-head h3, .profile-note h3 { margin: 0; font: 500 22px/1.15 Georgia, "Noto Serif SC", serif; }
.search {
  width: min(32vw, 280px);
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffdf8;
  padding: 0 14px;
  outline: none;
}
.search:focus, input:focus, select:focus, textarea:focus { border-color: rgba(92, 112, 85, .55); box-shadow: 0 0 0 3px rgba(123, 143, 115, .1); }
.mode-banner { margin: -5px 0 18px; border-radius: 12px; background: rgba(230,235,223,.65); padding: 12px 14px; color: #667060; font-size: 10px; line-height: 1.6; }

.service-list, .service-grid, .history-list { display: grid; gap: 12px; }
.service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-card {
  position: relative;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,253,248,.76);
  padding: 18px;
}
.service-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.service-card h4 { margin: 0 0 5px; font-size: 15px; }
.service-card p { margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.service-badge { border-radius: 999px; background: var(--sage-soft); padding: 6px 9px; color: var(--sage-dark); font-size: 8px; text-transform: uppercase; }
.service-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; border-top: 1px solid var(--line); padding-top: 12px; }
.service-meta span { color: #96988f; font-size: 8px; }
.service-meta strong { display: block; overflow: hidden; margin-top: 4px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { display: flex; gap: 8px; }
.card-actions .button { min-height: 34px; flex: 1; padding: 0 10px; font-size: 9px; }
.compact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-list .service-card:nth-child(n+5) { display: none; }
.empty { grid-column: 1 / -1; border: 1px dashed rgba(73, 82, 68, .2); border-radius: 16px; padding: 42px 24px; color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: 7px; color: #575c54; }
.empty p { margin: 0; font-size: 11px; line-height: 1.7; }

.arena-grid { display: grid; grid-template-columns: minmax(330px, .8fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
.arena-form { position: sticky; top: 108px; }
.media-grid { display: grid; grid-template-columns: minmax(360px, .85fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.media-form { position: sticky; top: 108px; }
.media-kind-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 15px; }
.media-kind-switch label { cursor: pointer; }
.media-kind-switch input { position: absolute; opacity: 0; pointer-events: none; }
.media-kind-switch span { display: grid; min-height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,253,248,.7); color: var(--muted); font-size: 10px; font-weight: 650; }
.media-kind-switch input:checked + span { border-color: rgba(70,83,67,.4); background: var(--sage-dark); color: #fffdf8; }
.media-kind-switch input:disabled + span { cursor: not-allowed; opacity: .42; text-decoration: line-through; }
.media-check { min-height: 43px; margin-bottom: 15px; align-self: end; }
.media-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.media-note { margin: -2px 0 16px; border-radius: 11px; background: var(--sage-soft); padding: 11px 13px; color: #626b5d; font-size: 9px; line-height: 1.65; }
.media-results { min-height: 360px; }
.generated-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.generated-media-card { display: grid; gap: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fffdf8; padding: 10px; }
.generated-media-card img, .generated-media-card video { display: block; width: 100%; max-height: 620px; border-radius: 11px; background: #20231f; object-fit: contain; }
.generated-media-card .button { display: grid; place-items: center; text-decoration: none; }
.generated-video-card { padding: 14px; }
.step, .run-state { border-radius: 999px; background: var(--sage-soft); padding: 7px 10px; color: var(--sage-dark); font-size: 8px; letter-spacing: .08em; }
.field { display: grid; gap: 8px; margin-bottom: 15px; }
.field > span, .model-picker legend { color: #656960; font-size: 10px; font-weight: 650; }
.model-capability-field { align-content: start; }
.capability-list { display: flex; min-height: 43px; flex-wrap: wrap; align-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,253,248,.68); padding: 8px 10px; }
.capability-tag { display: inline-flex; align-items: center; border-radius: 999px; background: var(--sage-soft); padding: 6px 9px; color: var(--sage-dark); font-size: 9px; font-weight: 650; white-space: nowrap; }
.capability-empty { color: var(--muted); font-size: 9px; }
.service-capabilities { grid-column: 1 / -1; }
.service-capabilities strong { display: grid !important; overflow: visible; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px 8px; white-space: normal; }
.service-meta .service-capabilities .capability-tag {
  display: flex;
  min-width: 0;
  min-height: 27px;
  justify-content: center;
  border: 1px solid rgba(83, 99, 78, .14);
  background: linear-gradient(135deg, rgba(226, 232, 220, .9), rgba(243, 239, 228, .78));
  padding: 5px 7px;
  color: #596454;
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}
.field em { color: #999b92; font-size: 8px; font-style: normal; font-weight: 400; }
.api-key-field { margin-top: 2px; }
.api-key-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.button.compact { min-height: 30px; padding: 6px 10px; font-size: 9px; }
.api-key-table { overflow-x: auto; border: 1px solid rgba(61, 67, 58, .12); border-radius: 12px; background: rgba(255, 255, 255, .44); }
.api-key-row { display: grid; grid-template-columns: minmax(110px, .9fr) minmax(210px, 1.7fr) minmax(112px, .9fr) minmax(112px, .9fr) 76px; align-items: center; min-width: 720px; border-top: 1px solid rgba(61, 67, 58, .09); }
.api-key-row:first-child, .api-key-header + [data-service-key-list] > .api-key-row:first-child { border-top: 0; }
.api-key-row > * { min-width: 0; padding: 10px 11px; }
.api-key-header { border-top: 0; background: rgba(61, 67, 58, .045); color: #73776f; font-size: 9px; font-weight: 700; }
.api-key-cell { width: 100%; border: 0; background: transparent; color: #343832; text-align: left; font: 500 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-key-cell:hover { color: var(--sage-dark); text-decoration: underline; }
.api-key-date { color: #656960; font-size: 9px; white-space: nowrap; }
.api-key-actions { display: flex; justify-content: center; }
.api-key-delete { width: 52px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--danger); cursor: pointer; white-space: nowrap; }
.api-key-delete:hover { background: rgba(168, 85, 72, .08); }
.api-key-row input { width: calc(100% - 10px); margin: 5px; padding: 9px 8px; border: 1px solid rgba(61, 67, 58, .15); border-radius: 8px; background: rgba(255,255,255,.8); font-size: 10px; }
.api-key-empty { padding: 16px; color: #858980; font-size: 9px; text-align: center; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffdf8;
  padding: 11px 13px;
  color: var(--ink);
  outline: none;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.7; }
.field .small-textarea, .small-textarea { min-height: 82px; }
.two-fields, .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.model-picker { margin: 4px 0 18px; border: 0; padding: 0; }
.model-picker > div { display: grid; gap: 8px; margin-top: 10px; }
.model-option, .check {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,253,248,.7);
  padding: 11px 12px;
  color: #62675e;
  font-size: 10px;
}
.model-option strong { margin-left: auto; color: #898c83; font-size: 8px; font-weight: 500; }
.results { display: grid; gap: 14px; }
.result-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fffdf8; }
.result-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 14px 16px; }
.result-card header strong { font-size: 12px; }.result-card header span { color: var(--muted); font-size: 8px; }
.result-card pre { max-height: 520px; margin: 0; overflow: auto; padding: 18px; color: #41463f; font: 11px/1.75 Consolas, "Microsoft YaHei UI", monospace; white-space: pre-wrap; word-break: break-word; }
.result-card.is-error pre { color: var(--danger); }

.history-item { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); padding: 14px 4px; }
.history-item:last-child { border-bottom: 0; }
.history-item time { color: var(--muted); font-size: 9px; }
.history-item strong { display: block; margin-bottom: 5px; font-size: 12px; }
.history-item p { margin: 0; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.history-item > span { color: var(--sage-dark); font-size: 9px; }
.history-item.has-media { align-items: start; }
.history-media { display: grid; max-width: 520px; gap: 8px; margin-top: 12px; }
.history-media video { display: block; width: 100%; max-height: 360px; border-radius: 12px; background: #20231f; object-fit: contain; }
.history-media a { width: max-content; color: var(--sage-dark); font-size: 10px; font-weight: 650; text-decoration: none; }
.history-media-state { display: block; margin-top: 9px; color: var(--sage); font-size: 9px; }
.history-media-state.is-error { color: #9b5548; }
.history-billing { display: block; margin-top: 7px; color: var(--sage-dark); font-size: 9px; line-height: 1.5; }

.profile-hero { display: flex; align-items: center; gap: 18px; }
.profile-hero .button { margin-left: auto; }
.avatar { display: grid; width: 70px; height: 70px; place-items: center; border-radius: 50%; background: linear-gradient(145deg, var(--sage-soft), #f1dfc4); color: var(--sage-dark); font: 500 28px/1 Georgia, serif; }
.profile-hero h2 { margin: 0 0 5px; font: 500 28px/1.1 Georgia, serif; }
.profile-hero span { color: var(--muted); font-size: 11px; }
.profile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
.profile-grid article { display: grid; min-height: 130px; align-content: center; gap: 8px; }
.profile-note ul { margin: 14px 0 0; padding-left: 20px; color: #656a61; font-size: 11px; line-height: 2; }
.profile-note code { border-radius: 5px; background: var(--sage-soft); padding: 2px 5px; }

.modal {
  width: min(720px, calc(100% - 28px));
  max-height: min(88vh, 850px);
  overflow: auto;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 24px;
  background: #f9f7f0;
  box-shadow: 0 35px 100px rgba(38, 42, 35, .2);
  padding: 0;
  color: var(--ink);
}
.modal[data-service-modal] { width: min(1040px, calc(100% - 28px)); }
.modal::backdrop { background: rgba(43, 48, 40, .3); backdrop-filter: blur(7px); }
.modal form { padding: 24px; }
.modal header, .modal footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal header { margin-bottom: 22px; }
.modal header p { margin: 0 0 5px; color: var(--sage); font-size: 8px; letter-spacing: .13em; }
.modal header h2 { margin: 0; font: 500 26px/1.1 Georgia, serif; }
.modal header > button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(48,53,46,.06); cursor: pointer; font-size: 20px; }
.modal footer { margin-top: 18px; justify-content: flex-end; }
.full { grid-column: 1 / -1; }
.modal-note, .auth-copy { border-radius: 11px; background: var(--sage-soft); padding: 11px 13px; color: #626b5d; font-size: 9px; line-height: 1.6; }
.auth-modal { width: min(460px, calc(100% - 28px)); }
.auth-copy { margin: -4px 0 18px; }
.form-error { min-height: 20px; margin: 0; color: var(--danger); font-size: 10px; }

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100% - 44px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #384339;
  box-shadow: var(--shadow);
  padding: 13px 16px;
  color: #fffdf8;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast.is-error { background: #774a42; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 80px minmax(0, 1fr); }
  .sidebar { padding: 22px 12px; }
  .brand > span:last-child, .nav-item:not(.is-active)::after, .nav-item { font-size: 0; }
  .brand { justify-content: center; }.nav-item { grid-template-columns: 1fr; place-items: center; padding: 0; }
  .nav-item span { font-size: 9px; }.privacy-card { display: none; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr .65fr; }.hero-orbit { width: 280px; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; z-index: 30; top: 0; display: grid; width: 100%; height: auto; grid-template-columns: auto 1fr; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .brand { justify-content: flex-start; }.brand > span:last-child { display: none; }
  .sidebar nav { display: flex; justify-content: flex-end; overflow-x: auto; margin: 0; }
  .nav-item { min-width: 44px; min-height: 40px; }
  .main-shell { padding: 0 14px 44px; }.topbar { min-height: 92px; }
  .topbar-actions .auth-state { display: none; }.topbar h1 { font-size: 24px; }
  .hero { min-height: 430px; grid-template-columns: 1fr; padding: 30px; }
  .hero-orbit { position: absolute; right: -75px; bottom: -90px; opacity: .5; }
  .hero > div:first-child { position: relative; z-index: 1; }
  .metrics, .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arena-grid, .media-grid { grid-template-columns: 1fr; }.arena-form, .media-form { position: static; }
}

@media (max-width: 580px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 18px 0; }
  .topbar-actions { width: 100%; }.topbar-actions .button { flex: 1; }
  .hero h2 { font-size: 32px; }.hero-copy { font-size: 11px; }
  .metrics, .profile-grid, .service-grid, .compact-list { grid-template-columns: 1fr; }
  .inline-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .panel-head { align-items: flex-start; flex-direction: column; }.search { width: 100%; }
  .panel { padding: 19px; border-radius: 18px; }
  .two-fields, .form-grid { grid-template-columns: 1fr; }.full { grid-column: auto; }
  .media-upload-grid, .generated-images { grid-template-columns: 1fr; }
  .history-item { grid-template-columns: 1fr auto; }.history-item time { grid-column: 1 / -1; }
  .profile-hero { align-items: flex-start; flex-wrap: wrap; }.profile-hero .button { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
