:root {
  color-scheme: light;
  --bg: #f6faf8;
  --surface: #ffffff;
  --surface-soft: #eaf5f1;
  --text: #10201c;
  --muted: #62736d;
  --line: #d9e7e1;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --ai: #0891b2;
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 14px 34px rgba(16, 32, 28, 0.12);
  --soft-shadow: 0 5px 16px rgba(16, 32, 28, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 430px;
  min-height: 580px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 250, 248, 0.94)),
    var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.popup {
  padding: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 10px;
  background: linear-gradient(145deg, #0f766e 0%, #0e7490 100%);
  box-shadow: var(--shadow);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 21px;
  height: 7px;
  border-radius: 2px;
  background: #ffffff;
  transform: translate(-50%, -50%);
}

.brand-mark::after {
  width: 7px;
  height: 21px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  line-height: 1.25;
  margin-bottom: 12px;
}

.brand p,
.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.gate,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #2f3a35;
  font-size: 12px;
  font-weight: 650;
}

input[type="date"],
input[type="email"],
input[type="number"],
input[type="text"] {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, transform 120ms ease;
}

button:hover {
  border-color: #a8bbb2;
}

button:active {
  transform: translateY(1px);
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 750;
}

.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.tab {
  height: 36px;
  padding: 5px;
  border-color: transparent;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.1;
  background: transparent;
}

.tab.active {
  border-color: var(--accent);
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.12);
}

.panel {
  display: none;
  min-height: 392px;
}

.panel.active {
  display: block;
}

.grid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

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

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 650;
}

.checkline input {
  width: 16px;
  height: 16px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.segmented label {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  text-align: center;
  font-size: 12px;
}

.segmented label:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-soft);
  color: var(--accent-dark);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.result-card {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
}

.result-card strong {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  margin-bottom: 6px;
}

.result-card span {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.result-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.result-card.full {
  grid-column: 1 / -1;
}

.consultation-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.security-note {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, #ffffff, #f3faf7);
}

.security-note strong {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.security-note span {
  font-size: 13px;
  line-height: 1.35;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-heading h2 {
  margin-bottom: 3px;
}

.icon-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  flex: 0 0 36px;
  border-color: var(--accent);
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 23px;
  line-height: 1;
  font-weight: 500;
}

.pdf-list {
  display: grid;
  gap: 10px;
}

.pdf-group-title {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.pdf-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
}

.pdf-title {
  display: block;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.pdf-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.pdf-actions {
  display: flex;
  gap: 5px;
}

.small-button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

.small-button.danger {
  color: var(--danger);
}

.message {
  min-height: 18px;
  color: var(--warn);
  font-size: 12px;
  line-height: 1.35;
}

.license-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.support-meta {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  word-break: break-word;
}

.license-footer .support-meta {
  grid-column: 1 / -1;
}

.update-ready {
  color: var(--ai);
  font-weight: 750;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.link-button {
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 750;
}

[hidden] {
  display: none !important;
}
