:root {
  --navy: #0b3a5b;
  --navy-2: #124e78;
  --accent: #1a8a9a;
  --card: #fff;
  --line: #d7e3ee;
  --muted: #5b7388;
  --text: #14324a;
  --danger: #9a3412;
  --warn: #fff7ed;
  --ok: #0f7a4a;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}
html { height: 100dvh; }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  background: #0b3a5b;
  color: var(--text);
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.shell {
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) calc(8px + var(--safe-b)) calc(12px + var(--safe-l));
  overflow: hidden;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  margin-bottom: 10px;
  flex: none;
  gap: 8px;
}
.brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.brand strong { display: block; white-space: nowrap; font-size: 16px; }
.badge {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: rgba(255,255,255,.12); display: grid; place-items: center;
}
.badge svg { width: 22px; height: 22px; }
.progress {
  display: flex; gap: 5px; margin-bottom: 10px; flex: none;
}
.progress i {
  flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,.2);
}
.progress i.on { background: #7fd3e0; }
.card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pane h2, .pane .crumb { flex: none; }
.ico { width: 22px; height: 22px; flex: none; }
.ico.tiny { width: 16px; height: 16px; }
.h-ico { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 22px; letter-spacing: -.02em; }
.h-ico .ico { width: 26px; height: 26px; color: var(--navy); }
.crumb {
  display: flex; align-items: center; gap: 8px; margin: -6px 0 12px;
  color: var(--muted); font-size: 14px; font-weight: 650;
}
.field { display: flex; flex-direction: column; }
.field-row {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; background: #f8fbfd;
}
.field-row.top { align-items: flex-start; padding-top: 12px; }
.field-row .ico { color: var(--muted); width: 20px; height: 20px; }
.field-row input, .field-row textarea {
  border: 0; background: transparent; padding: 14px 4px; flex: 1; min-width: 0;
  outline: none; box-shadow: none;
}
.field-row:focus-within {
  border-color: var(--accent); background: #fff; outline: 2px solid #bfe7ee;
}
.field-row textarea { min-height: 110px; }
.pane {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 18px 8px;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
.pane:has(.sheet-wrap) { overflow: hidden; }
h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: 1fr 1fr; }
label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 6px; }
input[type=text], input[type=tel], input[type=search], textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 14px; font-size: 16px; line-height: 1.3; background: #f8fbfd; color: var(--text);
  appearance: none; -webkit-appearance: none;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus {
  outline: 2px solid #bfe7ee; border-color: var(--accent); background: #fff;
}
.choices { display: grid; gap: 10px; }
.choices.cards { grid-template-columns: 1fr 1fr; }
.choice {
  border: 1px solid var(--line); background: #f8fbfd; border-radius: 16px;
  padding: 22px 14px; text-align: center; cursor: pointer; font: inherit; color: inherit;
  min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.choice .ico { width: 34px; height: 34px; color: var(--navy); }
.choice strong { display: block; font-size: 16px; }
.choice.on { border-color: var(--navy); background: #eef7fb; box-shadow: inset 0 0 0 1px var(--navy); }
.choice.warn .ico { color: #c2410c; }
.choice.warn.on { border-color: #c2410c; background: var(--warn); box-shadow: inset 0 0 0 1px #c2410c; }
.alert {
  background: var(--warn); color: var(--danger); border-radius: 14px; padding: 14px 16px; margin: 14px 0 0;
  font-size: 15px; display: flex; align-items: flex-start; gap: 10px;
}
.alert .ico { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.actions {
  display: flex; gap: 10px; flex: none;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  position: relative;
  z-index: 2;
}
button.primary, button.ghost, button.secondary {
  border: 0; border-radius: 12px; padding: 14px 16px; min-height: 48px;
  font: 650 16px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button.primary { background: var(--navy); color: #fff; flex: 1; }
button.primary:disabled { opacity: .4; cursor: not-allowed; }
button.secondary { background: #e6eef5; color: var(--navy); min-width: 88px; }
button.ghost {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.25);
  min-height: 40px; padding: 8px 12px; font-size: 14px; flex: none;
}
button .ico { width: 18px; height: 18px; }
.select-btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; min-height: 52px; padding: 14px 16px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: #f8fbfd;
  font: 16px/1.3 inherit; color: var(--text); cursor: pointer;
}
.select-btn em { font-style: normal; color: var(--muted); }
.select-btn b { font-weight: 650; }
.select-btn::after { content: "›"; color: var(--muted); font-size: 22px; line-height: 1; }
.sheet-search { margin-bottom: 10px; flex: none; }
.sheet-search input { border: 0; }
.sheet-list {
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid var(--line); border-radius: 14px; overflow: auto;
  min-height: 0; flex: 1 1 0;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}
.sheet-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1 1 0; }
.sheet-list button {
  width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  background: #fff; padding: 16px 16px; min-height: 52px; font: 16px inherit; color: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}
.sheet-list button .ico { color: var(--muted); }
.sheet-list button.on .ico { color: var(--navy); }
.sheet-list button:last-child { border-bottom: 0; }
.sheet-list button.on { background: #eef7fb; font-weight: 650; color: var(--navy); }
.sheet-list .empty { padding: 24px 16px; color: var(--muted); text-align: center; }
.err { color: var(--danger); font-size: 14px; padding: 0 18px 8px; flex: none; }
.err:empty { display: none; }
.ok { text-align: center; padding: 36px 8px 8px; }
.ok .ico.tick {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px;
  background: #e7f7ee; color: var(--ok); display: grid; place-items: center;
  padding: 18px; box-sizing: border-box;
}
.ok p { color: var(--muted); }
.picker {
  position: fixed; inset: 0; z-index: 80; background: #fff;
  display: flex; flex-direction: column;
  height: 100%; height: 100dvh;
  padding-top: var(--safe-t); padding-bottom: var(--safe-b);
  overscroll-behavior: contain;
}
.picker[hidden] { display: none; }
.picker-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px 8px 4px; border-bottom: 1px solid var(--line); flex: none;
}
.picker-bar strong { font-size: 16px; }
.picker-bar button {
  border: 0; background: transparent; color: var(--navy); font: 650 16px inherit;
  padding: 12px 14px; min-height: 44px; cursor: pointer;
}
.picker-spacer { width: 72px; }
.picker-search-wrap { padding: 10px 14px; flex: none; }
.picker-list {
  flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch;
}
.picker-list button {
  display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  background: #fff; padding: 16px 18px; min-height: 52px; font: 16px inherit; cursor: pointer;
}
.picker-list button.on { background: #eef7fb; font-weight: 650; }
@media (max-width: 560px) {
  .grid.two { grid-template-columns: 1fr; }
  h2, .h-ico { font-size: 20px; }
  .pane { padding: 16px 14px 8px; }
}
@media (max-width: 720px) {
  .choices.cards { grid-template-columns: 1fr; }
}
@media (min-width: 720px) {
  body {
    background: radial-gradient(1200px 600px at 10% -10%, #1a5a80 0%, var(--navy) 42%, #08263d 100%);
  }
  .shell { padding: 18px; }
}
body.hsf-nokapat #btn-cancel { display: none !important; }
