:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --text: #1c2b27;
  --muted: #5d6f6a;
  --line: #dbe3e0;
  --accent: #0f7b6c;
  --accent-strong: #0a5f53;
  --accent-soft: #e0f1ed;
  --danger: #c0392b;
  --danger-soft: #fbe9e7;
  --warn-soft: #fff6dd;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 40, 34, .06), 0 4px 16px rgba(16, 40, 34, .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); line-height: 1.5; font-size: 16px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

button, .btn {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); padding: .55em 1em; transition: background .15s, border-color .15s;
}
button:hover { border-color: var(--accent); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
button.primary:hover { background: var(--accent-strong); }
button.danger { color: var(--danger); border-color: #e8b4ad; }
button.danger:hover { background: var(--danger-soft); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--surface-2); }
button:disabled { opacity: .5; cursor: not-allowed; }

label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .25em; }
input, select, textarea {
  font: inherit; width: 100%; padding: .55em .7em; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 4em; }
.check { display: flex; gap: .6em; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: .3em; }
.field { margin-bottom: 1em; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1em; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.alert { padding: .8em 1em; border-radius: 8px; margin: 1em 0; }
.alert.error { background: var(--danger-soft); color: #8a2a1f; }
.alert.ok { background: var(--accent-soft); color: var(--accent-strong); }
.alert.warn { background: var(--warn-soft); color: #6b5200; }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; vertical-align: middle; margin-right: .35em; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 30, 26, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 560px; padding: 1.5em; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.modal h2 { font-size: 1.25rem; }
.modal .actions { display: flex; gap: .5em; justify-content: flex-end; flex-wrap: wrap; margin-top: 1em; }
.modal .actions .left { margin-right: auto; }
