/* Kingdom Guard calculators — kgcalc.ru layout (Mantine components) in the site's parchment style */
.calc-main { padding-top: 1.5rem; padding-bottom: 3rem; }
.kgc-shell { padding: 26px 28px 32px !important; }
#kgc-app, .kgc-modal-root, .kgc-pop, .kgc-toasts {
  --kgc-ink: var(--navy, #163a6b);
  --kgc-mute: var(--mute, #4a5d7a);
  --kgc-line: #e3cf96;
  --kgc-line-soft: #efe2bd;
  --kgc-field: #fffefa;
  --kgc-accent: #1f6fe0;
  --kgc-accent-hi: #4f9fff;
  --kgc-green: #2f9e44;
  --kgc-red: #e03131;
  --kgc-gold: var(--gold, #e0b12a);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--kgc-ink);
}
#kgc-app *, .kgc-modal-root *, .kgc-pop * { box-sizing: border-box; }
#kgc-app p { margin: 0; }

/* ---------- sections (kgcalc navbar, 4 sections) ---------- */
.kgc-sections { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.kgc-sec {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px;
  border-radius: 12px; border: 2px solid var(--kgc-line); background: #fffdf6;
  color: var(--kgc-ink) !important; text-decoration: none !important; font-weight: 700; font-size: 14px; line-height: 1.2;
  box-shadow: 0 2px 0 rgba(201, 146, 18, 0.25);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.kgc-sec:hover { transform: translateY(-1px); background: #fff; }
.kgc-sec.is-active { background: linear-gradient(180deg, #fff3c4, #f8dd82); border-color: var(--gold-deep, #c99212); box-shadow: 0 3px 0 var(--gold-deep, #c99212); }
.kgc-sec .kgc-ic { flex: 0 0 auto; }

/* ---------- identity ---------- */
.kgc-idbar { margin: 0 0 12px; border: 1px solid var(--kgc-line); border-radius: 12px; background: rgba(255, 253, 246, 0.9); }
.kgc-idbar > summary { cursor: pointer; list-style: none; padding: 9px 14px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.kgc-idbar > summary::-webkit-details-marker { display: none; }
.kgc-idbar > summary::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #adb5bd; flex: 0 0 auto; }
.kgc-idbar.is-ok > summary::before { background: var(--kgc-green); }
.kgc-idbar.is-warn > summary::before { background: #f08c00; }
.kgc-id-body { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 2px 14px 12px; }
.kgc-id-body label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; font-size: 13px; color: var(--kgc-mute); }
.kgc-id-body input { height: 36px; padding: 0 10px; border: 1px solid #d6c79e; border-radius: 8px; background: #fff; color: var(--kgc-ink); font: inherit; }
.kgc-id-body input[readonly] { background: #f6f1e3; }

.kgc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--kgc-mute); margin: 2px 0 2px; }
.kgc-crumbs a { color: var(--kgc-accent); text-decoration: none; }
.kgc-crumbs a:hover { text-decoration: underline; }
.kgc-page-title.gold-title { font-size: clamp(22px, 3vw, 32px) !important; margin: 4px 0 18px !important; line-height: 1.15; }
.kgc-page { min-height: 120px; }

/* ---------- Mantine-ish layout ---------- */
.kgc-stack { display: flex; flex-direction: column; }
.kgc-group { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; }
.kgc-group.is-tight { gap: 0 !important; flex-wrap: nowrap; }
.kgc-group.is-center { align-items: center; }
.kgc-grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 75em) { .kgc-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kgc-title { margin: 0; color: var(--kgc-ink); font-family: "Manrope", system-ui, sans-serif; font-weight: 700; line-height: 1.3; }
.kgc-t3 { font-size: 22px; }
.kgc-t4 { font-size: 18px; }
.kgc-t5 { font-size: 16px; }
.kgc-t6 { font-size: 14px; }
.kgc-divider { border: 0; border-top: 1px solid var(--kgc-line-soft); margin: 0; width: 100%; }
.kgc-divider.is-md { border-top-width: 2px; }
.kgc-divider.is-xs { border-top-width: 1px; }
.kgc-fw600 { font-weight: 600; }
.kgc-c-red { color: var(--kgc-red); }
.kgc-c-green { color: var(--kgc-green); }
.kgc-c-purple { color: #9c36b5; }
.kgc-new { color: var(--kgc-green); font-weight: 700; }
.kgc-row4 { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.kgc-text + .kgc-text { margin-top: 6px; }
.kgc-muted { color: var(--kgc-mute); }

.kgc-alert { border-radius: 10px; padding: 12px 14px; background: #e7f0ff; border: 1px solid #b9d3ff; color: #123a73; font-size: 14px; }
.kgc-alert.is-red { background: #fff0f0; border-color: #ffc9c9; color: #a61e1e; }
.kgc-alert.is-yellow { background: #fff8e1; border-color: #ffe08a; color: #6b4f00; }
.kgc-alert.is-green { background: #ebfbee; border-color: #b2f2bb; color: #1f6b33; }
.kgc-alert-title { font-weight: 700; margin-bottom: 4px; }

.kgc-fieldset { border: 1px solid var(--kgc-line); border-radius: 10px; padding: 12px 14px 14px; margin: 0; background: rgba(255, 255, 255, 0.55); min-width: 0; }
.kgc-fieldset > legend { padding: 0 6px; font-weight: 700; font-size: 15px; }

.kgc-loader { display: flex; justify-content: center; padding: 28px 0; }
.kgc-spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(31, 111, 224, 0.2); border-top-color: var(--kgc-accent); animation: kgc-spin .8s linear infinite; display: inline-block; flex: 0 0 auto; }
@keyframes kgc-spin { to { transform: rotate(360deg); } }

/* ---------- icons (kgcalc `j`) ---------- */
.kgc-ic { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: 0 0 auto; vertical-align: middle; }
.kgc-ic-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; border-radius: 6px; }
.kgc-ic-img { position: relative; max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.kgc-ic-fade { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 2; border-radius: 6px; }
.kgc-ic.is-disabled { filter: grayscale(1); opacity: .55; }

/* ---------- inputs ---------- */
.kgc-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kgc-field-label { font-size: 14px; font-weight: 500; color: var(--kgc-ink); }
.kgc-field-desc { font-size: 12px; color: var(--kgc-mute); }
.kgc-ni, .kgc-ti { position: relative; display: flex; align-items: stretch; min-width: 0; height: 36px; border: 1px solid #d6c79e; border-radius: 6px; background: var(--kgc-field); transition: border-color .1s ease, box-shadow .1s ease; }
.kgc-ni:focus-within, .kgc-ti:focus-within { border-color: var(--kgc-accent); box-shadow: 0 0 0 2px rgba(31, 111, 224, .15); }
.kgc-ni.is-disabled { background: #f1ede1; opacity: .75; }
.kgc-ni-input, .kgc-ti-input { flex: 1 1 auto; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; padding: 0 10px; font: inherit; font-size: 14px; color: var(--kgc-ink); }
.kgc-ni.has-left .kgc-ni-input, .kgc-ti.has-left .kgc-ti-input { padding-left: 4px; }
.kgc-ni-left { display: flex; align-items: center; justify-content: center; width: 36px; flex: 0 0 36px; }
.kgc-ni-left .kgc-ic { width: 28px; height: 28px; }
.kgc-ni-ctrl { display: flex; flex-direction: column; width: 22px; flex: 0 0 22px; border-left: 1px solid #eadfbe; }
.kgc-ni-ctrl button { flex: 1 1 50%; border: 0; background: transparent; cursor: pointer; padding: 0; position: relative; }
.kgc-ni-ctrl button:hover:not(:disabled) { background: rgba(31, 111, 224, .08); }
.kgc-ni-ctrl button::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border-left: 1.5px solid #7b8aa3; border-top: 1.5px solid #7b8aa3; transform: translate(-50%, -25%) rotate(45deg); }
.kgc-ni-ctrl .kgc-ni-down::after { transform: translate(-50%, -75%) rotate(225deg); }
.kgc-ni-ctrl button:disabled { cursor: default; opacity: .4; }
.kgc-select { height: 36px; border: 1px solid #d6c79e; border-radius: 6px; background: var(--kgc-field); padding: 0 8px; font: inherit; font-size: 14px; color: var(--kgc-ink); }

/* resource input views (kgcalc `k`) */
/* kgcalc `k` default view: flex 1 1 33% (3 per row) — only meaningful in a row */
.kgc-group > .kgc-res-default { flex: 1 1 33%; }
.kgc-stack > * { flex-shrink: 0; }
.kgc-res { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.kgc-res-bigIconLabel { gap: 6px; text-align: center; }
.kgc-res-label { font-size: 13px; max-width: 160px; }
.kgc-param-big { display: flex; flex-direction: column; align-items: center; gap: 4px; }

/* parameter display `Je` */
.kgc-pdisp { display: inline-flex; align-items: center; gap: 8px; }
.kgc-pdisp.is-big { flex-direction: column; gap: 4px; }

/* result rows `W` / `je` */
.kgc-rrow { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kgc-rrow .kgc-ic { width: 32px; height: 32px; }
.kgc-conv { display: grid; grid-template-columns: 40px minmax(0, 1fr) 20px minmax(0, 1fr) 40px; align-items: center; gap: 4px; max-width: 350px; text-align: center; font-variant-numeric: tabular-nums; }
.kgc-conv-ic { display: flex; justify-content: center; }

/* ---------- switch (Mantine Switch) ---------- */
.kgc-sw { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; min-height: 24px; }
.kgc-sw-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.kgc-sw-track { order: 1; position: relative; flex: 0 0 38px; width: 38px; height: 20px; border-radius: 999px; background: #e3dccb; border: 1px solid #cfc3a2; transition: background .15s ease, border-color .15s ease; }
.kgc-sw-thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s ease; }
.kgc-sw-input:checked + .kgc-sw-track { background: var(--kgc-accent); border-color: var(--kgc-accent); }
.kgc-sw-input:checked + .kgc-sw-track .kgc-sw-thumb { left: 20px; }
.kgc-sw-input:focus-visible + .kgc-sw-track { box-shadow: 0 0 0 2px rgba(31, 111, 224, .35); }
.kgc-sw-input:disabled + .kgc-sw-track { opacity: .5; }
.kgc-sw-label { order: 2; flex: 1 1 auto; font-size: 16px; line-height: 1.55; }
.kgc-sw-lbl { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.kgc-setting { padding: 2px 0; }

/* «?» help (kgcalc `Ie`) + popover */
.kgc-help { flex: 0 0 auto; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 0; background: transparent; color: #1d2b44; cursor: help; padding: 0; }
.kgc-help:hover { background: rgba(31, 111, 224, .08); color: var(--kgc-accent); }
.kgc-pop { position: absolute; z-index: 1000; background: #fff; color: #1d2b44; border: 1px solid #e0d6b8; border-radius: 8px; box-shadow: 0 8px 24px rgba(20, 40, 80, .18); font-family: "Manrope", system-ui, sans-serif; font-size: 14px; line-height: 1.45; }
.kgc-pop-body { padding: 10px 14px; }
.kgc-pop-body p + p { margin-top: 6px; }
.kgc-pop-body p { margin: 0; }
.kgc-pop-arrow { position: absolute; top: -6px; width: 12px; height: 12px; background: #fff; border-left: 1px solid #e0d6b8; border-top: 1px solid #e0d6b8; transform: rotate(45deg); }

/* priority element `Tt` + segmented */
.kgc-prio { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kgc-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: #efe6cc; flex-wrap: wrap; max-width: 100%; }
.kgc-seg.is-full { display: flex; width: 100%; }
.kgc-seg.is-full .kgc-seg-item { flex: 1 1 0; }
.kgc-seg.is-vertical { flex-direction: column; }
.kgc-seg-item { border: 0; border-radius: 6px; background: transparent; padding: 4px 10px; min-height: 32px; font: inherit; font-size: 14px; font-weight: 600; color: var(--kgc-mute); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.kgc-seg.is-xs .kgc-seg-item { padding: 2px 6px; }
.kgc-seg-item.is-active { background: #fff; color: var(--kgc-ink); box-shadow: 0 1px 3px rgba(60, 40, 0, .18); }
.kgc-seg-item:disabled { opacity: .45; cursor: default; }

/* tabs */
.kgc-tabs-list { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--kgc-line-soft); margin-bottom: 12px; }
.kgc-tab { border: 0; background: transparent; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--kgc-mute); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; display: inline-flex; align-items: center; gap: 6px; }
.kgc-tab:hover { background: rgba(224, 177, 42, .08); }
.kgc-tab.is-active { color: var(--kgc-ink); border-bottom-color: var(--kgc-accent); }

/* accordion */
.kgc-acc { border: 1px solid var(--kgc-line); border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .6); }
.kgc-acc > .kgc-acc-item + .kgc-acc-item { border-top: 1px solid var(--kgc-line-soft); }
.kgc-acc-ctrl { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 15px; color: var(--kgc-ink); cursor: pointer; text-align: left; }
.kgc-acc-label { flex: 1 1 auto; }
.kgc-acc-chev { width: 8px; height: 8px; border-right: 2px solid #7b8aa3; border-bottom: 2px solid #7b8aa3; transform: rotate(45deg); transition: transform .15s ease; margin-right: 4px; }
.kgc-acc-item.is-open > .kgc-acc-ctrl > .kgc-acc-chev { transform: rotate(225deg); }
.kgc-acc-body { display: none; padding: 4px 14px 14px; }
.kgc-acc-item.is-open > .kgc-acc-body { display: block; }

/* buttons */
.kgc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent; background: var(--kgc-accent, #1f6fe0); color: #fff; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; transition: filter .1s ease, transform .1s ease; }
.kgc-btn:hover:not(:disabled) { filter: brightness(1.06); }
.kgc-btn:active:not(:disabled) { transform: translateY(1px); }
.kgc-btn:disabled { background: #d9d3c2; color: #8b8573; cursor: not-allowed; }
.kgc-btn.is-small { min-height: 32px; padding: 0 14px; font-size: 13px; }
.kgc-btn.is-light { background: #e7f0ff; color: var(--kgc-accent); }
.kgc-btn.is-outline { background: #fff; color: var(--kgc-accent); border-color: var(--kgc-accent); }
.kgc-btn.is-subtle { background: transparent; color: var(--kgc-accent); }
.kgc-btn.is-red { background: #e03131; }
.kgc-btn.is-green { background: var(--kgc-green); }
.kgc-calc-row { display: flex; justify-content: center; }
.kgc-calc-btn { width: 100%; min-height: 42px; font-size: 16px; font-weight: 600; border-radius: 999px; border: 2px solid #d4af37;
  background: linear-gradient(180deg, #7af0a8 0%, #3dce72 42%, #249a52 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 4px 0 #1a6f3a, 0 10px 16px rgba(30, 120, 60, .22);
  text-shadow: 0 1px 0 rgba(0, 60, 20, .35); }
.kgc-calc-btn:disabled { background: #d9d3c2; border-color: #cfc3a2; box-shadow: none; text-shadow: none; }
.kgc-calc-btn.is-loading span { opacity: .7; }
@media (min-width: 75em) { .kgc-calc-btn { width: 50%; } }

/* tables */
.kgc-table-wrap { overflow-x: auto; max-width: 100%; }
.kgc-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; font-variant-numeric: tabular-nums; }
.kgc-table th, .kgc-table td { border: 1px solid #e7dcbb; padding: 7px 10px; text-align: left; vertical-align: middle; }
.kgc-table th { background: #fbf4df; font-weight: 700; }
.kgc-table.is-center td, .kgc-table.is-center th { text-align: center; }

/* hub cards (kgcalc `H`) */
.kgc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; justify-items: center; }
@media (min-width: 48em) { .kgc-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 88em) { .kgc-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kgc-card { width: 160px; height: 160px; max-width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px;
  border-radius: 14px; border: 2px solid var(--kgc-line); background: linear-gradient(180deg, #fffefa, #f8eed6); text-decoration: none !important;
  color: #111 !important; box-shadow: 0 3px 0 rgba(201, 146, 18, .3), 0 8px 18px rgba(20, 60, 120, .08); transition: transform .12s ease, box-shadow .12s ease; text-align: center; }
.kgc-card:hover { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(201, 146, 18, .35), 0 12px 22px rgba(20, 60, 120, .12); }
.kgc-card-ic .kgc-ic { width: 64px; height: 64px; }
.kgc-card-label { font-weight: 700; font-size: 15px; line-height: 1.2; }
.kgc-card.is-disabled { opacity: .5; filter: grayscale(.7); cursor: not-allowed; box-shadow: none; }

/* ---------- UP / MK blocks ---------- */
.kgc-pts { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kgc-pts-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kgc-pts-total { font-size: 16px; }
.kgc-pts-modules { display: flex; flex-direction: column; gap: 4px; padding-left: 48px; }
@media (max-width: 480px) { .kgc-pts-modules { padding-left: 0; } }
.kgc-pts-mod { display: flex; flex-direction: column; gap: 8px; }
.kgc-pts-mod-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.kgc-pts-rows { display: flex; flex-direction: column; gap: 4px; }
.kgc-pts-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-variant-numeric: tabular-nums; }
.kgc-pts-row .kgc-ic { width: 32px; height: 32px; }

/* ---------- toasts (Mantine notifications, top-center) ---------- */
.kgc-toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.kgc-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 160px; max-width: min(440px, 92vw); padding: 10px 14px 10px 10px; background: #fff; border-radius: 8px; box-shadow: 0 6px 22px rgba(20, 40, 80, .2); font-family: "Manrope", system-ui, sans-serif; font-size: 14px; color: #1d2b44; margin: 0 auto; }
.kgc-toast-bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--kgc-accent, #1f6fe0); flex: 0 0 4px; }
.kgc-toast.is-green .kgc-toast-bar { background: #2f9e44; }
.kgc-toast.is-red .kgc-toast-bar { background: #e03131; }
.kgc-toast-title { font-weight: 700; }

/* ---------- modal ---------- */
body.kgc-modal-open { overflow: hidden; }
.kgc-modal-root { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; }
.kgc-modal-overlay { position: absolute; inset: 0; background: rgba(10, 20, 40, .45); }
.kgc-modal { position: relative; width: 440px; max-width: 100%; max-height: 88vh; overflow: auto; background: #fffdf6; border-radius: 12px; border: 2px solid var(--gold, #e0b12a); box-shadow: 0 18px 50px rgba(0, 0, 0, .3); font-family: "Manrope", system-ui, sans-serif; color: var(--navy, #163a6b); font-size: 15px; }
.kgc-modal.is-lg { width: 640px; }
.kgc-modal.is-xl { width: 860px; }
.kgc-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; position: sticky; top: 0; background: #fffdf6; z-index: 1; }
.kgc-modal-title { font-weight: 700; font-size: 17px; }
.kgc-modal-close { border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: #7b8aa3; padding: 2px 6px; border-radius: 6px; }
.kgc-modal-close:hover { background: rgba(0, 0, 0, .05); }
.kgc-modal-body { padding: 8px 16px 16px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .kgc-shell { padding: 18px 14px 24px !important; }
  .kgc-sections { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .kgc-sec { flex-direction: column; justify-content: center; gap: 4px; text-align: center; font-size: 11.5px; padding: 6px 4px; min-height: 64px; }
}
@media (max-width: 480px) {
  .kgc-sec span { font-size: 10.5px; }
  .kgc-cards { gap: 10px; }
  .kgc-card { width: 100%; height: 140px; }
}
body.calc-tg .top, body.calc-tg .foot { display: none; }
body.calc-tg .calc-main { padding-top: .6rem; padding-bottom: 1.2rem; }
.kgc-fw700 { font-weight: 700; }
.kgc-lg { font-size: 18px; }
/* narrow screens: long «source − spent = left» rows wrap instead of widening the page */
@media (max-width: 560px) {
  .kgc-rrow { flex-wrap: wrap; white-space: normal; row-gap: 0; }
  .kgc-pts-head { flex-wrap: wrap; }
}

/* the site styles `.frame p { color: navy !important }`: keep our own colours inside the app */
#kgc-app p, .kgc-modal-root p, .kgc-pop p { color: inherit !important; }
#kgc-app .kgc-c-red, .kgc-modal-root .kgc-c-red { color: var(--kgc-red, #e03131) !important; }
#kgc-app .kgc-c-green, .kgc-modal-root .kgc-c-green { color: var(--kgc-green, #2f9e44) !important; }
#kgc-app .kgc-c-purple, .kgc-modal-root .kgc-c-purple { color: #9c36b5 !important; }
#kgc-app .kgc-new { color: var(--kgc-green, #2f9e44) !important; }
/* wide tables scroll inside the page instead of widening it (site grid lacks min-width: 0) */
.calc-main > .wrap { min-width: 0; }
.kgc-shell, #kgc-app, .kgc-page { min-width: 0; max-width: 100%; }
.kgc-modal-root.is-centered { align-items: center; padding-top: 12px; }
/* site tables use uppercase headers; kgcalc tables do not */
#kgc-app th, #kgc-app td, .kgc-modal-root th, .kgc-modal-root td { text-transform: none; letter-spacing: normal; }

/* site `.frame h3 {… !important}` and `th {…}` styles must not leak into the app */
#kgc-app .kgc-title, .kgc-modal-root .kgc-title { font-family: "Manrope", system-ui, sans-serif !important; font-weight: 700 !important; color: var(--kgc-ink) !important; letter-spacing: normal !important; text-transform: none !important; }
.kgc-t2 { font-size: 26px; }
#kgc-app th, .kgc-modal-root th { font-family: "Manrope", system-ui, sans-serif !important; font-size: 14px !important; font-weight: 700 !important; color: var(--kgc-ink) !important; }
/* modal sizes (Mantine size 600, fullScreen on phones) */
.kgc-modal.is-600 { width: 600px; }
@media (max-width: 575px) {
  .kgc-modal-root.is-fs-mobile { padding: 0; }
  .kgc-modal-root.is-fs-mobile .kgc-modal { width: 100%; height: 100%; max-height: 100vh; border-radius: 0; border-width: 0; }
}

/* the site lifts `.frame` cards on hover; the calculator shell must stay put */
.kgc-shell, .kgc-shell:hover { transform: none !important; }
.kgc-shell:hover {
  box-shadow:
    inset 0 2px 0 #fff,
    inset 0 -10px 16px rgba(80, 50, 0, 0.06),
    0 4px 0 #d4a21a,
    0 10px 0 #b8860f,
    0 18px 28px rgba(20, 60, 140, 0.16) !important;
}
/* character / data-from-the-bot bar */
.kgc-profile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: -4px 0 12px; padding: 10px 14px; border: 1px solid var(--kgc-line); border-radius: 12px; background: rgba(255, 253, 246, .9); font-size: 14px; }
.kgc-profile[hidden] { display: none; }
.kgc-profile-field { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.kgc-profile-sel { max-width: min(420px, 70vw); min-width: 200px; }
.kgc-profile-info { flex: 1 1 220px; color: var(--kgc-mute); display: inline-flex; align-items: center; gap: 8px; }
.kgc-profile-info.is-error { color: #a61e1e; }
.kgc-profile-info .kgc-spinner { width: 16px; height: 16px; border-width: 2px; }
@media (max-width: 560px) { .kgc-profile-field { flex-wrap: wrap; } .kgc-profile-sel { min-width: 0; width: 100%; max-width: 100%; } }
.kgc-profile-note { flex: 1 1 100%; font-size: 13px; color: var(--kgc-mute); }

/* ---------- licence screen: the calculators are for licence owners and the trial (24.09.2026) ---------- */
.kgc-lock { max-width: 640px; margin: 8px auto; padding: 28px 24px; text-align: center; border: 1px solid var(--kgc-line, #e3cf96);
  border-radius: 12px; background: #fffdf6; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.kgc-lock-title { font-weight: 700; font-size: 20px; line-height: 1.3; }
.kgc-lock-text { margin: 12px 0 20px !important; color: var(--kgc-mute, #4a5d7a); }
.kgc-lock-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.kgc-lock-actions a.kgc-btn { text-decoration: none !important; color: #fff !important; }
.kgc-lock-actions a.kgc-btn.is-outline { color: var(--kgc-accent, #1f6fe0) !important; }
@media (max-width: 480px) { .kgc-lock { padding: 22px 16px; } .kgc-lock-actions .kgc-btn { width: 100%; } }

/* ours: the season typed in when no character is connected (the site) */
.kgc-season-form { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.kgc-season-form .kgc-season-in { width: 200px; }
.kgc-season-form [role="alert"]:empty { display: none; }
.kgc-season-form [role="alert"] { flex-basis: 100%; text-align: center; color: #a61e1e; font-size: 14px; }
