:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --line: #2a3542;
  --text: #e7eef6;
  --muted: #8b9aab;
  --accent: #3d9cf0;
  --ok: #3ecf8e;
  --bad: #f07178;
  --warn: #e6c07b;
  --radius: 10px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, #1b2a3d 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 24px 22px 48px; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 22px; flex-wrap: wrap;
  position: relative;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; opacity: 0.95; }
.brand:hover .brand-mark { transform: translateY(-1px); }
.brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 6px rgba(61, 156, 240, 0.28));
  transition: transform .18s ease;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  gap: 2px;
  min-width: 0;
}
.brand-copy strong {
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  background: linear-gradient(105deg, #eef6ff 20%, #7ec8ff 55%, #3d9cf0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.brand-copy span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.login-box .brand { margin-bottom: 8px; }
.login-box .brand-mark { width: 48px; height: 48px; }
.login-box .brand-copy strong { font-size: 1.2rem; }
.login-box .brand-copy span { font-size: 0.8rem; }
select.region-select {
  width: 100%;
  max-width: 100%;
  min-height: 38px;
}
select.region-select[multiple] {
  min-height: 180px;
  padding: 6px;
}
.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  position: relative;
}
.nav a { color: inherit; }
.nav a.nav-active { color: var(--text); font-weight: 600; }
.nav-alert-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: #243041;
  color: var(--text);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
}
.nav-alert-icon {
  display: block;
  flex: 0 0 auto;
  opacity: 0.92;
}
.nav-alert-btn.has-unread {
  border-color: color-mix(in srgb, #e85d5d 55%, var(--line));
  color: #ffb4b4;
}
.nav-alert-badge {
  display: inline-block;
  min-width: 1.1em;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d64545;
  color: #fff;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.35;
  vertical-align: top;
}
.alert-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(420px, 92vw);
  max-height: min(70vh, 480px);
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--panel) 96%, #000);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.alert-panel[hidden] { display: none !important; }
.alert-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.alert-panel-body {
  overflow: auto;
  padding: 8px 12px 12px;
}
.alert-item {
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.alert-item:last-child { border-bottom: 0; }
.alert-item.unread .alert-item-msg { color: #ffc9c9; }
.alert-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.alert-item-meta { font-size: 0.78rem; margin-top: 2px; }
.alert-item-msg { margin-top: 4px; font-size: 0.88rem; line-height: 1.4; word-break: break-word; }
.task-row-alert td.task-num-cell {
  box-shadow: inset 3px 0 0 #d64545;
}
.task-row-alert .task-alias { color: #ff8f8f; }
.task-alert-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05em;
  height: 1.05em;
  margin-right: 4px;
  border-radius: 50%;
  background: #d64545;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  flex: 0 0 auto;
}
.card {
  background: color-mix(in srgb, var(--panel) 92%, #000);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
h1, h2 { margin: 0 0 12px; font-size: 1.15rem; }
.muted { color: var(--muted); font-size: 0.92rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.btn, button, .btnlink {
  display: inline-block;
  border: 1px solid var(--line);
  background: #243041;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}
.btn-primary { background: var(--accent); border-color: transparent; color: #061018; font-weight: 600; }
.btn-danger { background: #4a2228; border-color: #6b3038; }
.btn-ok { background: #1d3d30; border-color: #2f6b52; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 0.86rem; text-align: left; }
label.form-check {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  width: auto;
  max-width: 100%;
  text-align: left;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
  float: none;
}
label.form-check input[type="checkbox"] {
  width: auto;
  max-width: none;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}
label.form-check span {
  text-align: left;
  flex: 0 1 auto;
}
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  max-width: 520px;
  background: #101820;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
}
select {
  padding-right: 2.6em;
  -webkit-appearance: none;
  appearance: none;
  background-color: #101820;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b9aab' d='M1.2 1.3 6 6.1l4.8-4.8 1.1 1.1L6 8.3.1 2.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.15em center;
  background-size: 12px 8px;
}
textarea[name="hosts_text"] {
  max-width: 100%;
  min-height: 120px;
  font-family: ui-monospace, Consolas, "Cascadia Mono", monospace;
  line-height: 1.45;
}
.hosts-block { margin-top: 4px; }
.hosts-title {
  display: block;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
}
.hosts-list { display: flex; flex-direction: column; gap: 10px; }
.host-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #121920;
  width: 100%;
}
.host-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  min-width: 0;
}
.host-field span { flex: 0 0 auto; white-space: nowrap; }
.host-field input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none !important;
}
.host-domain { flex: 1.6 1 0; min-width: 0; }
.host-bucket { flex: 0 1 200px; min-width: 110px; max-width: 240px; }
.host-row .host-save,
.host-row .host-remove {
  flex: 0 0 auto;
  white-space: nowrap;
  margin: 0;
}
.host-row .host-remove:disabled { opacity: 0.35; cursor: not-allowed; }
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #243041;
  color: var(--muted);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  letter-spacing: -2px;
  font-size: 0.85rem;
  line-height: 1;
  flex: 0 0 auto;
  touch-action: none;
}
.drag-handle:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.drag-handle:active { cursor: grabbing; }
body.is-task-dragging {
  cursor: grabbing !important;
  user-select: none !important;
}
body.is-task-dragging * {
  cursor: inherit !important;
  user-select: none !important;
}
.task-row.dragging td,
.drag-float-table .task-row.dragging td {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel)) !important;
  color: var(--text);
}
.task-row.dragging .task-alias,
.drag-float-table .task-row.dragging .task-alias {
  color: #eaf6ff;
}
.task-row.dragging .drag-handle,
.drag-float-table .task-row.dragging .drag-handle {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, #243041);
}
.task-row.drag-source-hidden {
  display: none !important;
}
.drag-float-table {
  border-collapse: collapse;
  table-layout: fixed;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0.96;
}
.drag-float-table .task-row.dragging td {
  /* 仅标亮，不改变尺寸 */
  box-shadow: none !important;
  outline: none;
}
.drag-placeholder-row td {
  padding: 2px 8px !important;
  border-bottom: none !important;
  background: transparent !important;
  vertical-align: middle !important;
}
.drag-placeholder {
  height: 48px;
  margin: 0;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: none;
  overflow: hidden;
  pointer-events: none;
}
.drag-placeholder.is-open {
  /* 占位高度由 JS 设为原行高，无缩放动画，避免列表错位 */
  opacity: 1;
}
.task-table tbody tr.task-row {
  transition: opacity .15s ease, filter .15s ease;
}
.group-header-row td {
  padding: 8px 8px 6px !important;
  background: transparent !important;
  border-bottom: none !important;
}
.group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
}
.group-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: color-mix(in srgb, var(--accent) 55%, var(--text));
  background: color-mix(in srgb, var(--accent) 12%, #1a2736);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
}
.group-header-icon svg {
  display: block;
}
.group-header-name {
  font-weight: 650;
  font-size: 0.9rem;
  color: var(--text);
  letter-spacing: 0.01em;
}
.group-header-tip {
  font-size: 0.76rem;
  opacity: 0.85;
  flex: 1 1 auto;
  min-width: 0;
}
.group-renew-btn {
  flex: 0 0 auto;
  margin-left: 8px;
  white-space: nowrap;
}
.group-manage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.group-manage-item,
.group-manage-float {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
}
.group-manage-float {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0.96;
}
.group-manage-item.drag-source-hidden {
  display: none !important;
}
.group-manage-handle {
  flex: 0 0 auto;
}
.group-manage-rename {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.group-manage-rename input[name="name"] {
  flex: 1 1 auto;
  min-width: 120px;
  margin: 0;
}
.group-manage-count {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.82rem;
}
.group-manage-delete {
  flex: 0 0 auto;
  margin: 0;
}
.group-manage-placeholder {
  list-style: none;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  pointer-events: none;
}
.task-num-col,
.task-num-cell {
  width: 42px;
  min-width: 42px;
  max-width: 48px;
  text-align: center;
  padding-left: 6px !important;
  padding-right: 6px !important;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
  vertical-align: middle !important;
}
.task-table tbody tr.task-row td {
  cursor: default;
}
.task-table { font-size: 0.9rem; }
.task-table th, .task-table td {
  padding: 8px 10px;
  vertical-align: top;
  white-space: nowrap;
}
.task-cell {
  width: 280px;
  max-width: 280px;
  white-space: normal;
  overflow: hidden;
}
.task-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  line-height: 1.35;
}
.task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
}
.task-alias {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 140px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-host-mode {
  flex: 0 0 3.6em;
  width: 3.6em;
  min-width: 3.6em;
  max-width: 3.6em;
  box-sizing: border-box;
  text-align: center;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-target {
  flex: 0 0 5.5em;
  width: 5.5em;
  min-width: 5.5em;
  max-width: 5.5em;
  box-sizing: border-box;
  text-align: center;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-row-renewing .btn-ok[data-renew] {
  opacity: 0.75;
  cursor: not-allowed;
}
.domains-cell {
  max-width: 320px;
  white-space: normal;
  vertical-align: top;
}
.task-domains {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.task-domain {
  font-weight: 400;
  font-size: 0.86rem;
  color: var(--text);
  word-break: break-all;
  white-space: normal;
  line-height: 1.35;
}
.account-cell {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nowrap { white-space: nowrap; }
.sep { opacity: 0.45; margin: 0 2px; }
.ops-cell { width: 1%; }
.ops-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-sm {
  padding: 4px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
  line-height: 1.35;
  text-decoration: none;
}
.btn-sm:hover { text-decoration: none; opacity: 0.92; }
.btn-sm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
a.btn-sm { color: var(--text); }
.linkish {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.linkish:hover { text-decoration: underline; }
.linkish:disabled {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: none;
  opacity: 0.55;
}
.linkish.is-on { color: var(--ok); }
.linkish.is-off { color: var(--muted); }
.linkish.link-ok { color: var(--ok); }
.linkish.link-danger { color: var(--bad); }
a.linkish { color: var(--accent); }
.log-card { max-width: min(760px, calc(100vw - 24px)); }
.log-card .typewriter {
  min-height: 220px;
  max-height: 52vh;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.log-actions[hidden] { display: none !important; }
.log-actions-tip {
  margin: 0;
  flex: 1 1 220px;
  font-size: 0.86rem;
}
.ui-dialog-card {
  max-width: min(440px, calc(100vw - 24px));
}
.ui-dialog-msg {
  margin: 8px 0 0;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.force-pwd-card {
  max-width: min(420px, calc(100vw - 24px));
}
.force-pwd-card input[type="password"] {
  width: 100%;
}
@media (max-width: 900px) {
  .task-table th:nth-child(4),
  .task-table td:nth-child(4) { display: none; }
  .domains-cell { max-width: 180px; }
}
.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }
.flash-ok { background: #163528; border: 1px solid #2f6b52; }
.flash-bad { background: #3a1c22; border: 1px solid #6b3038; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 0.78rem; border: 1px solid var(--line);
}
.badge-on { color: var(--ok); border-color: #2f6b52; }
.badge-off { color: var(--muted); }
.badge-le { color: #9cdcfe; }
.badge-lite { color: var(--warn); }
pre.log {
  background: #0b1016;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  max-height: 420px;
  font-size: 0.8rem;
  line-height: 1.45;
}
.login-box { max-width: 400px; margin: 12vh auto; }
.filters {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #121920;
}
.filters-row {
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.filters-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}
.filters .filter-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}
.filters .filter-inline select {
  width: auto;
  max-width: 240px;
  min-width: 140px;
}
.pager {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9em;
  height: 1.9em;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #243041;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1;
  text-decoration: none;
}
.pager-btn.pager-nav {
  min-width: auto;
  padding: 0 10px;
  height: 2em;
}
a.pager-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.pager-btn.is-current {
  background: var(--accent);
  border-color: transparent;
  color: #061018;
  font-weight: 700;
}
.pager-btn.is-disabled {
  opacity: 0.35;
  cursor: default;
}
.pager-ellipsis {
  color: var(--muted);
  padding: 0 2px;
  font-size: 0.82rem;
}
.yesterday-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, #000);
}
.yesterday-panel[hidden] { display: none !important; }
.yesterday-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.yesterday-table { margin: 0; font-size: 0.88rem; }
.yesterday-table th { white-space: nowrap; }
.archive-list { display: flex; flex-direction: column; gap: 10px; }
.archive-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--panel) 88%, #000);
}
.archive-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.archive-item-head .muted { flex: 1; min-width: 160px; }
.archive-panel { margin-top: 10px; }
.task-log-wrap { overflow: auto; max-height: min(70vh, 560px); }
.task-log-table { margin: 0; font-size: 0.88rem; }
.task-log-table th { position: sticky; top: 0; background: var(--panel); }
.task-log-ok td:nth-child(2) { color: var(--ok); }
.task-log-bad td:nth-child(2) { color: var(--bad); }
.nowrap { white-space: nowrap; }
.text-ok { color: var(--ok); }
.text-bad { color: var(--bad); }
.records-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .records-grid { grid-template-columns: 1fr; }
}
.records-table { margin: 0; font-size: 0.88rem; }
.records-col { overflow: auto; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 input, .grid2 select { max-width: 100%; }
.ak-actions-th,
.ak-actions-cell {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}
.ak-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}
.ak-actions form {
  display: inline;
  margin: 0;
}
.ak-remark {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  text-align: center;
}

[hidden] { display: none !important; }
.ca-field {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 14px 18px;
  margin: 22px 0 8px;
  padding: 4px 0;
  text-align: left;
  width: 100%;
}
.ca-label {
  color: var(--muted);
  font-size: 0.86rem;
  flex: 0 0 auto;
  white-space: nowrap;
}
.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
.radio-inline input[type="radio"] {
  width: auto;
  max-width: none;
  margin: 0;
  accent-color: var(--accent);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.modal-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(720px, calc(100vw - 24px));
  width: 100%;
}
.modal::backdrop {
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(2px);
}
.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 18px 14px;
  color: var(--text);
  max-height: min(86vh, 900px);
  overflow: auto;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.modal-head h2 { margin: 0; }
.modal-card input,
.modal-card select,
.modal-card textarea { max-width: 100%; }

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 28px 0 4px;
  padding: 20px 12px 4px;
  text-align: center;
  border-top: 1px solid var(--line);
  box-sizing: border-box;
}
.site-footer-slogan {
  margin: 0;
  max-width: 36em;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-align: center;
}
.site-footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  opacity: 0.85;
  text-align: center;
}
.site-footer-copy a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer-copy a:hover {
  color: var(--accent);
  text-decoration: none;
}
.login-box + .site-footer {
  margin-top: 22px;
  border-top: none;
  padding-top: 8px;
}
