:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #20252b;
  background: #f5f6f7;
  font-synthesis: none;
  font-size: 14px;
  line-height: 1.5;
}
.event-dialogue {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid #e0e4e8;
  border-radius: 5px;
  background: #fafbfc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid #e2e5e9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}
.brand {
  text-decoration: none;
  color: #20252b;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.6px;
}
.brand span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  border-left: 1px solid #d5d9df;
  margin-left: 18px;
  padding-left: 18px;
  color: #727b85;
}
.local {
  font-size: 12px;
  color: #67717c;
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 40px;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.7px;
  margin: 0 0 6px;
  color: #67717c;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
  line-height: 1.25;
  margin: 0 0 9px;
  font-weight: 600;
}
h2 {
  font-size: 14px;
  margin: 0;
  font-weight: 600;
}
h3 {
  font-size: 14px;
  font-weight: 500;
}
.muted {
  color: #77808a;
  margin: 0;
  font-size: 13px;
}
button,
input,
select {
  font: inherit;
}
button {
  border: 1px solid #d9dde2;
  background: #fff;
  color: #343c45;
  padding: 9px 15px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 550;
}
button:hover {
  background: #f1f3f5;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.primary {
  background: #283d50;
  color: white;
  border-color: #283d50;
}
.primary:hover {
  background: #1d3041;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid #4b769a;
  outline-offset: 3px;
}
.login-panel {
  background: #fff;
  border: 1px solid #e0e4e8;
  border-radius: 7px;
  padding: 24px 26px;
  margin-bottom: 28px;
}
.section-intro {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 18px;
}
.section-intro p {
  font-size: 12px;
  color: #838a93;
  margin: 0;
}
form {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr auto;
  gap: 18px;
  align-items: end;
}
form > *,
.camp-layout > *,
.workspace > * {
  min-width: 0;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: #5b6570;
  font-weight: 500;
}
input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid #d9dee4;
  border-radius: 4px;
  padding: 10px 11px;
  color: #242e38;
  background: #fff;
  height: 41px;
  font-size: 13px;
}
input:focus,
select:focus {
  outline: 2px solid #d7e3ed;
  border-color: #738c9f;
}
input::placeholder {
  color: #a1a7af;
}
form button {
  height: 41px;
  padding: 0 24px;
}
.caption {
  font-size: 11px;
  color: #818994;
  margin: 12px 0 0;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 335px;
  gap: 24px;
  align-items: start;
}
.accounts,
aside {
  background: #fff;
  border: 1px solid #e0e4e8;
  border-radius: 7px;
  min-height: 350px;
  overflow: hidden;
}
.section-head {
  height: 61px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid #eceef1;
}
.section-head .caption {
  margin: 0;
}
#count {
  font-size: 11px;
  font-weight: 400;
  color: #7a848e;
  padding-left: 8px;
}
.table-scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  text-align: left;
}
th {
  font-size: 10px;
  color: #7b848e;
  font-weight: 500;
  letter-spacing: 0.2px;
  padding: 13px 18px;
  background: #fafbfc;
}
td {
  padding: 17px 18px;
  border-bottom: 1px solid #eef0f3;
  font-size: 12px;
}
tbody tr {
  cursor: pointer;
}
tbody tr:hover,
tbody tr.selected {
  background: #f3f6f8;
}
.row-select {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  display: block;
}
.row-select:hover {
  background: transparent;
}
.sub {
  font-size: 11px;
  color: #8b929b;
  display: block;
  margin-top: 3px;
}
.status {
  padding: 4px 8px;
  border-radius: 4px;
  background: #f1f3f5;
  font-size: 10px;
  color: #6a737e;
}
.status.connected {
  color: #34614b;
  background: #eef5f0;
}
.status.error {
  color: #8a4e45;
  background: #faf1ef;
}
.empty {
  padding: 70px 20px;
  text-align: center;
  color: #606c78;
}
.empty h3 {
  margin: 0 0 7px;
}
.empty p {
  font-size: 12px;
  color: #9097a0;
  margin: 0;
}
.detail-body {
  padding: 22px;
}
.detail-body h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.detail-body > p {
  font-size: 12px;
  color: #78828d;
  margin: 7px 0 20px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 12px;
  margin: 24px 0;
}
.detail-grid dt {
  color: #8b929b;
  font-size: 10px;
  margin-bottom: 4px;
}
.detail-grid dd {
  margin: 0;
  font-size: 12px;
}
.actions {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}
.actions button {
  font-size: 11px;
  padding: 7px 10px;
}
.logs-title {
  border-top: 1px solid #eceef1;
  padding-top: 20px;
  margin: 20px 0 12px;
  font-size: 11px;
  font-weight: 600;
}
.logs {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 310px;
  overflow: auto;
}
.logs li {
  padding: 9px 0;
  font-size: 11px;
  color: #66717d;
  border-bottom: 1px solid #f0f2f4;
  overflow-wrap: anywhere;
}
.logs time {
  display: block;
  font-size: 10px;
  color: #a0a6af;
  margin-bottom: 3px;
}
.feature-note {
  font-size: 11px;
  color: #8b929b;
  background: #f7f8f9;
  padding: 12px;
  line-height: 1.7;
}
footer {
  display: flex;
  justify-content: space-between;
  color: #959ca5;
  font-size: 10px;
  padding-top: 22px;
  gap: 15px;
}
#notice {
  padding: 12px 16px;
  border: 1px solid #e4d6bd;
  background: #fcf9f2;
  color: #806336;
  border-radius: 5px;
  margin-bottom: 20px;
  font-size: 12px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  main {
    padding-top: 54px;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  aside {
    min-height: 0;
  }
  form {
    grid-template-columns: 1fr 1fr;
  }
  .detail-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 640px) {
  header {
    padding: 0 20px;
    height: 62px;
  }
  .brand span {
    display: none;
  }
  .local {
    font-size: 10px;
  }
  main {
    padding: 26px 16px;
  }
  .heading {
    gap: 16px;
    align-items: flex-start;
  }
  h1 {
    font-size: 23px;
  }
  .heading > button {
    font-size: 10px;
    padding: 8px;
  }
  .login-panel {
    padding: 20px;
  }
  .section-intro {
    display: block;
  }
  .section-intro p {
    margin-top: 4px;
  }
  form {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .section-head {
    padding: 0 16px;
  }
  .section-head .caption {
    font-size: 9px;
  }
  footer {
    flex-direction: column;
    gap: 6px;
  }
}
.user-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-nav button {
  font-size: 11px;
  padding: 7px 10px;
}
.auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  width: min(100%, 430px);
  padding: 34px;
  background: #fff;
  border: 1px solid #e0e4e8;
  border-radius: 7px;
}
.auth-card h1 {
  font-size: 25px;
}
.auth-card .muted {
  line-height: 1.8;
}
.vertical-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  margin: 28px 0 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
#team-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#team-form select[multiple] {
  height: 140px;
}
@media (max-width: 700px) {
  #team-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.auth-card #notice {
  margin-top: 20px;
}
.auth-card a {
  display: inline-block;
}
dialog {
  border: 1px solid #d9dee4;
  border-radius: 7px;
  padding: 28px;
  max-width: 440px;
  width: calc(100% - 32px);
}
dialog::backdrop {
  background: #20252b66;
}
dialog form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}
dialog h2 {
  font-size: 18px;
}
#activation-result {
  padding: 12px 0 20px;
}
#activation-link {
  margin-top: 8px;
  font-family: monospace;
  font-size: 12px;
}
#admin-panel .table-scroll {
  margin-top: 24px;
}
#create-user-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(140px, .7fr) auto;
  align-items: start;
}
#create-user-form > button { margin-top: 25px; }
@media (max-width: 800px) {
  header {
    height: auto;
    min-height: 72px;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .user-nav {
    flex-wrap: wrap;
  }
  .user-nav .local {
    width: 100%;
  }
  #create-user-form {
    grid-template-columns: 1fr;
  }
  #create-user-form > button { margin-top: 0; }
  .auth-card {
    padding: 26px;
  }
}
.camp-panel {
  margin-top: 28px;
  background: #fff;
  border: 1px solid #e2e5e9;
  border-radius: 8px;
  padding: 24px;
}
.camp-search {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  align-items: end;
  gap: 12px;
  margin: 20px 0;
}
.camp-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
}
#map-list {
  width: 100%;
  height: 340px;
  font-size: 12px;
}
#camp-plot {
  background: #f8f9fa;
  border: 1px solid #e4e7eb;
  padding: 12px;
  margin: 16px 0;
}
#camp-plot svg {
  width: 100%;
  max-height: 380px;
}
#camp-plot g {
  cursor: pointer;
}
#camp-plot g:focus circle {
  stroke: #111;
  stroke-width: 3;
}
.count-filter {
  margin: 24px 0 12px;
  max-width: 260px;
}
.encounter-card {
  border: 1px solid #e2e5e9;
  border-radius: 6px;
  padding: 16px;
  margin: 12px 0;
}
.encounter-card h4 {
  margin: 0;
}
.battle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 12px;
}
.battle-cell {
  background: #f2f4f6;
  min-height: 60px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  font-size: 12px;
}
.battle-cell:nth-child(4n + 2) {
  margin-right: 8px;
}
.battle-cell small {
  color: #707983;
  font-size: 10px;
}
.preset-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid #e2e5e9;
  margin-top: 24px;
  padding-top: 12px;
}
.preset-form textarea {
  width: 100%;
  border: 1px solid #cdd3da;
  border-radius: 5px;
  padding: 10px;
  font: inherit;
  resize: vertical;
}
.preset-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
@media (max-width: 900px) {
  .camp-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .camp-search {
    grid-template-columns: minmax(0, 1fr);
  }
  .camp-panel {
    padding: 16px;
  }
}
.operation-stats {
  display: flex;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 12px 0;
  font-size: 12px;
  color: #55616e;
}
.preset-limits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
details {
  border-top: 1px solid #e2e5e9;
  padding: 12px 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
}
@media (max-width: 700px) {
  .preset-limits {
    grid-template-columns: 1fr 1fr;
  }
}
.workspace-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  border-bottom: 1px solid #dce1e7;
  padding-bottom: 10px;
}
.workspace-nav button {
  border-color: transparent;
  background: transparent;
}
.workspace-nav button[aria-pressed="true"] {
  background: #e8edf2;
  color: #253748;
  border-color: #cbd4de;
}
.account-filter {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
@media (max-width: 700px) {
  .account-filter {
    grid-template-columns: 1fr;
  }
}
.check-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}
.check-label input {
  width: auto;
  min-height: 0;
}
#route-plot svg {
  width: 100%;
  max-height: 360px;
  background: #f5f7f9;
  margin: 12px 0;
}
.skill-settings .preset-limits {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 700px) {
  .skill-settings .preset-limits {
    grid-template-columns: 1fr;
  }
}
.skill-settings select {
  min-width: 0;
  max-width: 100%;
}
button.battle-cell {
  text-align: left;
  height: auto;
  white-space: normal;
  border: 1px solid #d1d9e2;
}
button.battle-cell:hover,
button.battle-cell:focus-visible {
  border-color: #315b7d;
  background: #e5edf4;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  flex-shrink: 0;
}
#login-form .check-label {
  grid-column: 1 / -1;
}
#follower-settings > .preset-limits {
  padding: 14px 0;
  border-bottom: 1px solid #e5e8ec;
}

.turn-skills { margin-top: .75rem; }
.turn-skills-panel { padding: .5rem 0 .75rem; }
.turn-skills-list { display: grid; gap: .5rem; margin-bottom: .5rem; }
.turn-skills-row { display: flex; gap: .5rem; align-items: end; }
.turn-skills-row label { flex: 1; min-width: 0; }
.turn-skills-row button { flex: 0 0 auto; }
.auto-account-row > label:not(.check-label) { margin-top: .6rem; }
