/* Moderation controls are intentionally scoped so the original warm homepage
   remains the visual baseline. */
.service-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.service-nav button {
  display: inline-flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.service-nav button:hover {
  color: var(--orange);
  border-color: var(--orange-line);
  background: var(--orange-soft);
}

.service-nav svg,
.service-action svg,
.restriction-banner svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.service-nav button:nth-child(1) svg { color: var(--green); }
.service-nav button:nth-child(2) svg { color: var(--orange); }
.service-nav button:nth-child(3) svg { color: var(--amber); }

.restriction-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 13px;
  color: var(--orange-dark);
  border: 1px solid var(--orange-line);
  border-radius: var(--radius-md);
  background: var(--orange-soft);
  font-size: 12px;
}

.restriction-banner button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  margin-left: auto;
  padding: 4px 0;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

.service-open { overflow: hidden; }

.service-modal {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}

.service-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 36, 31, 0.45);
}

.service-panel {
  position: relative;
  display: flex;
  width: min(100%, 520px);
  max-height: calc(100% - 20px);
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  outline: none;
}

.service-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.service-heading h2 {
  margin: 0;
  color: var(--head);
  font-size: 18px;
}

.service-heading .icon-button {
  flex-basis: 40px;
  width: 40px;
  height: 40px;
}

.service-content {
  min-height: 170px;
  overflow: auto;
  padding: 16px 16px 22px;
  overscroll-behavior: contain;
}

.service-content h3 { font-size: 15px; }

.service-meta {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.service-lead {
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 700;
}

.service-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.service-empty svg { width: 30px; height: 30px; color: var(--green); }
.service-empty p { margin: 0; overflow-wrap: anywhere; }

.service-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 11px;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}

.service-action:hover { color: var(--orange-dark); border-color: var(--orange-line); background: var(--orange-soft); }

.record-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.record-info { min-width: 0; flex: 1 1 160px; }
.record-code { display: block; overflow-wrap: anywhere; font-size: 17px; font-variant-numeric: tabular-nums; }
.record-info small,
.ban-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.record-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.record-actions .icon-button { flex-basis: 40px; width: 40px; height: 40px; }

.ban-row { padding: 16px 0; border-bottom: 1px solid var(--line); }
.ban-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.ban-row p { margin: 10px 0 4px; font-size: 13px; }

.review-state {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-tint);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.review-state.active,
.review-state.confirmed { color: #a33d24; background: var(--orange-soft); }
.review-state.pending { color: #8b6309; background: var(--amber-soft); }
.review-state.approved,
.review-state.revoked { color: var(--green); background: var(--green-soft); }

.review-note {
  padding: 12px;
  border-left: 2px solid var(--green);
  background: var(--surface-tint);
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.service-form { display: grid; gap: 16px; }
.service-field { display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
.service-field input,
.service-field textarea,
.service-field select,
.service-field + select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: inherit;
  letter-spacing: 0;
}

.service-field input,
.service-field select { min-height: 44px; }
.service-field textarea { min-height: 110px; resize: vertical; }
.service-field input:focus-visible,
.service-field textarea:focus-visible,
.service-field select:focus-visible { outline: 3px solid rgba(255, 80, 0, 0.28); outline-offset: 2px; }

.reason-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.reason-options legend { margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.reason-options label { display: flex; min-height: 44px; align-items: center; gap: 6px; padding: 8px 5px; font-size: 13px; }
.reason-options input { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; accent-color: var(--orange); }

.form-feedback { margin: 0; color: var(--orange-dark); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.form-feedback:empty { display: none; }
.service-form .submit-button { margin-top: 0; }

/* The service modal becomes a bottom sheet on phones while keeping the
   homepage's original mobile spacing intact. */
@media (max-width: 560px) {
  .service-modal { align-items: end; padding: 0; }
  .service-panel { width: 100%; max-height: calc(100% - 24px - env(safe-area-inset-top)); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .service-content { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

@media (max-width: 359px) {
  .service-nav button { font-size: 11px; }
  .service-content { padding-right: 13px; padding-left: 13px; }
}

.toast { z-index: 60; }
.service-open .toast { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }
