:root {
  color-scheme: light;
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-soft: #faf9fc;
  --line: #e5e2ea;
  --text: #17151c;
  --muted: #777180;
  --accent: #FE0171;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(254, 1, 113, 0.10);
  --cute: #FE0171;
  --cool: #0267FF;
  --passion: #FFB400;
  --all: #7965dd;
  --radius: 8px;
  --shadow: 0 16px 42px rgba(38, 30, 50, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
}

.web-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 150px minmax(280px, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 74px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.brand {
  color: var(--accent);
  font-size: 24px;
  font-weight: 860;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
}

.global-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-switcher {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.theme-switcher button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.theme-switcher button::before {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--swatch);
  content: "";
}

.theme-switcher button.active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.theme-short {
  display: none;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}

.icon-button.small {
  width: 34px;
  height: 34px;
  font-size: 20px;
}

.web-layout {
  display: grid;
  grid-template-columns: 88px clamp(430px, 38vw, 520px) minmax(0, 1fr);
  min-height: calc(100vh - 74px);
}

.sidebar {
  position: sticky;
  top: 74px;
  display: grid;
  align-content: start;
  gap: 8px;
  height: calc(100vh - 74px);
  padding: 22px 10px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.sidebar button {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 12px 4px;
  border-radius: var(--radius);
  background: transparent;
  color: #55515e;
  font-size: 12px;
  font-weight: 720;
}

.sidebar button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.list-pane {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fff;
}

.detail-pane {
  min-width: 0;
  padding: 26px;
  background: var(--bg);
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 20px 14px;
}

.pane-head h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 850;
}

.pane-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.secondary-button,
.primary-small,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 780;
}

.secondary-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.primary-small,
.primary-button {
  background: var(--accent);
  color: var(--accent-contrast);
}

.primary-small {
  min-height: 38px;
  padding: 0 14px;
}

.primary-button {
  min-height: 46px;
  padding: 0 20px;
  font-size: 16px;
}

.primary-button.full {
  width: 100%;
  margin: 16px 0;
}

.chip-row {
  display: flex;
  gap: 8px;
  padding: 0 20px 14px;
  overflow-x: auto;
}

.chip-row button {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 999px;
  background: #f4f2f7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.chip-row button.active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.entity-list {
  display: grid;
  gap: 2px;
  padding: 0 12px 40px;
}

.entity-row,
.unit-row,
.search-result {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
}

.search-result {
  grid-template-columns: 54px minmax(0, 1fr);
}

.entity-row > span,
.search-result > span {
  min-width: 0;
}

.entity-row:hover,
.entity-row.active,
.unit-row:hover,
.unit-row.active,
.search-result:hover {
  border-color: var(--line);
  background: var(--accent-soft);
}

.entity-row strong,
.unit-row strong,
.search-result strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-row small,
.search-result small {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-row b {
  color: var(--accent);
  text-align: right;
}

.entity-row b small {
  color: var(--muted);
}

.avatar,
.art {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: #fff;
  font-weight: 850;
}

.avatar {
  width: 54px;
  height: 54px;
  font-size: 17px;
}

.avatar::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--attr-color);
  content: "";
}

.tool-avatar::after {
  display: none;
}

.art {
  width: 180px;
  height: 180px;
  border-radius: 18px;
  font-size: 54px;
}

.attr-cute {
  --attr-color: var(--cute);
  background: linear-gradient(135deg, #ff3c94, #ffacd0);
}

.attr-cool {
  --attr-color: var(--cool);
  background: linear-gradient(135deg, #0267ff, #9cc8ff);
}

.attr-passion {
  --attr-color: var(--passion);
  background: linear-gradient(135deg, #ff9e00, #ffd86f);
}

.attr-all {
  --attr-color: var(--all);
  background: linear-gradient(135deg, #8069e6, #ffbf53);
}

.detail-card {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.wide-card {
  max-width: 980px;
}

.detail-title h2,
.card-hero h2 {
  margin: 0;
  font-size: 25px;
}

.detail-title p,
.card-hero p {
  margin: 6px 0 0;
  color: var(--muted);
}

.card-hero,
.live-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--passion);
  color: #111;
  font-size: 12px;
  font-weight: 850;
}

.heart-button {
  margin-top: 12px;
  background: transparent;
  color: var(--accent);
  font-size: 30px;
}

.info-grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.result-grid {
  grid-template-columns: repeat(3, 1fr);
}

.stat {
  display: block;
  padding: 13px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.stat small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.subpanel {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.subpanel h3 {
  margin: 0 0 10px;
}

.member-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.unit-row {
  grid-template-columns: 1fr;
  margin-bottom: 8px;
  padding: 16px;
  background: #fff;
}

.simulation-row,
.my-style-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  text-align: left;
}

.simulation-row:hover,
.simulation-row.active,
.my-style-row:hover,
.my-style-row.active {
  border-color: var(--line);
  background: var(--accent-soft);
}

.sim-jacket {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
}

.sim-row-body,
.my-style-row span {
  min-width: 0;
}

.sim-row-body strong,
.my-style-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sim-row-body small,
.my-style-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.member-strip.dense .avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 13px;
}

.unit-board {
  position: relative;
  margin-top: 18px;
  padding: 22px 18px 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.center-label {
  color: #b3adb9;
  font-size: 12px;
  font-weight: 760;
}

.unit-board > .center-label {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
}

.unit-member-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(70px, 1fr));
  gap: 10px;
}

.unit-member {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 8px 6px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
}

.unit-member:hover,
.unit-member.editing {
  border-color: var(--accent);
}

.unit-member > .center-label {
  position: absolute;
  top: -18px;
}

.unit-member .avatar {
  width: 68px;
  height: 68px;
}

.unit-member.compact .avatar {
  width: 58px;
  height: 58px;
}

.potential-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-width: 70px;
  padding: 5px 6px;
  border-radius: 6px;
  background: #dddde0;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}

.potential-grid b:nth-child(4) {
  grid-column: 1 / 2;
}

.potential-grid b:nth-child(5) {
  grid-column: 3 / 4;
}

.member-picker {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.picker-head,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.picker-controls {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  overflow-x: auto;
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px;
}

.candidate-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
}

.candidate-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.candidate-card span:last-child {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-label {
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.appeal-band {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 10px;
  padding: 14px;
  border-radius: var(--radius);
  background: #fff;
}

.metric {
  text-align: center;
  font-weight: 800;
}

.metric b {
  margin-left: 6px;
  color: var(--text);
}

.cute-text { color: var(--cute); }
.cool-text { color: var(--cool); }
.passion-text { color: #ff8b00; }
.life-text { color: #24c45a; }
.skill-text { color: #b238dc; }
.total-text { color: var(--text); }
.muted-line { color: var(--muted); }

.skill-list p {
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.skill-list p:first-of-type {
  border-top: 0;
}

.link-button {
  background: transparent;
  color: var(--accent);
  font-weight: 800;
}

.unit-editor {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.member-slot {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 10px;
}

.member-slot span {
  color: var(--muted);
  font-size: 13px;
}

.member-slot select,
.sim-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 10px;
}

.sim-summary,
.sim-form {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
}

.sim-summary {
  margin: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.sim-live-card {
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 13px;
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.sim-live-card strong,
.sim-live-card small {
  display: block;
}

.sim-live-card small {
  margin-top: 5px;
  color: var(--muted);
}

.sim-form {
  grid-template-columns: repeat(2, 1fr);
}

.sim-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.mini-beatmap {
  position: relative;
  height: 260px;
  overflow: hidden;
  border-radius: var(--radius);
  background-image:
    linear-gradient(#dedbe5 1px, transparent 1px),
    linear-gradient(90deg, #dedbe5 1px, transparent 1px);
  background-size: 100% 20%, 20% 100%;
}

.mini-beatmap i {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.tap { background: #ff2d55; }
.long { background: #ff9500; }
.flick { background: #0267ff; }
.slide { background: #c735dc; }

.search-results {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.sheet-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.sheet-head,
.sheet-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(6, minmax(62px, 0.5fr));
  gap: 8px;
  align-items: center;
  min-width: 650px;
}

.sheet-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.sheet-row {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sheet-row.invalid {
  border-color: #d93025;
  background: #fff5f5;
}

.sheet-row strong small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.sheet-row input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
}

.sheet-row b {
  text-align: center;
}

.status-line {
  color: var(--accent);
  font-weight: 730;
}

.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.my-style-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 18px;
  margin-top: 18px;
}

.my-style-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.my-style-profile {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.my-style-profile h3,
.my-style-profile p {
  margin: 0;
}

.my-style-profile p {
  margin-top: 4px;
  color: var(--muted);
}

.point-total {
  margin-top: 14px;
  text-align: right;
  font-size: 20px;
  font-weight: 850;
}

.style-stat-control {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(2, 54px) minmax(60px, 1fr) repeat(2, 54px);
  overflow: hidden;
  border-radius: var(--radius);
  background: #d7d5d9;
}

.stepper button,
.stepper input {
  min-height: 38px;
  border: 0;
  border-left: 1px solid #c3c0c7;
  background: transparent;
  text-align: center;
}

.stepper input {
  background: #fff;
  color: var(--text);
}

.warning-text {
  margin-top: 16px;
  color: #9b5b00;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: space-between;
  }

  .web-layout {
    grid-template-columns: 72px clamp(360px, 42vw, 460px) minmax(0, 1fr);
  }

  .sidebar button span {
    display: none;
  }
}

@media (max-width: 820px) {
  .topbar {
    position: sticky;
    grid-template-columns: 1fr auto;
    min-height: auto;
    padding: 12px;
  }

  .brand {
    font-size: 21px;
  }

  .global-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .top-actions {
    justify-content: flex-end;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .theme-switcher {
    gap: 4px;
    padding: 3px;
  }

  .theme-switcher button {
    min-width: 34px;
    justify-content: center;
    padding: 7px 8px;
    color: var(--muted);
  }

  .theme-switcher button::before,
  .theme-label {
    display: none;
  }

  .theme-short {
    display: inline;
  }

  .theme-switcher button:not(.active) {
    width: auto;
    color: var(--muted);
  }

  .theme-switcher button.active {
    color: var(--accent-contrast);
  }

  .web-layout {
    display: block;
    padding-bottom: 70px;
  }

  .sidebar,
  .detail-pane {
    display: none;
  }

  .tab-unit:not(.has-query) .detail-pane,
  .tab-simulator:not(.has-query) .detail-pane,
  .tab-tools:not(.has-query) .detail-pane {
    display: block;
    padding: 12px;
  }

  .tab-unit:not(.has-query) .detail-card,
  .tab-simulator:not(.has-query) .detail-card,
  .tab-tools:not(.has-query) .detail-card {
    max-width: none;
    box-shadow: none;
  }

  .list-pane {
    border-right: 0;
  }

  .entity-list {
    padding-right: 12px;
    padding-left: 12px;
  }

  .unit-member-grid {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
    gap: 6px;
  }

  .unit-member .avatar {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    font-size: 13px;
  }

  .potential-grid {
    min-width: 52px;
    padding: 4px;
    font-size: 10px;
  }

  .appeal-band,
  .my-style-layout {
    grid-template-columns: 1fr;
  }

  .candidate-grid {
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  }

  .style-stat-control {
    grid-template-columns: 1fr;
  }

  .stepper {
    grid-template-columns: repeat(2, 45px) minmax(52px, 1fr) repeat(2, 45px);
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 6px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
  }

  .mobile-nav button {
    padding: 8px 2px;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    text-transform: capitalize;
  }

  .mobile-nav button.active {
    background: var(--accent-soft);
    color: var(--accent);
  }
}

/* API-backed production shell */
.error-line {
  margin: 8px 0 0;
  color: #c72c5a;
  font-size: 13px;
  font-weight: 760;
}

.list,
.simulation-workbench {
  display: grid;
  gap: 14px;
  padding: 0 12px 40px;
}

.list-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
}

.list-card:hover,
.list-card.active {
  border-color: var(--line);
  background: var(--accent-soft);
}

.list-main {
  min-width: 0;
}

.item-title {
  display: block;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-subtitle {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.mini-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

.item-metric {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.rarity {
  color: var(--accent);
  font-weight: 850;
}

.section-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 15px;
}

.detail-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.hero-avatar {
  width: 118px;
  height: 118px;
  border-radius: 18px;
  font-size: 38px;
}

.detail-kicker,
.detail-subtitle,
.muted-copy {
  color: var(--muted);
}

.detail-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 820;
}

.detail-title {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
}

.detail-subtitle {
  margin: 7px 0 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.meta-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.detail-body {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.stat-grid,
.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.status-grid {
  margin-bottom: 16px;
}

.status-cell {
  display: block;
  min-width: 0;
  padding: 13px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.status-cell small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-cell strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card {
  display: grid;
  gap: 14px;
}

.admin-password {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.admin-password input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: #fff;
  color: var(--text);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-button,
.primary-tool {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-weight: 780;
}

.primary-tool {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.admin-message {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
}

.job-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.job-box small {
  color: var(--muted);
}

.job-box pre {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  color: #45404d;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

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

.unit-slot {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 10px 6px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.unit-slot .avatar {
  width: 62px;
  height: 62px;
}

.slot-name {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 54px 1fr 58px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eeeaf2;
}

.bar-fill {
  display: block;
  width: var(--bar);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--passion));
}

.result-note {
  margin-top: 12px;
}

.skeleton {
  min-height: 78px;
  border-color: transparent;
  background: linear-gradient(90deg, #f3f0f6, #fff, #f3f0f6);
  background-size: 220% 100%;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}

@media (max-width: 980px) {
  .web-layout {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .detail-pane {
    display: none;
  }

  .mobile-nav {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .global-search {
    grid-column: 1 / -1;
    order: 2;
  }

  .web-layout {
    display: block;
    min-height: calc(100vh - 122px);
  }

  .sidebar {
    display: none;
  }

  .list-pane {
    padding-bottom: 72px;
    border-right: 0;
  }

  .stat-grid,
  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
