:root {
  color-scheme: dark;
  --page: #1b2028;
  --panel: #252c36;
  --panel-alt: #29323d;
  --field: #171c23;
  --border: #3c4857;
  --text: #dce3ea;
  --muted: #9da9b5;
  --blue: #5e8fd8;
  --blue-hover: #72a5ed;
  --danger: #ff7b84;
  --dashboard-width: 1100px;
  --compact-panel-height: 56px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  background: var(--page);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

.application-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(calc(var(--dashboard-width) + 72px), 100%);
  min-width: 0;
  margin-top: 36px;
  padding: 14px 12px 12px;
  border: 1px solid #465465;
  border-radius: 0 12px 12px 12px;
  background: linear-gradient(180deg, #202731 0%, #1d232c 100%);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.24),
    inset 0 1px rgba(255, 255, 255, 0.025);
}

.application-tabs {
  position: absolute;
  bottom: 100%;
  left: -1px;
  display: flex;
  align-items: flex-end;
  width: calc(100% + 2px);
  height: 37px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.application-tabs::-webkit-scrollbar {
  display: none;
}

.application-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  height: 37px;
  padding: 0 15px;
  border: 1px solid #536277;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: linear-gradient(180deg, #303a47 0%, #252d37 100%);
  box-shadow:
    inset 0 2px #6c8eb8,
    0 -4px 12px rgba(0, 0, 0, 0.13);
  color: #eef3f8;
  font-size: 0.98rem;
  font-weight: 720;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.application-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 3px;
  background: #202731;
}

.application-tab-version {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 1px 7px;
  border: 1px solid #586a80;
  border-radius: 999px;
  background: #394555;
  color: #b4c0cc;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

#controls,
#importControls,
#warOverview,
#personalStatus {
  width: min(var(--dashboard-width), 100%);
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

#controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: var(--compact-panel-height);
  padding: 10px 14px;
  overflow: hidden;
  margin-bottom: 0;
}

.top-pull-tabs {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  width: min(var(--dashboard-width), 100%);
  height: 5px;
  margin: -1px 0 8px;
  padding-left: 14px;
  overflow: visible;
  position: relative;
  z-index: 30;
}

.top-pull-tab {
  --top-pull-tab-width: 128px;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--top-pull-tab-width);
  gap: 7px;
  width: var(--top-pull-tab-width);
  min-width: var(--top-pull-tab-width);
  max-width: var(--top-pull-tab-width);
  height: 5px;
  min-height: 5px;
  padding: 0 12px;
  overflow: hidden;
  border: 0;
  border-radius: 0 0 3px 3px;
  background: #536174;
  box-shadow: none;
  color: transparent;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    height 120ms ease,
    min-height 120ms ease,
    padding 120ms ease,
    background 120ms ease,
    border-color 120ms ease,
    color 80ms ease,
    box-shadow 120ms ease;
}

.top-pull-tab:hover,
.top-pull-tab:focus-visible {
  z-index: 2;
  height: 32px;
  min-height: 32px;
  padding: 6px 12px 7px;
  border: 1px solid #607086;
  border-top: 0;
  border-radius: 0 0 7px 7px;
  border-color: #607086;
  background: #3a4655;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.26);
  color: #eef3f8;
}

.top-pull-tab[aria-expanded="true"] {
  background: #7187a3;
}

.top-pull-tab:focus-visible {
  outline: 2px solid rgba(94, 143, 216, 0.78);
  outline-offset: 2px;
}

.top-pull-tab-label,
.top-pull-tab-arrow {
  opacity: 0;
  transition: opacity 80ms ease;
}

.top-pull-tab:hover .top-pull-tab-label,
.top-pull-tab:hover .top-pull-tab-arrow,
.top-pull-tab:focus-visible .top-pull-tab-label,
.top-pull-tab:focus-visible .top-pull-tab-arrow {
  opacity: 1;
}

.top-pull-tab-arrow {
  display: inline-block;
  color: #9eabb8;
  font-size: 0.76rem;
  line-height: 1;
  transition: transform 140ms ease;
}

.top-pull-tab[aria-expanded="true"] .top-pull-tab-arrow {
  transform: rotate(180deg);
}

.dashboard-pull-panel[hidden] {
  display: none;
}

#warOverview {
  padding: 9px 12px;
}

.war-overview-card {
  position: relative;
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 102px;
  padding: 10px 14px 11px;
  overflow: visible;
  border: 1px solid #465465;
  border-left: 3px solid #8c9060;
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 251, 216, 0.045), transparent 48%),
    linear-gradient(180deg, #202833 0%, #1b222b 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.025),
    0 6px 16px rgba(0, 0, 0, 0.13);
}

.war-overview-state {
  display: grid;
  place-items: center;
  min-height: 80px;
  padding: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.war-overview-state[data-state="error"] {
  color: #d8a1a3;
}

.war-overview-content {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.war-overview-content[hidden],
.war-overview-state[hidden] {
  display: none;
}

.war-overview-header,
.war-overview-scores,
.war-overview-footer {
  display: grid;
  align-items: center;
  min-width: 0;
}

.war-overview-header {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.82fr) minmax(0, 1fr);
  gap: 12px;
}

.war-faction-link {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(0.78rem, min(1.15vw, 13.2px), 0.91rem);
  font-weight: 720;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.war-faction-link:hover,
.war-faction-link:focus-visible {
  text-decoration: underline;
}

.war-faction-opponent {
  color: #dc7772;
  text-align: left;
}

.war-faction-user {
  color: #74c393;
  text-align: right;
}

.war-lead-summary {
  grid-column: 2;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  color: #fffbd8;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: 0.025em;
  line-height: 1;
  white-space: nowrap;
}

.war-lead-summary.leader-opponent {
  justify-self: start;
}

.war-lead-summary.leader-user {
  justify-self: end;
}

.war-lead-summary.leader-tied {
  justify-self: center;
}

.war-lead-label {
  color: #fffbd8;
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.war-overview-scores {
  grid-template-columns: minmax(44px, auto) minmax(150px, 1fr) minmax(44px, auto);
  gap: 11px;
}

.war-score {
  min-width: 0;
  font-size: clamp(1rem, min(1.65vw, 18.93px), 1.22rem);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.war-score-opponent {
  color: #dc7772;
  text-align: left;
}

.war-score-user {
  color: #74c393;
  text-align: right;
}

.war-balance-track {
  --war-position: 50%;
  --war-color: #d7c76e;
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 8px;
  padding: 0;
  overflow: visible;
  border: 1px solid #4a5664;
  border-radius: 999px;
  background: linear-gradient(90deg, #8f4546 0%, #d7c76e 50%, #397954 100%);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.16);
  cursor: help;
  transform: none;
}

.war-balance-track:hover,
.war-balance-track:active {
  background: linear-gradient(90deg, #a24f4f 0%, #e1d17a 50%, #438a61 100%);
  transform: none;
}

.war-balance-track:disabled,
.war-balance-track:disabled:hover {
  background: linear-gradient(90deg, #8f4546 0%, #d7c76e 50%, #397954 100%);
  cursor: help;
  opacity: 0.52;
}

.war-balance-center {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.36);
  transform: translateX(-50%);
}

.war-balance-progress {
  position: absolute;
  top: 1px;
  height: 4px;
  border-radius: 999px;
  background: var(--war-color);
  opacity: 0.94;
  box-shadow: 0 0 7px color-mix(in srgb, var(--war-color) 48%, transparent);
}

.war-balance-marker {
  position: absolute;
  top: 50%;
  left: var(--war-position);
  width: 13px;
  height: 13px;
  border: 2px solid #e8edf2;
  border-radius: 50%;
  background: var(--war-color);
  box-shadow:
    0 0 0 2px rgba(16, 21, 27, 0.65),
    0 2px 8px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}

.war-balance-track::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 120;
  bottom: calc(100% + 10px);
  left: 50%;
  width: max-content;
  max-width: min(360px, 86vw);
  padding: 6px 9px;
  pointer-events: none;
  border: 1px solid #556477;
  border-radius: 6px;
  background: #10161d;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.38);
  color: #e1e7ed;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0;
  text-align: center;
  transform: translate(-50%, 3px);
  transition: opacity 100ms ease, transform 100ms ease;
  white-space: normal;
}

.war-balance-track:hover::after,
.war-balance-track:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.war-balance-track:focus-visible {
  outline: 2px solid rgba(94, 143, 216, 0.72);
  outline-offset: 4px;
}

.war-overview-footer {
  grid-template-columns: minmax(115px, 1fr) minmax(155px, 1.22fr) minmax(115px, 1fr);
  gap: 12px;
}

.war-chain {
  min-width: 0;
  overflow: hidden;
  color: #cbd4dd;
  font-size: clamp(0.66rem, min(1vw, 11.47px), 0.78rem);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1;
  text-overflow: clip;
  white-space: nowrap;
}

.war-chain-opponent {
  text-align: left;
}

.war-chain-user {
  text-align: right;
}

.war-overview-partial {
  color: #c2ad76;
  font-size: 0.66rem;
  text-align: center;
  white-space: nowrap;
}

.api-key-control {
  display: flex;
  align-items: center;
  flex: 0 1 260px;
  gap: 5px;
  min-width: 170px;
  white-space: nowrap;
}

.api-key-label {
  color: var(--text);
  text-decoration: none;
}

.api-key-label:hover,
.api-key-label:focus-visible {
  color: var(--blue-hover);
  text-decoration: underline;
}

#apiKey,
#targetImport,
#chainSaveImport {
  border: 1px solid #465465;
  border-radius: 6px;
  outline: none;
  background: var(--field);
  color: var(--text);
}

#apiKey:focus,
#targetImport:focus,
#chainSaveImport:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(94, 143, 216, 0.18);
}

#apiKey {
  width: 100%;
  min-width: 100px;
  margin-left: 0;
  padding: 7px 9px;
}

#cloudLoginButton,
#refreshStatusButton {
  flex: 0 0 auto;
  white-space: nowrap;
}

.status-refresh-button.status-refresh-cancel {
  border-color: #505b68;
  background: #3a424d;
  color: #aab3bd;
}

.status-refresh-button.status-refresh-cancel:hover {
  background: #454e5a;
}

#targetImport,
#chainSaveImport {
  display: block;
  width: 100%;
  height: 150px;
  margin: 8px 0 10px;
  padding: 10px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

button {
  padding: 7px 13px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}

button:hover {
  background: var(--blue-hover);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

button:disabled:hover {
  background: var(--blue);
}

.cloud-login-button.cloud-authenticated {
  background: #3d805f;
}

.cloud-login-button.cloud-authenticated:hover {
  background: #4b9872;
}

.auto-update-control {
  display: inline-flex;
  align-items: center;
  flex: 0 1 142px;
  gap: 7px;
  min-width: 45px;
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.auto-update-stack {
  display: flex;
  flex: 1 1 184px;
  flex-direction: column;
  justify-content: center;
  min-width: 184px;
  overflow: hidden;
}

.auto-update-stack .auto-update-control {
  flex: 0 1 auto;
}

.auto-update-toggle-area,
.war-mode-toggle-area {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  cursor: pointer;
}

.auto-update-mode-button {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.auto-update-mode-button:hover,
.auto-update-mode-button:focus-visible,
.auto-update-mode-button:active {
  background: transparent;
  transform: none;
}

.auto-update-mode-button:focus-visible .auto-update-switch {
  box-shadow: 0 0 0 3px rgba(94, 143, 216, 0.28);
}

.auto-update-mode-button .auto-update-switch {
  flex-basis: 51px;
  width: 51px;
}

.auto-update-mode-button[data-mode="timers"] .auto-update-switch {
  border-color: #8c9060;
  background: #65673f;
}

.auto-update-mode-button[data-mode="timers"] .auto-update-switch::before {
  background: #fffbd8;
  transform: translateX(15px);
}

.auto-update-mode-button[data-mode="auto"] .auto-update-switch {
  border-color: #4fa878;
  background: #32694e;
}

.auto-update-mode-button[data-mode="auto"] .auto-update-switch::before {
  background: #e9fff2;
  transform: translateX(30px);
}

.control-info-button {
  flex: 0 0 auto;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  line-height: 1;
}

.control-info-button:hover,
.control-info-button:focus-visible {
  background: transparent;
  color: var(--text);
}

.auto-update-switch {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 21px;
  border: 1px solid #536174;
  border-radius: 999px;
  background: #343e4b;
  transition: background 140ms ease, border-color 140ms ease;
}

.auto-update-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #aeb8c4;
  transition: transform 140ms ease, background 140ms ease;
}

.auto-update-info {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.auto-update-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.auto-update-label-short {
  display: none;
}

.war-mode-control {
  display: none;
}

.notification-controls {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
}

.notification-next-row {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 5px;
  min-width: 0;
  margin-left: auto;
}

.notification-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  overflow: visible;
  border: 1px solid #465465;
  border-radius: 6px;
  background: linear-gradient(#343b44, #222831);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.35);
  color: #7f8994;
  text-decoration: none;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.notification-button:hover {
  border-color: #596879;
  background: linear-gradient(#3c4550, #29313b);
  color: #aab5c0;
}

.notification-button.notification-active {
  color: #a7c83d;
}

.notification-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: #a7c83d;
  box-shadow: 0 0 0 2px var(--panel);
  color: #20260f;
  font-size: 0.62rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 15px;
  text-align: center;
}

.notification-badge[hidden] {
  display: none;
}

.import-help {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9em;
}

.import-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}

.import-action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.sync-button {
  padding: 5px 10px;
  font-size: 0.85rem;
}

.cloud-sync-status {
  flex: 1 1 220px;
  min-width: 140px;
  min-height: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.cloud-sync-status.sync-success {
  color: #82c99d;
}

.cloud-sync-status.sync-error {
  color: #e69292;
}

#importControls {
  padding: 10px 14px;
}

.secondary-button {
  padding: 5px 10px;
  border: 1px solid #536174;
  background: #343e4b;
  color: var(--text);
  font-size: 0.85rem;
}

.secondary-button:hover {
  background: #445164;
}

#personalStatus {
  min-height: var(--compact-panel-height);
  padding: 0 14px;
  overflow: hidden;
}

.personal-status-header {
  display: block;
  min-height: calc(var(--compact-panel-height) - 2px);
  padding: 7px 0;
}

.personal-bars {
  display: grid;
  align-content: center;
  gap: 3px;
  width: 100%;
  min-width: 0;
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid #465465;
  border-left: 3px solid #7187d9;
  border-radius: 6px;
  background: #1c232c;
}

.personal-bars[hidden] {
  display: none;
}

.personal-bar-row {
  display: grid;
  grid-template-columns: clamp(30px, min(3.1vw, 35.588px), 40px) minmax(18px, 1fr) minmax(42px, auto);
  align-items: center;
  gap: clamp(3px, min(0.45vw, 5.166px), 6px);
  min-width: 0;
  font-size: clamp(0.5rem, min(0.72vw, 8.266px), 0.58rem);
  line-height: 1;
}

.personal-bar-label {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.personal-bar-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #11161c;
  box-shadow: inset 0 0 0 1px #3d4856;
}

.personal-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.personal-bar-fill-life {
  background: #7187d9;
}

.personal-bar-fill-energy {
  background: #73a82c;
}

.personal-bar-fill-nerve {
  background: #d4562b;
}

.personal-bar-value {
  min-width: 0;
  overflow: hidden;
  color: #dce3ea;
  font-size: clamp(0.5rem, min(0.72vw, 8.266px), 0.58rem);
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: clip;
  white-space: nowrap;
}

#personalStatusHint,
#personalStatusUpdated {
  color: var(--muted);
  font-size: 0.8rem;
}

#personalStatusBody {
  display: block;
  width: 100%;
  min-width: 0;
}

#personalStatusBody[hidden] {
  display: none;
}

.personal-status-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.personal-status-card {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(3px, min(0.65vw, 7.462px), 10px);
  width: 100%;
  min-width: 0;
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  padding: 6px clamp(6px, min(0.85vw, 9.758px), 12px);
  overflow: hidden;
  border: 1px solid #465465;
  border-left: 3px solid var(--card-accent);
  border-radius: 6px;
  background: #1c232c;
}

.personal-status-card-drug {
  --card-accent: #7289da;
}

.personal-status-card-medical {
  --card-accent: #e0b45c;
}

.personal-status-card-hospital {
  --card-accent: #d96a74;
}

.personal-status-card-chain {
  --card-accent: #68a9bd;
}

.personal-status-card-location {
  --card-accent: #65b6b5;
}

.next-target-card {
  --card-accent: #657180;
  flex: 0 0 auto;
  width: auto;
  min-width: 148px;
  height: auto;
  min-height: 0;
  max-height: none;
  margin-left: 0;
  padding: 6px 10px;
  overflow: visible;
}

.next-target-card-ready {
  --card-accent: #57d68d;
}

.next-target-card-warning {
  --card-accent: #f2bd59;
}

.next-target-card-critical {
  --card-accent: #ad3641;
}

.next-target-card.next-target-card-clickable {
  cursor: pointer;
}

.next-target-card.next-target-card-clickable:hover,
.next-target-card.next-target-card-clickable:focus-visible {
  border-color: #6587b7;
  background: #222c37;
  outline: none;
}

.personal-status-card[hidden] {
  display: none;
}

.status-card-title-group {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.status-card-title-text {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(0.58rem, min(0.88vw, 10.102px), 0.7rem);
  font-weight: 700;
  letter-spacing: 0.025em;
  text-overflow: clip;
  text-transform: uppercase;
  white-space: nowrap;
}

.timer-notification-bell {
  display: none;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  overflow: visible;
  fill: #8c99a8;
}

.timer-notification-bell.timer-notification-bell-enabled {
  display: block;
}

.timer-notification-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  gap: 4px;
  min-width: 0;
  overflow: visible;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
}

.timer-notification-indicator .personal-timer {
  flex: 0 1 auto;
  overflow: visible;
  font-size: clamp(0.68rem, min(1.25vw, 14.35px), 0.92rem);
  font-weight: 600;
  text-transform: none;
}

.app-toast-region {
  position: fixed;
  z-index: 10000;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 13px;
  border: 1px solid #4d5b6b;
  border-left: 3px solid #6e91c8;
  border-radius: 7px;
  background: #202832;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.38);
  color: #e2e8ee;
  font-size: 0.84rem;
  line-height: 1.35;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease;
}

.app-toast-region.app-toast-success {
  border-left-color: #57d68d;
}

.app-toast-region.app-toast-warning {
  border-left-color: #f2bd59;
}

.app-toast-region[hidden] {
  display: none;
}

.status-card-link {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(0.58rem, min(0.88vw, 10.102px), 0.7rem);
  font-weight: 700;
  letter-spacing: 0.025em;
  text-overflow: clip;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-card-link:hover {
  color: #c8d8e7;
}

.personal-timer {
  min-width: 0;
  overflow: hidden;
  color: #eef3f8;
  font-size: clamp(0.68rem, min(1.25vw, 14.35px), 0.92rem);
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: clip;
  white-space: nowrap;
}

.timer-notification-toggle {
  cursor: pointer;
}

.timer-notification-toggle:focus-visible {
  border-radius: 3px;
  outline: 2px solid rgba(94, 143, 216, 0.75);
  outline-offset: 3px;
}

.personal-timer-ready {
  color: #57d68d;
}

.personal-timer-error {
  color: var(--danger);
}

#factionChainStatus span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
}

#factionChainStatus .hospital-time-critical {
  color: #ad3641;
}

.personal-location-value {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 3px;
  max-width: 62%;
  text-align: right;
}

#personalLocationStatus span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  line-height: 1.05;
  text-transform: none;
}

#personalLocationDestination {
  color: #9fe0df !important;
}

#personalLocationTimer {
  color: #eef3f8 !important;
  font-size: 0.72rem !important;
  font-variant-numeric: tabular-nums;
}

#personalLocationTimer.hospital-time-critical {
  color: #ad3641 !important;
}

#personalStatusUpdated {
  display: none;
}

#importResult,
#chainSaveImportResult {
  margin-left: 8px;
  color: var(--muted);
}

#lastUpdated {
  flex: 0 1 auto;
  overflow: hidden;
  color: #8793a0;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-error {
  color: #ff9299 !important;
}

.table-layout {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: min(calc(var(--dashboard-width) + 46px), 100%);
}

.table-wrap {
  flex: 1 1 var(--dashboard-width);
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.table-side-refresh {
  align-self: stretch;
  flex: 0 0 38px;
  width: 38px;
  min-height: 100%;
  padding: 12px 7px;
  border: 1px solid #6f9cda;
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.table-side-refresh span {
  display: inline-block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.chain-save-section {
  width: min(var(--dashboard-width), 100%);
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.chain-save-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--compact-panel-height);
  padding: 9px 14px;
}

.chain-save-title {
  margin-right: auto;
  color: #eef3f8;
  font-size: 0.92rem;
}

.chain-save-table-body {
  border-top: 1px solid var(--border);
}

.chain-save-table-body[hidden] {
  display: none;
}

.chain-save-table-wrap {
  overflow-x: auto;
}

.target-table {
  table-layout: fixed;
}

.target-table .column-name {
  width: 18%;
}

.target-table .column-level,
.target-table .column-age,
.target-table .column-attack,
.target-table .column-remove {
  width: 7%;
}

.target-table .column-stats {
  width: 12%;
}

.target-table .column-location {
  width: 15%;
}

.target-table .column-status {
  width: 27%;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
}

.sortable-header:hover,
.sortable-header:focus-visible {
  color: #eef3f8;
  background: #303a47;
}

.sort-arrow {
  display: inline-block;
  width: 0.8em;
  margin-left: 3px;
  color: #8fb4e7;
}

#chainSaveLastUpdated {
  color: #8793a0;
  font-size: 0.7rem;
  white-space: nowrap;
}

.chain-save-import-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.chain-save-import-title {
  display: block;
  margin-bottom: 4px;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

table th,
table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #343e4b;
  color: #f0f3f6;
  font-size: 0.82rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

tbody tr {
  background: var(--panel);
  transition: background 120ms ease;
}

tbody tr:nth-child(even) {
  background: var(--panel-alt);
}

tbody tr:hover {
  background: #303b48;
}

tbody tr:last-child td {
  border-bottom: 0;
}

a {
  color: #78acec;
  text-decoration: none;
}

a:hover {
  color: #a8cbf5;
  text-decoration: underline;
}

.attack-cell,
.remove-cell {
  width: 64px;
  padding: 4px 9px;
  text-align: center !important;
  vertical-align: middle;
}

.attack-header,
.remove-header {
  width: 64px;
  text-align: center;
}

.attack-button {
  display: flex;
  width: 36px;
  height: 36px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 6px;
  vertical-align: middle;
  transition: filter 120ms ease, transform 120ms ease;
}

.attack-button img {
  display: block;
  width: 100%;
  height: 100%;
}

.attack-button:hover {
  filter: brightness(1.16);
  text-decoration: none;
  transform: translateY(-1px);
}

.attack-button:focus-visible {
  outline: 2px solid var(--blue-hover);
  outline-offset: 2px;
}

.stats-cell.has-stat-details {
  cursor: help;
  text-decoration: underline dotted #73849a;
  text-underline-offset: 4px;
}

.stats-inline-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 28px;
  margin: -4px 0;
  padding: 3px 6px;
  border: 1px solid #6f9cda;
  border-radius: 4px;
  outline: none;
  background: #171c23;
  color: inherit;
  font: inherit;
  font-variant-numeric: inherit;
}

.stats-inline-input:focus {
  border-color: #8bb8f2;
  box-shadow: 0 0 0 2px rgba(94, 143, 216, 0.2);
}

.stats-tooltip {
  position: fixed;
  z-index: 1000;
  min-width: 175px;
  padding: 10px 12px;
  border: 1px solid #566579;
  border-radius: 7px;
  background: #121820;
  color: #e7edf3;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
  white-space: pre-line;
  pointer-events: none;
  animation: stats-tooltip-in 80ms ease-out;
}

.stats-tooltip[hidden] {
  display: none;
}

@keyframes stats-tooltip-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status {
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-green {
  color: #57d68d;
}

.status-red {
  color: #ff747d;
}

.status-orange {
  color: #f2bd59;
}

.status-travel {
  color: #8fd5d2;
}

.status-gray {
  color: #98a5b2;
}

.location-different {
  color: #697583;
}

.hospital-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hospital-status-short {
  display: none;
}

.hospital-time-warning {
  color: #f2bd59;
}

.hospital-time-critical {
  color: #ad3641;
}

.player-name {
  font-weight: 700;
}

.target-life-indicator {
  width: 96px;
  max-width: 100%;
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border: 1px solid #3d4855;
  border-radius: 999px;
  background: #151b22;
}

.target-life-indicator[hidden] {
  display: none;
}

.target-life-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #4fa878;
  transition: width 160ms ease;
}

.target-life-fill.target-life-medium {
  background: #c89b45;
}

.target-life-fill.target-life-low {
  background: #a9434e;
}

.activity-offline {
  color: #aeb8c4;
}

.activity-afk {
  color: #e5d48a;
}

.activity-online {
  color: #57d68d;
}

.remove-target {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  margin: 0 auto;
  padding: 0;
  border: 1px solid #74434a;
  background: #3a272c;
  color: var(--danger);
  font-size: 18px;
  line-height: 1;
}

.remove-target:hover {
  background: #563139;
}

@media (min-width: 761px) {
  body {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .application-shell {
    flex: 1 1 auto;
    min-height: 0;
  }

  .desktop-fixed-top {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }

  .desktop-scroll-content {
    flex: 1 1 auto;
    width: min(calc(var(--dashboard-width) + 46px), 100%);
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .desktop-scroll-content::-webkit-scrollbar {
    display: none;
  }

  .desktop-scroll-content .table-layout {
    width: 100%;
  }
}

@media (max-width: 760px) {
  html {
    overflow-x: hidden;
  }

  body {
    padding: max(10px, env(safe-area-inset-top))
      0
      max(12px, env(safe-area-inset-bottom))
      0;
    font-size: 14px;
  }

  .application-shell {
    width: 100%;
    margin-top: 34px;
    padding: 8px 0 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .application-tabs {
    left: 0;
    width: 100%;
    height: 35px;
  }

  .application-tab {
    height: 35px;
    padding-inline: 12px;
    font-size: 0.9rem;
  }

  .application-tab-version {
    min-height: 18px;
    padding-inline: 6px;
    font-size: 0.64rem;
  }

  .auto-update-label-long {
    display: none;
  }

  .auto-update-label-short {
    display: inline;
  }

  #controls,
  #importControls,
  #warOverview,
  #personalStatus,
  .top-pull-tabs,
  .table-layout,
  .chain-save-section {
    width: 100%;
    margin-bottom: 10px;
  }

  #controls {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-areas:
      "api api api login login login"
      "refresh refresh autoupdate autoupdate war war"
      "notification-next notification-next notification-next notification-next notification-next notification-next";
    gap: 9px;
    margin-bottom: 0;
    padding: 11px;
  }

  .top-pull-tabs {
    gap: 6px;
    height: 6px;
    margin-top: -1px;
    margin-bottom: 8px;
    padding-left: 0;
  }

  .top-pull-tab {
    flex: 1 1 0;
    width: 33.333%;
    min-width: 0;
    max-width: none;
    height: 6px;
    min-height: 6px;
    padding: 0;
    overflow: visible;
    font-size: 0.84rem;
  }

  .top-pull-tab::before {
    content: "";
    position: absolute;
    inset: -8px 0 -18px;
  }

  .top-pull-tab:hover,
  .top-pull-tab:focus-visible {
    height: 32px;
    min-height: 32px;
    padding: 6px 8px 7px;
  }

  .api-key-control {
    display: block;
    grid-area: api;
    width: 100%;
    min-width: 0;
  }

  .api-key-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  #apiKey {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  #cloudLoginButton {
    grid-area: login;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #refreshStatusButton {
    grid-area: refresh;
  }

  #controls > button,
  .auto-update-control {
    min-height: 42px;
  }

  #controls > button {
    width: 100%;
  }

  .import-heading {
    align-items: center;
    flex-wrap: nowrap;
  }

  .import-heading > label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .import-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
  }

  .import-action-row button {
    width: 100%;
    min-width: 0;
    padding-inline: 6px;
    white-space: nowrap;
  }

  .import-action-row .cloud-sync-status {
    grid-column: 1 / -1;
    min-width: 0;
    text-align: center;
  }

  .auto-update-control {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    padding: 6px 8px;
    border: 1px solid #465465;
    border-radius: 6px;
    background: #1c232c;
  }

  .auto-update-stack {
    grid-area: autoupdate;
    width: 100%;
    min-width: 0;
  }

  .auto-update-toggle-area,
  .war-mode-toggle-area {
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  .auto-update-control .control-info-button,
  .war-mode-control .control-info-button {
    width: 38px !important;
    height: 100%;
    min-height: 30px;
    border: 0;
    border-radius: 4px;
  }

  .war-mode-control {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) 38px;
    grid-area: war;
    gap: 7px;
    min-width: 0;
    min-height: 42px;
    padding: 6px 8px;
    overflow: hidden;
    border: 1px solid #465465;
    border-radius: 6px;
    background: #1c232c;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .war-mode-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  .war-mode-control input:checked + .auto-update-switch {
    border-color: #4fa878;
    background: #32694e;
  }

  .war-mode-control input:checked + .auto-update-switch::before {
    background: #e9fff2;
    transform: translateX(17px);
  }

  .war-mode-info {
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1;
  }

  .war-mode-info:hover {
    background: transparent;
    color: var(--text);
  }

  #lastUpdated { display: none; }

  .notification-next-row {
    display: flex;
    align-items: stretch;
    grid-area: notification-next;
    gap: 9px;
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  .notification-controls {
    justify-content: center;
    flex: 0 0 auto;
    min-height: 42px;
  }

  .next-target-card {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 42px;
    margin-left: 0;
  }

  .next-target-card > span {
    font-size: 0.72rem;
  }

  .next-target-card .status-card-title-text {
    font-size: 0.72rem;
  }

  .next-target-card .personal-timer {
    font-size: 0.92rem;
  }

  #importControls {
    padding: 10px 11px;
  }

  #targetImport,
  #chainSaveImport {
    height: 120px;
    font-size: 16px;
  }

  button,
  input {
    min-height: 40px;
  }

  .secondary-button {
    min-height: 36px;
  }

  #personalStatus {
    padding: 8px 10px;
  }

  #warOverview {
    padding: 7px;
  }

  .war-overview-card {
    gap: 6px;
    min-height: 94px;
    padding: 9px 8px 10px;
    border-radius: 6px;
  }

  .war-overview-state {
    min-height: 70px;
    padding: 8px;
    font-size: 0.76rem;
  }

  .war-overview-content {
    gap: 6px;
  }

  .war-overview-header {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.8fr) minmax(0, 1fr);
    gap: 5px;
  }

  .war-faction-link {
    font-size: clamp(0.62rem, 3vw, 0.78rem);
  }

  .war-lead-summary {
    gap: 3px;
    font-size: clamp(0.54rem, 2.5vw, 0.66rem);
    letter-spacing: 0;
  }

  .war-lead-label {
    font-size: clamp(0.49rem, 2.25vw, 0.58rem);
    letter-spacing: 0.045em;
  }

  .war-overview-scores {
    grid-template-columns: minmax(38px, auto) minmax(92px, 1fr) minmax(38px, auto);
    gap: 7px;
  }

  .war-score {
    font-size: clamp(0.82rem, 4vw, 1.05rem);
  }

  .war-balance-track {
    min-height: 0;
    height: 7px;
  }

  .war-balance-marker {
    width: 12px;
    height: 12px;
  }

  .war-overview-footer {
    grid-template-columns: minmax(0, 1fr) minmax(80px, 1.08fr) minmax(0, 1fr);
    gap: 7px;
  }

  .war-chain {
    font-size: clamp(0.54rem, 2.65vw, 0.7rem);
  }

  .war-overview-partial {
    font-size: clamp(0.5rem, 2.2vw, 0.62rem);
  }

  .personal-status-header {
    padding: 0;
  }

  #personalStatusHint {
    padding: 4px 2px;
    text-align: center;
  }

  .personal-bars {
    width: 100%;
    min-width: 0;
    height: 58px;
    padding: 7px 8px;
    gap: 3px;
  }

  .personal-bar-row {
    grid-template-columns: clamp(30px, 10vw, 44px) minmax(12px, 1fr) minmax(38px, auto);
    gap: clamp(3px, 1vw, 6px);
    font-size: 0.65rem;
  }

  .personal-bar-value {
    font-size: 0.65rem;
  }

  .personal-bar-track {
    width: 100%;
    height: 6px;
  }

  #personalStatusBody {
    order: initial;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .personal-status-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .personal-status-cards .personal-status-card {
    width: 100%;
    height: 58px;
    min-height: 58px;
    max-height: 58px;
    padding: 6px 9px;
  }

  .personal-status-cards .status-card-link,
  .personal-status-cards .status-card-title-text {
    font-size: 0.72rem;
  }

  .personal-status-cards .personal-timer {
    font-size: 0.92rem;
  }

  #personalLocationTimer {
    font-size: 0.78rem !important;
  }

  .timer-notification-toggle {
    cursor: default;
  }

  .table-layout {
    display: flex;
    align-items: stretch;
    gap: 6px;
  }

  .table-wrap {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .table-side-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    min-height: 100%;
    padding: 8px 4px;
    font-size: 0.72rem;
  }

  .table-wrap,
  .chain-save-table-wrap {
    overflow: visible;
  }

  .target-table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  .target-table colgroup,
  .target-table thead {
    display: none;
  }

  .target-table tbody {
    display: grid;
    gap: 8px;
    padding: 8px;
    background: #171c23;
  }

  .target-table tbody:empty::after {
    content: "No targets added";
    padding: 18px 10px;
    color: var(--muted);
    text-align: center;
  }

  .target-table tbody tr {
    display: grid;
    grid-template-columns:
      minmax(0, 1.25fr)
      minmax(0, 0.75fr)
      minmax(0, 1.55fr)
      40px;
    grid-template-areas:
      "name location status attack"
      "stats level age remove";
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  }

  .target-table tbody tr:nth-child(even) {
    background: var(--panel-alt);
  }

  .target-table tbody td {
    min-width: 0;
    padding: 5px 6px;
    border-bottom: 0;
    white-space: normal;
    font-size: clamp(0.58rem, 2.75vw, 0.72rem);
  }

  .target-table tbody td::before {
    display: block;
    margin-bottom: 1px;
    color: #7f8c9a;
    font-size: clamp(0.47rem, 2.05vw, 0.54rem);
    font-weight: 700;
    letter-spacing: 0.045em;
  }

  .target-table tbody td:nth-child(1) {
    grid-area: name;
    overflow: hidden;
    padding: 6px 7px;
    border-bottom: 1px solid var(--border);
    font-size: clamp(0.74rem, 3.35vw, 0.88rem);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .target-table tbody td:nth-child(1) a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .target-life-indicator {
    width: min(88px, 92%);
    height: 4px;
    margin-top: 4px;
  }

  .target-table tbody td:nth-child(2) {
    grid-area: level;
  }

  .target-table tbody td:nth-child(2)::before {
    content: "LEVEL";
  }

  .target-table tbody td:nth-child(3) {
    grid-area: age;
  }

  .target-table tbody td:nth-child(3)::before {
    content: "AGE";
  }

  .target-table tbody td:nth-child(4) {
    grid-area: stats;
  }

  .target-table tbody td:nth-child(4)::before {
    content: "STATS";
  }

  .target-table tbody td:nth-child(5) {
    grid-area: location;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .target-table tbody td:nth-child(5)::before {
    content: "LOCATION";
  }

  .target-table tbody td:nth-child(6) {
    grid-area: status;
    overflow: visible;
    border-bottom: 1px solid var(--border);
    font-size: clamp(0.5rem, 2.35vw, 0.68rem);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .target-table tbody td:nth-child(6)::before {
    content: "STATUS";
  }

  .target-table tbody td:nth-child(7) {
    grid-area: attack;
  }

  .target-table tbody td:nth-child(8) {
    grid-area: remove;
  }

  .target-table .attack-cell,
  .target-table .remove-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 2px;
    border-left: 1px solid var(--border);
  }

  .target-table .attack-cell {
    border-bottom: 1px solid var(--border);
  }

  .target-table .remove-cell {
    border-top: 0;
  }

  .target-table .status {
    white-space: nowrap;
  }

  .target-table .remove-target {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-color: #74434a;
    background: #3a272c;
    color: var(--danger);
    font-size: 18px;
  }

  .target-table .remove-target:hover,
  .target-table .remove-target:focus-visible {
    border-color: #74434a;
    background: #3a272c;
    color: var(--danger);
  }

  .hospital-status-long {
    display: none;
  }

  .hospital-status-short {
    display: inline;
  }

  .stats-inline-input {
    height: 32px;
    margin: 0;
    padding: 3px 5px;
    font-size: 16px;
  }

  .chain-save-section {
    margin-top: 10px;
  }

  .chain-save-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px;
    padding: 9px 10px;
  }

  .chain-save-title {
    min-width: 0;
  }

  #chainSaveLastUpdated {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: center;
    white-space: normal;
  }

  #importResult,
  #chainSaveImportResult {
    display: block;
    margin: 9px 0 0;
  }
}

@media (max-width: 380px) {
  .personal-status-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .target-table tbody tr {
    grid-template-columns:
      minmax(0, 1.2fr)
      minmax(0, 0.7fr)
      minmax(0, 1.6fr)
      36px;
  }

  .attack-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .target-table .remove-target {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }
}

@media (max-width: 430px) {
  .auto-update-label-long {
    display: none;
  }

  .auto-update-label-short {
    display: inline;
  }

  .auto-update-control,
  .war-mode-control {
    gap: 5px;
    padding-inline: 5px;
    font-size: 0.8rem;
  }

  .war-mode-info { display: block; }
}
