:root {
  color-scheme: light;
  --bg: #edf2ef;
  --panel: #fbfcf7;
  --text: #18221c;
  --muted: #617066;
  --line: #cad6ce;
  --accent: #1d5b39;
  --accent-dark: #16472d;
  --danger: #8a1f11;
  --success: #1f6a3c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(29, 91, 57, 0.12), transparent 34%), var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.shell {
  width: min(100% - 32px, 920px);
  margin: 0 auto;
  padding: 36px 0;
}

.shell.admin-shell {
  width: calc(100% - 32px);
  max-width: 1600px;
}

.panel {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 50px rgba(24, 34, 28, 0.12);
}

.panel.wide {
  max-width: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.15;
}

.intro {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.form {
  display: grid;
  gap: 16px;
}

.address-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.6fr) minmax(180px, 1fr);
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 91, 57, 0.16);
  outline: none;
}

button {
  margin-top: 8px;
  border: 0;
  border-radius: 6px;
  padding: 13px 18px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.notice {
  margin: 0 0 18px;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.45;
}

.notice.error {
  color: var(--danger);
  background: #fff2ef;
  border: 1px solid #efc5bd;
}

.notice.success {
  color: var(--success);
  background: #edf8f0;
  border: 1px solid #bfddc8;
}

.toolbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.count {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--accent);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.4;
}

th {
  color: var(--muted);
  background: #f5f8f6;
  font-weight: 700;
}

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

a {
  color: var(--accent);
}

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

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.toolbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.admin-actions button { margin: 0; padding: 8px 10px; font-size: 13px; }
th .sort-button { background: transparent; color: inherit; margin: 0; padding: 0; font-size: inherit; text-align: left; }
th .sort-button:hover { color: var(--accent); }
.sort-arrow { white-space: nowrap; }
.result-form { display: flex; flex-wrap: wrap; gap: 6px; min-width: 160px; }
.result-form input { width: 100px; flex: 1; padding: 8px; }
.result-form button { margin: 0; padding: 8px 10px; }
.result-status { width: 100%; font-size: 12px; }
.print-result { display: none; }
.x10-input { width: 80px; padding: 8px; }
.save-result-button { margin: 0 0 0 6px; padding: 8px 10px; }

.participant-map { margin: 0 0 24px; }
.participant-map h2 { margin: 0 0 8px; font-size: 22px; }
.participant-map p { color: var(--muted); font-size: 14px; }
#participant-map { height: 380px; border: 1px solid var(--line); border-radius: 8px; z-index: 0; }

.delete-button {
  margin: 0;
  padding: 8px 12px;
  background: var(--danger);
}

.delete-button:hover {
  background: #69170d;
}

@media print {
  .print-result { display: inline; }
  @page { size: A4 landscape; margin: 12mm; }
  body { min-height: 0; background: #fff; color: #000; }
  .shell { width: 100%; margin: 0; padding: 0; }
  .shell.admin-shell { width: 100%; max-width: none; }
  .panel { padding: 0; border: 0; box-shadow: none; }
  .no-print, .notice { display: none !important; }
  .table-wrap { overflow: visible; border: 0; }
  table { min-width: 0; width: 100%; table-layout: fixed; }
  th, td { padding: 6px; font-size: 10px; overflow-wrap: anywhere; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  .count { color: #000; }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 920px);
    padding: 16px 0;
  }

  .panel {
    padding: 20px;
  }

  h1 {
    font-size: 28px;
  }

  .toolbar {
    display: block;
  }

  .count {
    display: inline-block;
    margin-top: 6px;
  }

  .address-grid {
    grid-template-columns: 1fr;
  }
}
