:root {
  color-scheme: light;
  --bg: #f5f1ea;
  --panel: #ffffff;
  --ink: #1f2428;
  --muted: #5c6268;
  --accent: #0d6f7b;
  --accent-strong: #0b3f47;
  --warn: #b5472f;
  --border: #e3ddd4;
  --shadow: 0 18px 45px rgba(15, 20, 26, 0.08);
  --unit-def-bg: #e6f5ea;
  --unit-off-bg: #fde8e8;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  background: radial-gradient(circle at top right, #fbe7c7, #f5f1ea 55%, #f1ebe0);
  color: var(--ink);
  min-height: 100vh;
  scrollbar-gutter: stable;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  margin: 0;
  color: var(--muted);
}

.subtle {
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2.5rem 6vw 1rem;
  gap: 1.5rem;
}

.topbar-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.dashboard {
  padding: 0 6vw 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tab-bar {
  display: flex;
  gap: 0.6rem;
  padding: 0 6vw 1rem;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--accent-strong);
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 20, 26, 0.08);
}

.tab.active {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
}

.hero-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.ingest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

code {
  background: #f0f6f7;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 0.9rem;
  display: inline-block;
  word-break: break-all;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.share-form {
  display: grid;
  gap: 0.85rem;
}

.share-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.share-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.share-item:last-child {
  border-bottom: none;
}

.share-meta {
  display: grid;
  gap: 0.2rem;
}

.share-title {
  font-weight: 600;
  color: var(--accent-strong);
}

.share-tag {
  font-size: 0.78rem;
  color: var(--muted);
}

.share-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card,
.table-card,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.3rem;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.defense-header {
  align-items: flex-start;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
}

.filter-chip {
  position: relative;
}

.filter-chip summary {
  list-style: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--accent-strong);
  padding: 0.45rem 0.95rem;
  height: 38px;
  border-radius: 14px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 8px 18px rgba(15, 20, 26, 0.06);
  white-space: nowrap;
}

.filter-chip.toggle {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--accent-strong);
  padding: 0.45rem 0.95rem;
  height: 38px;
  border-radius: 14px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 8px 18px rgba(15, 20, 26, 0.06);
  white-space: nowrap;
}

.filter-chip.toggle.active {
  background: #c7a97a;
  color: #ffffff;
  border-color: transparent;
}

.filter-chip summary::-webkit-details-marker {
  display: none;
}

.filter-chip summary::after {
  content: "▾";
  font-size: 0.7rem;
  color: var(--muted);
}

.filter-chip.active summary {
  background: #c7a97a;
  color: #ffffff;
  border-color: transparent;
}

.filter-chip.active summary::after {
  color: #ffffff;
}

.filter-chip.active .filter-summary-input,
.filter-chip.static.active .filter-summary-input {
  background: #c7a97a;
  color: #ffffff;
  border-color: transparent;
}

.filter-chip.active .filter-summary-input input[type="text"] {
  color: #ffffff;
}

.filter-chip.active .filter-summary-input input[type="text"]::placeholder {
  color: #ffffff;
}

.filter-chip.secondary summary {
  background: #f4eee3;
  color: var(--accent-strong);
  border-color: #dfd5c7;
}

.filter-chip.secondary summary::after {
  color: var(--accent-strong);
}

.filter-chip.secondary[open] summary {
  box-shadow: 0 10px 20px rgba(15, 20, 26, 0.12);
}

.filter-summary-input {
  gap: 0.5rem;
}

.filter-chip.static .filter-summary-input {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--accent-strong);
  padding: 0.45rem 0.95rem;
  height: 38px;
  border-radius: 14px;
  font-weight: 500;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  box-shadow: 0 8px 18px rgba(15, 20, 26, 0.06);
}

.filter-chip.secondary.static .filter-summary-input {
  background: #f4eee3;
  border-color: #dfd5c7;
}

.filter-summary-input input[type="number"] {
  width: 4.25rem;
  margin: 0;
  padding: 0.35rem 0.6rem;
  height: 26px;
  border-radius: 12px;
  line-height: 1;
}

.filter-summary-input input[type="text"] {
  width: auto;
  min-width: 50px;
  max-width: 180px;
  margin: 0;
  padding: 0.35rem 0.6rem;
  height: 26px;
  border-radius: 12px;
}

.filter-clear {
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.filter-clear:hover {
  background: rgba(15, 20, 26, 0.08);
}

.filter-chip.active .filter-clear {
  display: inline-flex;
}

.filter-chip.active .filter-clear:hover {
  background: rgba(255, 255, 255, 0.2);
}

.filter-chip.static .filter-summary-input input[type="text"] {
  border-color: transparent;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.filter-chip.static .filter-summary-input input[type="text"]:focus {
  border-color: #dfd5c7;
  background: transparent;
  outline: none;
}

.filter-chip.active .filter-summary-input input[type="text"]:focus {
  border-color: #efe1cb;
  background: transparent;
}

.filter-chip[open] summary {
  box-shadow: 0 14px 26px rgba(15, 20, 26, 0.14);
}

.filter-drawer {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.75rem;
  box-shadow: var(--shadow);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.filter-chip.player .filter-drawer {
  min-width: 260px;
}

.filter-chip.player summary {
  justify-content: center;
  text-align: center;
}

.filter-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.filter-control input,
.filter-control select {
  width: 100%;
  margin-top: 0;
}

.filter-search-input {
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
}

.filter-control select {
  padding: 0.5rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent-strong);
  font-weight: 500;
  cursor: pointer;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.filter-chip.player .filter-list {
  max-height: 400px;
  overflow-y: auto;
}

.filter-chip.player .filter-option {
  display: flex;
  align-items: center;
  min-height: 2rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden-habitat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid var(--border);
  background: #fbf9f4;
  border-radius: 14px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  color: var(--accent-strong);
}

.hidden-habitat-action {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
}

.filter-banner {
  border: 1px dashed #dfd5c7;
  background: #fbf4e6;
  color: var(--accent-strong);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.filter-option {
  border: 1px solid var(--border);
  background: #fbf9f4;
  color: var(--accent-strong);
  border-radius: 14px;
  padding: 0.4rem 0.85rem;
  text-align: left;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
}

.filter-option.active {
  background: #c7a97a;
  color: #ffffff;
  border-color: transparent;
}

.filter-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.filter-select-hidden {
  display: none;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.filter-toggle input[type="checkbox"] {
  accent-color: var(--accent-strong);
}

.rounds-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.rounds-control input {
  width: 5.5rem;
  margin-top: 0;
}

.rounds-control input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent-strong);
}

.rounds-control input[type="datetime-local"] {
  width: 12.5rem;
}

.rounds-control input[type="text"] {
  width: 12rem;
}

.rounds-control select {
  width: 10.5rem;
  margin-top: 0;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent-strong);
  font-weight: 600;
  cursor: pointer;
}

.rounds-action {
  font-size: 0.8rem;
  padding: 0.45rem 0.9rem;
}

.input-group select,
.simulator-toolbar select,
.simulator-side select {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent-strong);
  font-weight: 600;
  cursor: pointer;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-weight: 600;
  color: var(--accent-strong);
}

tr:last-child td {
  border-bottom: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #ecf1f2;
  color: var(--accent-strong);
  font-size: 0.75rem;
}

.pill-unit-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.pill-ellipsis {
  font-weight: 600;
  letter-spacing: 0.08em;
}

.pill-button {
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
}

.pill-button:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.pill-button.active {
  background: var(--accent);
  color: #ffffff;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.unit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin-top: 0.35rem;
}

.unit-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.35rem;
  border-radius: 12px;
  background: #f0f4f5;
  position: relative;
}

.unit-pill--defense {
  background: var(--unit-def-bg);
}

.unit-pill--offense {
  background: var(--unit-off-bg);
}

.unit-pill::after {
  content: attr(data-unit);
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #141414;
  color: #f7f4ee;
  border-radius: 8px;
  padding: 0.2rem 0.45rem;
  font-size: 0.65rem;
  white-space: nowrap;
  z-index: 3;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.unit-pill:hover::after,
.unit-pill:focus-visible::after {
  display: block;
}

.unit-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.unit-count {
  font-size: 0.78rem;
  color: var(--accent-strong);
  font-weight: 600;
}

.accounts-summary-top-grid {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}

.accounts-summary-top-item {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.accounts-summary-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.accounts-summary-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.accounts-summary-top-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.accounts-summary-inline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.habitat-pill {
  gap: 0.25rem;
}

.habitat-icon,
.silver-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.habitat-pill-count {
  font-weight: 600;
}

.habitat-status-row {
  display: grid;
  gap: 0.3rem;
}

.habitat-status-row-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}

.habitat-status-row-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.habitat-status-row.unhandled .habitat-pill {
  background: #f9e8e8;
  border-color: #e9bcbc;
}

.habitat-status-row.handled .habitat-pill {
  background: #e7f4e7;
  border-color: #bbddb9;
}

.silver-pill {
  gap: 0.25rem;
}

.accounts-summary-silver-value {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.silver-value-text {
  line-height: 1;
}

.accounts-summary-pill-list .pill-button {
  user-select: none;
}

.accounts-summary-rows {
  display: grid;
  gap: 0.9rem;
}

.accounts-summary-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfaf7;
  padding: 0.8rem;
  display: grid;
  gap: 0.6rem;
}

.accounts-summary-row-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.accounts-summary-player-title {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.accounts-summary-update {
  font-size: 0.78rem;
}

.accounts-summary-block {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.accounts-summary-capture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.accounts-summary-capture-item {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  padding: 0.45rem 0.5rem;
  display: grid;
  gap: 0.2rem;
  font-size: 0.84rem;
}

.impact-block {
  margin-bottom: 0.75rem;
}

.impact-time {
  font-weight: 600;
  color: var(--accent-strong);
}

.impact-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.impact-header .pill-list {
  margin-top: 0;
}

.impact-details {
  margin-top: 0.6rem;
  margin-bottom: 0.8rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.4rem 0.8rem 0.6rem;
  background: #fbf9f4;
}

.impact-details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 600;
  list-style: none;
}

.impact-details summary::-webkit-details-marker {
  display: none;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.detail-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.detail-row {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.round-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.round-detail {
  position: relative;
  display: inline-flex;
}

.round-detail summary {
  list-style: none;
}

.round-detail summary::-webkit-details-marker {
  display: none;
}

.round-detail[open] .round::after {
  display: none;
}

.round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  line-height: 1.1;
  position: relative;
}

.round-detail.is-active .round {
  border-color: #b07a2a;
  box-shadow:
    0 0 0 2px rgba(176, 122, 42, 0.18),
    0 8px 16px rgba(25, 25, 25, 0.12);
  background: #fff1d6;
}

.round.legend {
  cursor: default;
  min-width: 0;
}

.round.legend::after {
  display: none;
}

.round-detail-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fbf9f4;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.95rem;
  width: max-content;
  min-width: 360px;
  max-width: min(32vw, 720px);
  box-sizing: border-box;
  z-index: 4;
  box-shadow: 0 12px 26px rgba(25, 25, 25, 0.16);
}

.round-detail.night .round-detail-panel {
  background: linear-gradient(135deg, #fbf4e6, #f6f0e1);
  border-color: #d9c9a8;
}

.round-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.round-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.round-detail-caption {
  font-size: 0.65rem;
  color: var(--muted);
  margin: 0.2rem 0 0.4rem;
}

.round-group-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.round-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  background: #fffaf1;
}

.round-group-title {
  font-size: 0.65rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.round-group .unit-list {
  gap: 0.25rem;
}

.round-group .unit-pill {
  padding: 0.14rem 0.3rem;
  font-size: 0.7rem;
  line-height: 1;
}

.round-unit-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.round-unit-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
}

.round-unit-count {
  font-weight: 600;
}

.round-unit-name {
  white-space: nowrap;
}

.round-unit-bonus {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--muted);
}

.round-time {
  font-weight: 600;
}

.round::after {
  content: attr(data-troops);
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #141414;
  color: #f7f4ee;
  border-radius: 8px;
  padding: 0.2rem 0.45rem;
  font-size: 0.65rem;
  white-space: nowrap;
  z-index: 3;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.round:hover::after,
.round:focus-visible::after {
  display: block;
}

.round:focus-visible {
  outline: 2px solid #f0cf94;
  outline-offset: 2px;
}

.round.hold {
  background: #e4f4e6;
  color: #1f5e2a;
}

.round.lost {
  background: #fde8e4;
  color: var(--warn);
}

.round.warning {
  background: #fff2d9;
  color: #9a5b00;
  border-color: #f0cf94;
}

.round.manual-pending {
  background: #ffb347;
  color: #4f2500;
  border-color: #d97706;
}

.round.win {
  background: #e0f0ff;
  color: #1f4f8a;
  border-color: #9fc3ea;
}

.round.fragile-hold {
  background: repeating-linear-gradient(
    135deg,
    #e4f4e6,
    #e4f4e6 6px,
    #cfe9d3 6px,
    #cfe9d3 12px
  );
  color: #1f5e2a;
  border-color: #b9d9bf;
}

.round.fragile-win {
  background: repeating-linear-gradient(
    135deg,
    #e3f1ff,
    #e3f1ff 6px,
    #cfe4f9 6px,
    #cfe4f9 12px
  );
  color: #1f4f8a;
  border-color: #9fc3ea;
}

.round.night {
  border-color: #6f674e;
  box-shadow: 0 6px 14px rgba(40, 34, 18, 0.12);
}

.night-indicator {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  display: inline-block;
  margin-left: 0.25rem;
  background: radial-gradient(circle at 35% 30%, #fff2c9, #e0c98b 65%, #b89d5e);
  box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.22);
}

@media (max-width: 720px) {
  .round-detail-panel {
    left: 0;
    transform: none;
    min-width: 220px;
    width: auto;
    max-width: 92vw;
  }

  .round-detail-grid {
    grid-template-columns: 1fr;
  }

  .round-unit-bonus {
    margin-left: 0;
  }
}

@media (max-width: 1100px) {
  .round-detail-panel {
    min-width: min(360px, 92vw);
    max-width: 92vw;
  }

  .round-detail-grid {
    grid-template-columns: 1fr;
  }

  .round-unit-item {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .round-unit-name {
    white-space: normal;
  }

  .round-unit-bonus {
    margin-left: 0;
  }
}

.round-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.35rem;
}

.legend-night {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.timeline-target {
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border);
}

.timeline-target:last-child {
  border-bottom: none;
}

.timeline-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.timeline-hide-btn {
  border: 1px solid var(--border);
  background: #fbf9f4;
  color: var(--accent-strong);
  border-radius: 10px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.timeline-hide-btn:hover {
  background: #f4eee3;
}

.handled-impact-btn.is-handled {
  background: #e5f4e8;
  border-color: #9cc9a4;
  color: #245e2d;
}

.handled-impact-btn.is-handled:hover {
  background: #d8eddc;
}

.live-summary-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

.live-summary-account-card {
  border: 1px solid var(--border);
  background: #fbfaf7;
  border-radius: 12px;
  padding: 0.6rem;
  align-content: start;
}

.timeline-habitat {
  font-weight: 400;
}

.timeline-update {
  margin-left: auto;
  font-size: 0.78rem;
}

.note {
  padding: 0.4rem 0.6rem;
  background: #f8f4ee;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.note.warn {
  background: #fff4f1;
  border-color: #f0c5bc;
  color: #7b2b1f;
}

.simulator-card .card-body {
  gap: 1.5rem;
}

.simulator-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.planner-card .card-body {
  gap: 1.25rem;
}

.planner-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  align-items: flex-end;
  justify-content: space-between;
}

.planner-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.planner-add-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  background: #fffdf8;
  display: grid;
  gap: 0.9rem;
  box-shadow: var(--shadow);
}

.planner-step {
  display: grid;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-top: 1px dashed var(--border);
}

.planner-step:first-of-type {
  border-top: none;
  padding-top: 0;
}

.planner-step-actions {
  display: flex;
  justify-content: flex-end;
}

.planner-parsed-summary {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.planner-parsed-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.planner-target-chip {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--accent-strong);
  font-size: 0.85rem;
}

#planner-participation-step.disabled {
  opacity: 0.6;
}

.planner-habitat-totals {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  background: #fff;
  display: grid;
  gap: 0.4rem;
}

.planner-total-row {
  display: grid;
  gap: 0.3rem;
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.planner-total-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.planner-habitat-total {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.planner-include-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.planner-habitat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  padding: 0.4rem 0;
  overflow: visible;
}

.planner-dragging {
  user-select: none;
}

.planner-habitat-pill {
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  font-weight: 500;
  line-height: 1.2;
  z-index: 1;
  overflow: visible;
}

.planner-habitat-pill.inactive {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
  opacity: 0.7;
}

.planner-habitat-pill.active {
  background: #e9f6e8;
  border-color: #b7e1b4;
  color: #1f5d1c;
}

.planner-habitat-pill {
  position: relative;
}

.planner-habitat-tooltip {
  display: none;
}

.planner-habitat-tooltip-portal {
  position: fixed;
  top: 0;
  left: 0;
  transform: translateX(-50%);
  background: rgba(18, 23, 30, 0.95);
  color: #ffffff;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 3000;
  display: grid;
  gap: 0.25rem;
  transition: opacity 0.15s ease;
}

.planner-habitat-tooltip-portal.visible {
  opacity: 1;
}

.planner-habitat-pill:hover {
  z-index: 3;
}

.planner-habitat-tooltip-total {
  font-weight: 600;
}

.planner-habitat-tooltip .unit-list {
  margin-top: 0.2rem;
}

.planner-habitat-tooltip-units {
  margin-top: 0.3rem;
  padding: 0.35rem;
  background: #f0f4f5;
  border-radius: 6px;
  display: grid;
  gap: 0.25rem;
}

.planner-habitat-tooltip-unit {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 0.3rem;
}

.planner-habitat-tooltip-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: none;
}

.planner-habitat-tooltip-count {
  color: #141414;
}

.planner-add-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.planner-player-picker {
  display: grid;
  gap: 0.4rem;
}

.planner-player-picker .planner-exclude-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  flex-direction: row;
  align-items: flex-start;
  border: none;
  padding: 0;
  max-height: none;
  overflow: visible;
  background: transparent;
}

.planner-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  background: #fff;
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.planner-pill.active {
  background: var(--accent-strong);
  color: #fff;
  border-color: var(--accent-strong);
}

.planner-pill:hover {
  border-color: var(--accent-strong);
}

.planner-add-actions {
  display: flex;
  justify-content: flex-end;
}

.planner-input textarea {
  width: 100%;
  min-height: 90px;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  resize: vertical;
  font-family: inherit;
  color: var(--accent-strong);
  background: transparent;
}

.planner-exclusions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.planner-exclude-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.4rem 0.6rem;
  background: #fffdf8;
}

.planner-exclude-panel > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-strong);
}

.planner-exclude-panel[open] {
  box-shadow: var(--shadow);
}

.planner-exclude-section {
  display: grid;
  gap: 0.4rem;
  padding: 0.4rem 0;
}

.planner-exclude-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--accent-strong);
}

.planner-exclude-header-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.planner-capture-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.planner-exclude-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffdf8;
}

.planner-popover .planner-exclude-list {
  max-height: none;
  overflow: visible;
}

.planner-exclude-item {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  column-gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
}

.planner-exclude-item input {
  margin: 0;
  justify-self: start;
}

.planner-exclude-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.planner-targets {
  display: grid;
  gap: 1rem;
  position: relative;
}

.planner-target-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  background: #ffffff;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.8rem;
}

.planner-attacker-block {
  display: grid;
  gap: 0.6rem;
}

.planner-attacker-title {
  font-weight: 600;
  color: var(--accent-strong);
  text-align: center;
}

.planner-attacker-section > h4 {
  text-align: center;
}

.planner-attacker-section {
  display: grid;
  gap: 0.8rem;
}

.planner-attacker-grid {
  contain: layout paint;
  position: relative;
  --col-name: max-content;
  --col-launch: 90px;
  --col-gap: 0.5rem;
  --timeline-pad: 0.35rem;
}

.planner-grid-header,
.planner-grid-row {
  display: grid;
  grid-template-columns: var(--col-name) var(--col-launch) 1fr;
  gap: 0.5rem;
  align-items: center;
}

.planner-grid-header {
  font-weight: 400;
  color: var(--accent-strong);
}

.planner-grid-header .planner-grid-cell {
  font-weight: 600;
}

.planner-grid-header .planner-grid-cell.name,
.planner-grid-header .planner-grid-cell.launch {
  text-align: left;
}

.planner-grid-body {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.6rem;
}

.planner-grid-footer {
  display: grid;
  grid-template-columns: var(--col-name) var(--col-launch) 1fr;
  gap: 0.5rem;
  align-items: start;
  margin-top: 0.4rem;
}

.planner-grid-cell.name,
.planner-grid-cell.launch {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.planner-grid-cell.launch {
  color: var(--muted);
  text-align: center;
}

.launch-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  min-width: 0;
  justify-content: flex-start;
  width: 100%;
}

.launch-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}

.launch-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

.planner-grid-cell.timeline {
  padding: 0 var(--timeline-pad);
}

.planner-target-panel {
  display: grid;
  grid-template-columns: var(--col-name) var(--col-launch) 1fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.35rem 0 0.6rem;
  border-bottom: 1px dashed var(--border);
}

.planner-target-panel .rounds-control {
  grid-column: 1 / 3;
}

.planner-panel-exclusions {
  grid-column: 3 / 4;
  display: grid;
  gap: 0.35rem;
}

.planner-popover {
  position: fixed;
  z-index: 2000;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.6rem;
  overflow: auto;
  isolation: isolate;
  max-height: min(88vh, 980px);
}

.planner-popover-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-weight: 600;
  position: relative;
}

.planner-popover-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.planner-popover-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
  pointer-events: none;
  font-weight: 500;
}

.planner-popover-totals {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}

.planner-popover-capture {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}

.planner-fight-preview {
  display: grid;
  gap: 0.55rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.65rem;
}

.planner-fight-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.planner-fight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.45rem;
}

.planner-preview-research-panel {
  margin-top: 0.1rem;
}

.planner-preview-modifier-panel {
  margin-top: 0.1rem;
}

.planner-preview-units-grid {
  max-height: 220px;
  overflow: auto;
}

.planner-preview-unit-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.planner-preview-unit-pill {
  gap: 0.35rem;
  padding: 0.2rem 0.35rem 0.2rem 0.2rem;
}

.planner-preview-unit-pill.active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, #ffffff 82%, var(--accent) 18%);
}

.planner-preview-unit-pill.zero {
  opacity: 0.55;
}

.planner-preview-pill-input {
  width: 4.1rem;
  min-width: 4.1rem;
  padding: 0.15rem 0.28rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-strong);
  font-size: 0.75rem;
  line-height: 1.2;
}

.planner-preview-actions {
  margin-top: 0.1rem;
}

.planner-popover-exclusions summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
}

.planner-popover-exclusions summary button {
  margin-left: auto;
}

.planner-target-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.planner-target-title {
  font-weight: 600;
  color: var(--accent-strong);
}

.planner-target-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.planner-target-card details > summary {
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}

.planner-window-list {
  display: grid;
  gap: 0.5rem;
}

.planner-window {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr);
  gap: 0.4rem 0.8rem;
  align-items: center;
  background: #f7f8f9;
}

.planner-window-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--accent-strong);
}

.planner-window-times {
  display: grid;
  gap: 0.2rem;
  font-size: 0.85rem;
}

.planner-window-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.planner-timeline-axis {
  position: relative;
  height: 30px;
  margin-top: 0.4rem;
  cursor: grab;
}

.planner-timeline-axis::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #d8dadd, #b9c2cc);
  border-radius: 999px;
}

.planner-timeline-axis:active {
  cursor: grabbing;
}

.planner-timeline-range {
  position: absolute;
  height: 10px;
  border-radius: 999px;
  background: #f3c74f;
  box-shadow: 0 6px 12px rgba(15, 20, 26, 0.1);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  color: #5a4300;
}

.planner-timeline-range.sword {
  background: #f06a5f;
  color: #ffffff;
  z-index: 3;
}

.planner-timeline-range.cart {
  background: #f3c74f;
  z-index: 2;
}

.planner-timeline-bars {
  position: relative;
  height: 18px;
  margin-top: 0.4rem;
}

.planner-tooltip {
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(calc(-50% + var(--tooltip-shift, 0px)));
  background: rgba(18, 23, 30, 0.95);
  color: #ffffff;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 999;
}

.planner-tooltip .tooltip-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.planner-tooltip .tooltip-row + .tooltip-row {
  margin-top: 0.2rem;
}


.planner-timeline-range.tooltip-visible .planner-tooltip {
  opacity: 1;
  z-index: 1000;
}

.planner-timeline-range.tooltip-visible {
  z-index: 999;
}

.planner-timeline-legend {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.legend-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.sword {
  background: #f06a5f;
}

.legend-dot.cart {
  background: #f3c74f;
}

.planner-timeline-tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: #b9c2cc;
}

.planner-timeline-tick span {
  position: absolute;
  top: -2px;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-timeline-tick.bottom span {
  top: 16px;
}

.planner-timeline-tick.start span {
  transform: translateX(0);
}

.planner-timeline-tick.end span {
  transform: translateX(-100%);
}

.planner-timeline-gridlines {
  position: absolute;
  left: calc(
    var(--col-name) + var(--col-launch) + var(--col-gap) * 2 + var(--timeline-pad)
  );
  right: var(--timeline-pad);
  top: 2.8rem;
  bottom: 1.6rem;
  pointer-events: none;
}


.planner-timeline-gridline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(185, 194, 204, 0.6);
}

.planner-timeline-gridline.now {
  background: #3a4b5c;
  width: 2px;
  top: 6px;
  bottom: 6px;
}

.planner-timeline-gridline.impact {
  background: #1c7f5a;
  width: 2px;
}

.planner-marker-label {
  position: absolute;
  top: 0.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
  background: #ffffff;
  padding: 0 0.25rem;
}

.planner-timeline-gridline.now .planner-marker-label {
  color: #3a4b5c;
  top: -0.05rem;
}

.planner-timeline-gridline.impact::after {
  content: "Impact";
  position: absolute;
  top: -1.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: #1c7f5a;
  white-space: nowrap;
}

.planner-row-impact {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #1c7f5a;
  z-index: 2;
}

.planner-timeline-marker {
  position: absolute;
  top: 18px;
  width: 2px;
  height: 20px;
  background: #3a4b5c;
}

.planner-timeline-marker.now {
  background: #3a4b5c;
}

.planner-timeline-marker.impact {
  background: #1c7f5a;
}

.simulator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.simulator-side {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: #fbf8f2;
}

.side-header {
  display: grid;
  gap: 0.25rem;
}

.input-group span,
.modifier-grid span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.autofill-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.modifier-panel {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.4rem 0.7rem 0.6rem;
  background: #fbf9f4;
}

.modifier-panel summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 600;
  list-style: none;
}

.modifier-panel summary::-webkit-details-marker {
  display: none;
}

.modifier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.percent-input {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.35rem;
}

.percent-input input {
  margin-top: 0.35rem;
  padding-right: 0.35rem;
}

.percent-input span {
  font-weight: 700;
  color: var(--accent-strong);
  margin-top: 0.35rem;
}

[hidden] {
  display: none !important;
}

.research-panel {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  background: #fbf9f4;
  display: grid;
  gap: 0.6rem;
}

.research-header {
  display: grid;
  gap: 0.2rem;
}

.research-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.4rem 0.8rem;
}

.research-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--accent-strong);
}

.research-item input {
  width: auto;
  margin: 0;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
}

.unit-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.5rem;
  background: #f7f3ec;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.4rem 0.5rem;
}

.unit-card .unit-icon {
  width: 26px;
  height: 26px;
}

.unit-card .unit-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-strong);
}

.unit-card input {
  margin-top: 0.25rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
}

.simulator-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sim-result {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  display: grid;
  gap: 1rem;
}

.sim-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sim-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.sim-result-card {
  background: #f8f4ee;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem;
  display: grid;
  gap: 0.5rem;
}

.sim-rounds {
  display: grid;
  gap: 0.4rem;
}

.sim-round-detail {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.45rem 0.6rem;
  background: #fbf9f4;
}

.sim-round-detail.night {
  background: linear-gradient(135deg, #fbf4e6, #f6f0e1);
  border-color: #c9b58a;
}

.sim-round-detail summary {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  list-style: none;
}

.sim-round-detail summary::-webkit-details-marker {
  display: none;
}

.sim-round-detail-body {
  margin-top: 0.6rem;
}

.sim-round-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

input,
button,
select {
  font-family: inherit;
}

input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 0.35rem;
}

button {
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

button.pill-button {
  font-size: 0.75rem;
  font-weight: 400;
  padding: 0.2rem 0.6rem;
}

button.primary {
  background: var(--accent);
  color: white;
}

button.ghost,
a.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent-strong);
  padding: 0.5rem 1rem;
  border-radius: 999px;
}

button.ghost.warn {
  border-color: #f5c3b7;
  color: var(--warn);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: min(420px, 90vw);
}

.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.2rem;
}

.auth-switch {
  margin-top: 1.2rem;
  color: var(--muted);
}

.banner {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.banner.error {
  background: #fde8e4;
  color: var(--warn);
  border: 1px solid #f5c3b7;
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .ingest-row {
    flex-direction: column;
    align-items: stretch;
  }
}
