/* buttons (registration: 13px/600, padding 12px; secondary actions are text links) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border: 0; background: var(--blue); color: #fff; font-size: var(--fs-btn); font-weight: var(--strong); text-decoration: none; line-height: 1.4; }
html[data-type="makro"] .btn { line-height: 27px; padding: 11px 16px; }
.btn:hover { background: var(--blue-hover); }
.btn:active { background: var(--blue-press); }
.btn.soft { background: var(--soft); color: var(--blue-link); }
.btn.soft:hover { background: var(--soft-hover); }
.btn.danger { background: var(--err); }
.btn.danger:hover { background: #e0404f; }
.btn.sm { padding: 7px 10px; font-size: 12px; }
html[data-type="makro"] .btn.sm { font-size: 15px; line-height: 22px; padding: 7px 12px; }
.btn[disabled] { background: var(--disabled-bg); color: var(--disabled-text); pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.link, .tbtn { background: none; border: 0; color: var(--blue); font-weight: var(--strong); font-size: var(--fs-btn); padding: 0; }
html[data-type="makro"] .link, html[data-type="makro"] .tbtn { font-size: 16px; }
.link:hover, .tbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.tbtn { padding: 4px 0; }
.tbtn.danger, .link.danger { color: var(--err); }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--navy); display: grid; place-items: center; }
.icon-btn:hover { background: var(--soft); }
.icon-btn svg { width: 18px; height: 18px; }

/* panels (registration .panel: grey, padding 20) */
.card { background: var(--panel); padding: 20px; margin-bottom: 16px; display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; }
.card h2 { margin-bottom: 6px; }
.card .rows { display: grid; gap: 2px; font-size: var(--fs-lbl); }
.card .rows b { color: var(--ink-strong); }
.muted { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.site-card { background: var(--panel); padding: 20px; display: grid; gap: 8px; align-content: start; font-size: var(--fs-lbl); }
.site-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.site-card .acts { display: flex; gap: 20px; margin-top: 4px; flex-wrap: wrap; }

/* tags: role = yellow tag like registration, badge = status, chip = info */
.role { display: inline-block; background: var(--role-bg); color: var(--role-text); font-weight: 600; font-size: 11px; padding: 2px 6px; }
html[data-type="makro"] .role { font-size: 13px; padding: 3px 8px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 6px; background: #e8ecf3; color: var(--blue-link); font-weight: 600; }
html[data-type="makro"] .badge { font-size: 13px; padding: 3px 8px; }
.badge.ok { background: #e8f5ee; color: var(--ok); }
.badge.bad { background: #fdecee; color: var(--err); }
.badge.warn { background: #fff4ec; color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: var(--fs-small); padding: 3px 10px; background: var(--soft); color: var(--blue-link); }

/* alerts (registration: tinted box, thin ring, 4px accent bar; info = hint box with white circle icon) */
.alert { --c: var(--blue); --bg: var(--info); display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 14px 14px; margin-bottom: 20px; background: var(--bg); border-left: 4px solid var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent); font-size: 14px; line-height: 1.45; color: var(--ink-strong); animation: fade .3s; }
html[data-type="makro"] .alert { font-size: 16px; line-height: 24px; }
.alert svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; color: var(--c); }
.alert b { display: block; }
.alert.ok { --c: var(--ok); --bg: #eef7f2; }
.alert.err { --c: var(--err); --bg: #fdf0f1; }
.alert.warn { --c: var(--warn); --bg: #fff6ea; }
.alert.info { --tag: 26px; border-left: 0; box-shadow: none; padding: 12px; font-size: 13px; line-height: 1.5; gap: 8px; }
html[data-type="makro"] .alert.info { font-size: 16px; line-height: 24px; --tag: 30px; }
.alert.info svg { width: var(--tag); height: var(--tag); margin: 0; padding: 5px; border-radius: 50%; background: #fff; color: var(--navy); }
.alert.info > div { padding-top: calc((var(--tag) - 1lh) / 2); }
.alert .tbtn { margin-top: 4px; }

/* loading / empty */
.loading { background: var(--panel); padding: 48px; display: flex; justify-content: center; gap: 10px; }
.loading i { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #ececec; animation: pulse 1.2s infinite ease-in-out; }
.loading i:nth-child(2) { animation-delay: .2s; } .loading i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .35; } 40% { opacity: 1; } }
.empty { background: var(--panel); padding: 40px 24px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.empty h2 { font-size: 18px; line-height: 24px; }
.empty p { max-width: 420px; color: var(--ink); margin-bottom: 8px; }

/* table */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-lbl); }
.tbl th { text-align: left; font-size: var(--fs-small); color: var(--muted); font-weight: 400; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .acts { display: flex; flex-direction: column; align-items: flex-start; white-space: nowrap; }
.tbl .email { overflow-wrap: anywhere; font-weight: var(--strong); color: var(--ink-strong); }

/* forms (registration: bold 13px labels, 44px fields, dark custom checkbox/radio, white tiles) */
.fld { display: grid; gap: 0; margin-bottom: 16px; }
.fld > label, .lbl-t { font-weight: var(--strong); font-size: var(--fs-lbl); color: var(--ink-strong); margin: 0 0 6px; display: block; }
.fld > label .muted { font-weight: 400; }
.fld input[type=text], .fld input[type=email], .fld input[type=tel], .fld input[type=time], .fld select, .fld textarea {
  width: 100%; height: var(--field-h); border: 1px solid var(--line); padding: 0 12px; font: inherit; background: #fff; color: var(--ink-strong); border-radius: 0;
}
.fld textarea { padding: 10px 12px; height: auto; min-height: 72px; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; }
.fld.bad input, .fld.bad select { border-color: var(--err); }
.fld .err { color: var(--err); font-size: var(--fs-small); margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=checkbox], input[type=radio] { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; border: 1.5px solid #b9b9bd; margin: 1px 0 0; flex: 0 0 auto; display: grid; place-items: center; background: #fff; cursor: pointer; }
input[type=checkbox] { border-radius: 3px; }
input[type=radio] { border-radius: 50%; width: 18px; height: 18px; }
input[type=checkbox]:checked, input[type=radio]:checked { background: var(--ink); border-color: var(--ink); }
input[type=checkbox]:checked::after, input[type=radio]:checked::after { content: "✓"; color: #fff; font-size: 11px; line-height: 1; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tile { display: flex; gap: 12px; align-items: flex-start; border: 2px solid transparent; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 0 4px rgba(0,0,0,.06); }
.tile:has(input:checked) { border-color: #005ae0; }
.tile b { display: block; color: var(--ink-strong); font-size: var(--fs-lbl); }
.tile span { color: var(--ink); font-size: var(--fs-small); }
.tiles { background: var(--panel); padding: 16px; margin-bottom: 16px; }
.tiles .tile:last-child { margin-bottom: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; cursor: pointer; font-size: var(--fs-lbl); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { cursor: pointer; }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days span { display: grid; place-items: center; width: 44px; height: 36px; border: 1px solid var(--line); background: #fff; font-size: var(--fs-lbl); }
.days input:checked + span { background: var(--soft); border-color: var(--blue); color: var(--blue-link); font-weight: var(--strong); }
.days input:focus-visible + span { outline: 2px solid var(--blue); }
.sug { border: 1px solid var(--line); background: #fff; margin-top: -1px; }
.sug button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 10px 12px; }
.sug button:hover { background: var(--info); }
.map { position: relative; height: 160px; background: #e9eef3 repeating-linear-gradient(0deg, transparent 0 31px, #d6dde5 31px 32px), repeating-linear-gradient(90deg, transparent 0 31px, #d6dde5 31px 32px); border: 1px solid var(--line); touch-action: none; overflow: hidden; }
.map .pin { position: absolute; width: 28px; height: 28px; transform: translate(-50%, -100%); color: var(--err); cursor: grab; }
.map small { position: absolute; left: 8px; bottom: 6px; color: var(--muted); background: rgba(255,255,255,.85); padding: 0 4px; }

/* dialog / bottom sheet (registration: 32px padding, 22px title, square grey close, dark overlay) */
.ov { position: fixed; inset: 0; background: var(--overlay); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.dlg { background: #fff; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; padding: 32px; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.dlg.wide { max-width: 600px; }
.dlg-h { margin-bottom: 16px; padding-right: 32px; }
.dlg-h h2 { margin: 0 0 12px; font-size: 22px; line-height: 28px; color: var(--heading); }
html[data-type="makro"] .dlg-h h2 { font-size: 24px; line-height: 32px; }
.dlg-h p { font-size: var(--fs-base); line-height: 22px; }
.dlg .x { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border: 0; background: #efeff0; display: grid; place-items: center; color: var(--ink-strong); }
.dlg .x svg { width: 14px; height: 14px; }
.dlg-f { display: flex; align-items: center; gap: 24px; margin-top: 28px; flex-wrap: wrap; }
.grab { display: none; }
@media (max-width: 768px) {
  .ov { place-items: end stretch; padding: 0; }
  .dlg, .dlg.wide { max-width: none; max-height: 90vh; padding: 12px 16px 20px; animation: up .2s; }
  .grab { display: block; width: 40px; height: 4px; background: #c4c9d0; margin: 0 auto 12px; border-radius: 2px; }
  .dlg-f { flex-direction: column-reverse; align-items: stretch; gap: 16px; text-align: center; }
  .dlg-f .btn { width: 100%; min-height: 48px; font-size: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .card:not(:has(> .icon-btn)) { flex-direction: column; }
  .head .btn { width: 100%; min-height: 48px; font-size: 16px; }
  /* table -> cards */
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { background: var(--panel); padding: 12px 16px; margin-bottom: 12px; }
  .tbl td { border: 0; padding: 3px 0; }
  .tbl td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-small); color: var(--muted); }
  .tbl td.acts-td { margin-top: 8px; }
  .tbl .acts { flex-direction: row; flex-wrap: wrap; gap: 20px; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* menu hub (mobile) */
.hub-a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--ink-strong); font-weight: var(--strong); text-decoration: none; }
.hub-a svg, .hub-a > img { width: 22px; height: 22px; color: var(--navy); flex: none; }
.hub-a::after { content: "›"; margin-left: auto; font-size: 22px; color: var(--muted); }
.hub-g { font-size: var(--fs-small); color: var(--muted); margin: 20px 0 2px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink-strong); color: #fff; padding: 12px 20px; z-index: 200; animation: fade .2s; max-width: calc(100vw - 32px); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
