@font-face {
  font-family: "H5PuHuiTi";
  src: url("./assets/fonts/AlibabaPuHuiTi-3-55-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "H5PuHuiTi";
  src: url("./assets/fonts/AlibabaPuHuiTi-3-65-Medium.ttf") format("truetype");
  font-weight: 650;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "H5PuHuiTi";
  src: url("./assets/fonts/AlibabaPuHuiTi-3-85-Bold.ttf") format("truetype");
  font-weight: 850;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #041020;
  --bg-deep: #020814;
  --surface: rgba(13, 37, 64, 0.84);
  --surface-strong: rgba(18, 52, 86, 0.94);
  --surface-soft: rgba(6, 22, 42, 0.72);
  --line: rgba(124, 191, 255, 0.18);
  --line-hot: rgba(66, 207, 255, 0.42);
  --text: #f2f8ff;
  --muted: #b6c8db;
  --dim: #7f9bb4;
  --blue: #2f80ff;
  --blue-strong: #1b62e8;
  --cyan: #38D6FF;
  --green: #4ee6b8;
  --amber: #f7c948;
  --red: #ff5a5f;
  --violet: #b777ff;
  --radius: 8px;
  --shadow-glass: 0 16px 38px rgba(0, 0, 0, 0.32);
  --shadow-tight: 0 10px 26px rgba(0, 0, 0, 0.28);
  --glass: linear-gradient(135deg, rgba(18, 56, 95, 0.78), rgba(7, 27, 53, 0.9));
  --primary: linear-gradient(135deg, #2f80ff, #1b62e8);
  --font-display-cn: "H5PuHuiTi", "Alibaba PuHuiTi 3.0", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 74% 8%, rgba(47, 128, 255, 0.22), transparent 36%),
    radial-gradient(circle at 8% 86%, rgba(56, 214, 255, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(3, 9, 20, 0.94), rgba(3, 13, 28, 0.98)),
    #020814;
  color: var(--text);
  font-family: var(--font-display-cn);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.command-shell {
  position: relative;
  width: min(100%, 390px);
  max-width: 390px;
  min-height: 100dvh;
  overflow: hidden;
  border-right: 1px solid rgba(122, 184, 255, 0.14);
  border-left: 1px solid rgba(122, 184, 255, 0.14);
  background:
    radial-gradient(circle at 50% -14%, rgba(47, 128, 255, 0.28), transparent 42%),
    linear-gradient(180deg, #061426 0%, #041020 48%, #020814 100%);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(56, 214, 255, 0.05);
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(7, 23, 45, 0.94), rgba(3, 14, 31, 0.84)),
    rgba(3, 14, 31, 0.82);
  backdrop-filter: blur(16px);
}

.top-bar strong,
.top-bar span {
  display: block;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.top-bar strong {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 850;
}

.top-bar span {
  margin-top: 2px;
  color: rgba(214, 232, 255, 0.72);
  font-size: 11px;
  line-height: 1.2;
}

.icon-btn,
.status-pill,
.primary-btn,
.ghost-btn,
.mini-btn,
.save-btn,
.role-card,
.choice-card,
.unit-card,
.detail-tabs button,
.point-marker {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.icon-btn,
.status-pill,
.primary-btn,
.ghost-btn,
.mini-btn,
.save-btn,
.detail-tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  min-height: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-icon {
  display: none;
}

html:not([data-command-view="home"]) .home-icon {
  display: none;
}

html:not([data-command-view="home"]) .back-icon {
  display: block;
}

.status-pill {
  justify-self: end;
  min-width: 62px;
  min-height: 40px;
  padding: 0 13px;
  border-color: rgba(56, 214, 255, 0.46);
  background:
    linear-gradient(135deg, rgba(56, 214, 255, 0.24), rgba(47, 128, 255, 0.34)),
    rgba(255, 255, 255, 0.03);
  color: #e9fbff;
  font-size: 13px;
  font-weight: 850;
}

.app {
  min-height: calc(100dvh - 58px);
  padding: 13px 12px max(30px, env(safe-area-inset-bottom));
}

.startup-state {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(56, 214, 255, 0.34);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(18, 56, 95, 0.72), rgba(7, 27, 53, 0.88)),
    rgba(8, 28, 55, 0.78);
  box-shadow: var(--shadow-tight);
}

.startup-state strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 850;
}

.startup-state span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.hero,
.role-card,
.choice-card,
.unit-card,
.overview-card,
.notice-card,
.broadcast-ticker,
.approved-route-card,
.auth-panel,
.command-card,
.task-card,
.save-card,
.status-grid article,
.role-stats article,
.detail-top,
.detail-meta {
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow-tight);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.hero::before,
.role-card::before,
.choice-card::before,
.unit-card::before,
.overview-card::before,
.command-card::before,
.task-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 86% 10%, color-mix(in srgb, var(--role-color, var(--cyan)) 18%, transparent), transparent 32%),
    linear-gradient(120deg, color-mix(in srgb, var(--role-color, var(--blue)) 12%, transparent), transparent 48%);
}

.hero > *,
.role-card > *,
.choice-card > *,
.unit-card > *,
.overview-card > *,
.command-card > *,
.task-card > * {
  position: relative;
  z-index: 1;
}

.hero-home {
  min-height: 198px;
  display: grid;
  align-content: end;
  border-color: rgba(119, 184, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(4, 11, 20, 0.02), rgba(4, 11, 20, 0.78)),
    url("./assets/stadium-night.jpg") center / cover no-repeat;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    0 0 22px rgba(47, 128, 255, 0.18);
}

.eyebrow {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 850;
}

.hero h1 {
  max-width: 10.5em;
  margin: 8px 0 0;
  font-size: 27px;
  line-height: 1.13;
  letter-spacing: 0;
  font-weight: 850;
}

.hero p {
  margin: 9px 0 0;
  color: rgba(244, 249, 255, 0.92);
  font-size: 13px;
  line-height: 1.5;
}

.role-hero {
  border-color: color-mix(in srgb, var(--role-color) 44%, var(--line));
}

.permission-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.permission-row span {
  min-height: 27px;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--role-color) 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--role-color) 16%, rgba(255, 255, 255, 0.03));
  color: #eaf8ff;
  font-size: 11px;
  font-weight: 650;
}

.status-grid,
.role-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 9px;
}

.status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.status-grid article,
.role-stats article {
  min-width: 0;
  padding: 9px;
  border-color: rgba(122, 184, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(18, 56, 95, 0.66), rgba(7, 27, 53, 0.78)),
    rgba(8, 28, 55, 0.72);
}

.status-grid article {
  min-height: 78px;
  padding: 13px 14px;
}

.status-grid span,
.status-grid strong,
.status-grid small,
.role-stats span,
.role-stats strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-grid span,
.role-stats span {
  color: var(--dim);
  font-size: 10px;
  font-weight: 650;
}

.status-grid strong,
.role-stats strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 19px;
  line-height: 1.1;
  font-weight: 850;
}

.status-grid strong {
  margin-top: 7px;
  font-size: 24px;
}

.status-grid small {
  margin-top: 5px;
  color: rgba(214, 232, 255, 0.62);
  font-size: 10px;
}

.status-grid small {
  margin-top: 7px;
  font-size: 11px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 15px 0 8px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 850;
}

.section-title span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.role-grid,
.choice-list,
.unit-list {
  display: grid;
  gap: 8px;
}

.role-card,
.choice-card,
.unit-card {
  position: relative;
  width: 100%;
  min-height: 72px;
  padding: 10px;
  overflow: hidden;
  text-align: left;
}

.role-card,
.unit-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-color: color-mix(in srgb, var(--role-color) 42%, rgba(255, 255, 255, 0.1));
}

.choice-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.role-card:active,
.choice-card:active,
.unit-card:active,
.mini-btn:active,
.primary-btn:active,
.ghost-btn:active,
.detail-tabs button:active,
.icon-btn:active {
  transform: scale(0.98);
}

.role-mark,
.unit-marker {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--role-color) 72%, transparent);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.36), transparent 28%),
    color-mix(in srgb, var(--role-color) 92%, #ffffff);
  color: #041225;
  box-shadow: 0 0 22px color-mix(in srgb, var(--role-color) 24%, transparent);
  font-size: 15px;
  font-weight: 850;
}

.role-copy,
.unit-copy,
.choice-card span {
  min-width: 0;
}

.role-card strong,
.choice-card strong,
.unit-card strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 850;
}

.role-card small,
.choice-card small,
.unit-card small {
  display: block;
  margin-top: 5px;
  color: rgba(214, 232, 255, 0.72);
  font-size: 11px;
  line-height: 1.35;
}

.role-lock,
.choice-card em,
.unit-card em {
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--role-color, var(--cyan)) 82%, #ffffff);
  color: #041225;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.auth-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 13px;
}

.auth-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.auth-panel input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(122, 184, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

.auth-error {
  min-height: 36px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 107, 95, 0.44);
  border-radius: var(--radius);
  background: rgba(255, 107, 95, 0.12);
  color: #ffd7d2;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}

.primary-btn,
.ghost-btn {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  font-weight: 850;
}

.primary-btn,
.mini-btn {
  border-color: rgba(56, 214, 255, 0.42);
  background: var(--primary);
  color: #f7fbff;
  box-shadow: 0 0 22px rgba(47, 128, 255, 0.28);
}

.primary-btn:disabled,
.auth-panel input:disabled {
  cursor: wait;
  opacity: 0.68;
}

.save-btn {
  min-width: 104px;
  padding: 0 13px;
  border-color: rgba(56, 214, 255, 0.42);
  background: var(--primary);
  color: #f7fbff;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 0 22px rgba(47, 128, 255, 0.22);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.overview-card {
  position: relative;
  margin-top: 10px;
  padding: 11px;
  overflow: hidden;
}

.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.overview-head strong,
.overview-head span {
  display: block;
}

.overview-head strong {
  font-size: 16px;
  font-weight: 850;
}

.overview-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.mini-btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  font-size: 12px;
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-color: color-mix(in srgb, var(--role-color) 44%, var(--line));
}

.detail-top span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.detail-top h1 {
  margin: 5px 0 0;
  font-size: 24px;
  line-height: 1.12;
  font-weight: 850;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 8px;
  padding: 8px;
  border-color: color-mix(in srgb, var(--role-color) 30%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--role-color) 10%, transparent), transparent),
    rgba(7, 27, 53, 0.72);
}

.detail-meta span {
  min-width: 0;
  padding: 4px 7px;
  color: rgba(244, 249, 255, 0.82);
  font-size: 11px;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0 2px;
}

.detail-tabs button {
  min-width: 0;
  min-height: 48px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.detail-tabs button.active {
  border-color: rgba(56, 214, 255, 0.5);
  background: var(--primary);
  color: #f7fbff;
  box-shadow: 0 0 22px rgba(47, 128, 255, 0.22);
}

.broadcast-ticker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 44px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-color: rgba(56, 214, 255, 0.32);
  background:
    linear-gradient(90deg, rgba(56, 214, 255, 0.18), rgba(47, 128, 255, 0.08)),
    rgba(8, 28, 55, 0.86);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.26),
    0 0 20px rgba(56, 214, 255, 0.12);
}

.broadcast-ticker.level-warning {
  border-color: color-mix(in srgb, var(--amber) 54%, var(--line));
  background:
    linear-gradient(90deg, rgba(247, 201, 72, 0.18), rgba(47, 128, 255, 0.06)),
    rgba(8, 28, 55, 0.86);
}

.broadcast-ticker.level-urgent {
  border-color: color-mix(in srgb, var(--red) 58%, var(--line));
  background:
    linear-gradient(90deg, rgba(255, 90, 95, 0.2), rgba(47, 128, 255, 0.06)),
    rgba(8, 28, 55, 0.88);
}

.broadcast-ticker span {
  padding: 6px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #03101e;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.broadcast-ticker.level-warning span {
  background: linear-gradient(135deg, var(--amber), #ffdc73);
}

.broadcast-ticker.level-urgent span {
  background: linear-gradient(135deg, var(--red), #ff8a90);
}

.broadcast-ticker strong {
  min-width: 0;
  color: #e9fbff;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (min-width: 760px) {
  body {
    padding: 18px 0;
  }

  .command-shell {
    min-height: calc(100dvh - 36px);
    border-radius: 14px;
  }

  .top-bar {
    border-radius: 14px 14px 0 0;
  }
}

@media (max-width: 759px) {
  body {
    display: block;
    padding: 0;
  }

  .command-shell {
    width: min(100vw, 390px);
    margin: 0;
    border-radius: 0;
  }
}

.map-panel {
  position: relative;
  height: 306px;
  overflow: hidden;
  border: 1px solid rgba(122, 184, 255, 0.24);
  border-radius: var(--radius);
  background: #061226;
  box-shadow:
    var(--shadow-glass),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.map-panel.compact {
  height: 232px;
}

.map-panel.approved {
  height: 238px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.map-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 10, 18, 0.12), rgba(4, 10, 18, 0.78)),
    url("./assets/overview-guide.png") center / cover no-repeat;
  filter: saturate(0.9) brightness(0.62) contrast(1.08);
}

.map-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 214, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 214, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.map-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.route-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
  filter: drop-shadow(0 0 8px currentColor);
}

.route-halo {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 13;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.point-marker {
  position: absolute;
  z-index: 4;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.24), transparent 26%),
    rgba(4, 12, 18, 0.94);
  color: var(--point-color);
  box-shadow:
    0 0 18px color-mix(in srgb, currentColor 42%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 850;
}

.point-marker:active {
  transform: translate(-50%, -50%) scale(0.94);
}

.point-label {
  position: absolute;
  z-index: 3;
  left: var(--x);
  top: calc(var(--y) + 19px);
  transform: translateX(-50%);
  max-width: 112px;
  padding: 4px 7px;
  border: 1px solid rgba(122, 184, 255, 0.22);
  border-radius: 6px;
  background: rgba(2, 8, 18, 0.78);
  color: #eefaf6;
  font-size: 10px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.approved-route-card {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-color: color-mix(in srgb, var(--role-color, var(--cyan)) 34%, var(--line));
  background: rgba(2, 8, 18, 0.42);
}

.approved-route-image {
  height: 238px;
  overflow: hidden;
  background: #061226;
}

.approved-route-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.9) brightness(0.72) contrast(1.06);
}

.approved-route-card figcaption {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 11px;
  border-top: 1px solid rgba(124, 191, 255, 0.16);
  background: rgba(2, 8, 18, 0.76);
}

.approved-route-card figcaption span {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.approved-route-card figcaption small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.notice-card,
.task-card,
.command-card {
  position: relative;
  overflow: hidden;
}

.notice-card {
  margin-top: 12px;
  padding: 13px;
  border-color: rgba(122, 184, 255, 0.2);
}

.notice-card strong {
  display: block;
  font-size: 15px;
  font-weight: 850;
}

.notice-card p,
.note {
  margin: 7px 0 0;
  color: rgba(244, 249, 255, 0.84);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.task-card,
.command-card {
  margin-top: 12px;
  padding: 13px;
  border-color: color-mix(in srgb, var(--role-color, var(--cyan)) 36%, var(--line));
}

.save-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
  padding: 13px;
  border-color: color-mix(in srgb, var(--role-color, var(--cyan)) 42%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--role-color, var(--cyan)) 14%, transparent), rgba(7, 27, 53, 0.9)),
    var(--glass);
}

.save-card strong,
.save-card span {
  display: block;
  min-width: 0;
}

.save-card .save-btn {
  width: 100%;
  min-height: 46px;
  font-size: 14px;
}

.save-card strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.save-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.card-title-row,
.task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title-row strong,
.task-head strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 850;
}

.card-title-row span,
.task-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.tag {
  flex: 0 0 auto;
  max-width: 128px;
  padding: 5px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #03101e;
  font-size: 11px;
  font-weight: 850;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.command-fields {
  display: grid;
  gap: 0;
  margin: 13px 0 0;
  border-top: 1px solid rgba(124, 191, 255, 0.12);
}

.command-fields div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(124, 191, 255, 0.12);
}

.command-fields dt {
  color: var(--dim);
  font-size: 11px;
  font-weight: 650;
}

.command-fields dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}

@media (max-width: 360px) {
  .app {
    padding-inline: 10px;
  }

  .hero {
    padding: 15px;
  }

  .hero h1 {
    font-size: 25px;
  }

  .role-card,
  .unit-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .role-mark,
  .unit-marker {
    width: 38px;
    height: 38px;
  }

  .detail-tabs button {
    font-size: 12px;
  }

  .status-grid article,
  .role-stats article {
    padding: 8px;
  }
}

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