:root {
  color-scheme: light;
  --bg: #f4f7f2;
  --panel: #ffffff;
  --text: #183224;
  --muted: #567061;
  --border: #d2ddd4;
  --primary: #1f7a4c;
  --primary-hover: #185d3a;
  --danger: #c84343;
  --danger-hover: #a23535;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 420px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #e9f1e7 0%, var(--bg) 100%);
  color: var(--text);
}

.popup {
  padding: 20px;
}

.popup h1 {
  margin: 0 0 14px;
  font-size: 24px;
}

.popup h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.popup__card {
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(31, 72, 46, 0.08);
}

.popup__card--compact {
  padding: 12px 14px;
}

.popup__card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.popup__eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.popup__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ef;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.popup__badge[data-state="active"] {
  background: rgba(31, 122, 76, 0.14);
  color: var(--primary);
}

.popup__badge[data-state="warning"] {
  background: rgba(178, 113, 23, 0.14);
  color: #9a5f17;
}

.popup__badge[data-state="expired"],
.popup__badge[data-state="disabled"],
.popup__badge[data-state="invalid"] {
  background: rgba(200, 67, 67, 0.14);
  color: var(--danger);
}

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

.popup__meta {
  min-height: 18px;
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.popup__label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.popup__input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  background: var(--panel);
}

.popup__input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 122, 76, 0.12);
}

.popup__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0 10px;
}

.popup__actions--inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.popup__actions--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.popup__card--compact .popup__card-head {
  align-items: center;
}

.popup__card--compact .popup__eyebrow {
  margin-bottom: 2px;
  font-size: 11px;
}

.popup__card--compact h2 {
  margin-bottom: 0;
  font-size: 15px;
}

.popup__card--compact .popup__hint {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.popup__card--compact .popup__meta {
  min-height: 14px;
  margin: 0 0 8px;
  font-size: 11px;
}

.popup__card--compact .popup__label {
  margin-bottom: 6px;
  font-size: 12px;
}

.popup__card--compact .popup__input {
  padding: 10px 12px;
  font-size: 13px;
}

.popup__card--compact .popup__actions {
  margin: 10px 0 0;
  gap: 8px;
}

.popup__card--compact button {
  padding: 9px 8px;
  font-size: 12px;
  border-radius: 10px;
}

.popup__card--compact .popup__badge {
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
}

button:hover {
  background: var(--primary-hover);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.secondary {
  background: #eef4ef;
  color: var(--text);
}

button.secondary:hover {
  background: #dde8df;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: var(--danger-hover);
}

.popup__status {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.popup__status[data-tone="error"] {
  color: var(--danger);
}

.popup__status[data-tone="success"] {
  color: var(--primary);
}
