:root {
  --mh-primary: #007bee;
  --mh-primary-light: #4da3ff;
  --mh-navy: #002752;
  --text: #f0f6ff;
  --muted: #b8c2d0;
  --line: rgba(77, 163, 255, .26);
  --radius: 12px;
  --radius-pill: 999px;
  --sidebar-width: 280px;
  --shadow: 0 22px 70px rgba(0, 17, 39, .3);
  --display-font: "Paytone One", Inter, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; min-height: 100vh; position: relative; overflow-x: hidden; background: var(--mh-navy); color: var(--text); font: 15px/1.6 Inter, system-ui, sans-serif; }
body::before, body::after { content: ""; position: absolute; pointer-events: none; top: 0; right: -18px; left: -18px; z-index: 0; mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%); }
body::before { top: -18px; height: 1080px; background: url("https://storage.minehub.cz/storage/minehub/backgrounds/background_main.webp") center top / cover no-repeat; filter: blur(3px); opacity: .72; transform: scale(1.02); }
body::after { height: 1020px; background: rgba(0, 39, 82, .58); }
button, input { font: inherit; }
textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.material-symbols-outlined { font-size: 21px; line-height: 1; }
.shell { position: relative; z-index: 1; }

.language-picker { position: relative; z-index: 10; }
.language-picker summary { min-width: 132px; display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 39, 82, .88); color: var(--text); cursor: pointer; font-size: .78rem; font-weight: 700; list-style: none; }
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker img { display: block; flex: 0 0 16px; width: 16px; height: 16px; object-fit: contain; image-rendering: pixelated; }
.language-picker .chevron { margin-left: auto; color: var(--mh-primary-light); font-size: 18px; transition: transform .2s; }
.language-picker[open] .chevron { transform: rotate(180deg); }
.language-menu { position: absolute; top: calc(100% + 7px); right: 0; display: grid; min-width: 170px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 28, 60, .98); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.language-menu button { display: flex; align-items: center; gap: 9px; padding: 9px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: .78rem; font-weight: 700; transition: background .15s, color .15s; }
.language-menu button:hover { background: rgba(0, 123, 238, .12); color: #fff; }
.language-menu button[aria-current="true"] { background: rgba(0, 123, 238, .18); color: #fff; box-shadow: inset 3px 0 0 var(--mh-primary-light); }
.menu-toggle, .sidebar-close { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 39, 82, .88); color: var(--text); cursor: pointer; }

.page-layout { width: 100%; margin: 0; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); gap: 32px; padding: 28px 32px 42px; }
.sidebar-column { position: sticky; top: 28px; align-self: start; width: 100%; height: calc(100vh - 56px); max-height: calc(100vh - 56px); display: grid; grid-template-rows: minmax(0, auto) minmax(238px, 1fr); gap: 14px; overflow: hidden; scrollbar-width: none; -ms-overflow-style: none; }
.sidebar-column::-webkit-scrollbar { display: none; }
.sidebar { min-height: 0; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 31, 66, .78); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025); backdrop-filter: blur(12px); scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
.sidebar-head { display: none; }
.sidebar nav { display: grid; gap: 3px; }
.nav-link { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius); color: #d8e2ef; font-size: .84rem; font-weight: 600; text-decoration: none; transition: background .15s, color .15s, box-shadow .15s; }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link.active { background: rgba(0, 123, 238, .2); color: #fff; box-shadow: inset 3px 0 0 var(--mh-primary-light); }
.nav-link .material-symbols-outlined { color: var(--mh-primary-light); }
.nav-count { color: #8295ab; font-size: .67rem; font-weight: 800; }
.aida-chat { min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 31, 66, .78); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025); backdrop-filter: blur(12px); }
.aida-head { display: grid; grid-template-columns: 35px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.aida-avatar { width: 35px; height: 35px; display: block; border-radius: 9px; object-fit: cover; image-rendering: pixelated; image-rendering: crisp-edges; }
.aida-head strong, .aida-head span { display: block; }
.aida-head strong { font-size: .84rem; line-height: 1.2; }
.aida-head div > span { color: var(--muted); font-size: .67rem; }
.aida-expand { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 123, 238, .12); color: var(--mh-primary-light); cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.aida-expand .material-symbols-outlined { font-size: 17px; }
.aida-expand:hover { border-color: var(--mh-primary-light); background: rgba(0, 123, 238, .25); color: #fff; }
.aida-expand:focus-visible { outline: 2px solid var(--mh-primary-light); outline-offset: 2px; }
.aida-messages { min-height: 48px; flex: 1; margin: 10px -3px 8px 0; padding-right: 3px; overflow-y: auto; display: grid; align-content: start; gap: 7px; scrollbar-width: thin; scrollbar-color: rgba(77, 163, 255, .45) transparent; }
.aida-message { width: fit-content; max-width: 92%; margin: 0; padding: 8px 10px; border-radius: 10px 10px 10px 3px; background: rgba(255, 255, 255, .08); color: #dce6f2; font-size: .72rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.aida-message.user { justify-self: end; border-radius: 10px 10px 3px 10px; background: rgba(0, 123, 238, .38); color: #fff; }
.aida-message.pending { color: var(--muted); font-style: italic; }
.aida-message.error { border: 1px solid rgba(255, 130, 152, .36); background: rgba(120, 18, 38, .25); color: #ffc3ce; }
.aida-rule-link { display: inline-block; margin: 0 1px; padding: 0 4px; border: 1px solid rgba(77, 163, 255, .55); border-radius: 5px; background: rgba(77, 163, 255, .14); color: #a8d3ff; font-weight: 800; line-height: 1.35; text-decoration: none; transition: color .15s, background .15s, border-color .15s; }
.aida-rule-link:hover { border-color: var(--mh-primary-light); background: rgba(77, 163, 255, .28); color: #fff; }
.aida-rule-link:focus-visible { outline: 2px solid var(--mh-primary-light); outline-offset: 2px; }
.rule-card.aida-target { background: rgba(0, 123, 238, .26); box-shadow: inset 3px 0 0 var(--mh-primary-light), 0 0 22px rgba(77, 163, 255, .22); }
.aida-form { display: grid; gap: 7px; }
.aida-form textarea { width: 100%; min-height: 58px; max-height: 130px; resize: vertical; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: rgba(0, 24, 52, .82); color: #fff; font-size: .72rem; line-height: 1.4; transition: border-color .15s, box-shadow .15s; }
.aida-form textarea::placeholder { color: #8295ab; }
.aida-form textarea:focus { border-color: var(--mh-primary-light); box-shadow: 0 0 0 3px rgba(0, 123, 238, .16); }
.aida-form button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 35px; padding: 7px 10px; border: 0; border-radius: 9px; background: var(--mh-primary); color: #fff; cursor: pointer; font-size: .73rem; font-weight: 800; transition: background .15s, opacity .15s; }
.aida-form button:hover { background: var(--mh-primary-light); }
.aida-form button:disabled { cursor: wait; opacity: .55; }
.aida-form button .material-symbols-outlined { font-size: 17px; }
.aida-meta { display: flex; justify-content: space-between; gap: 7px; margin-top: 8px; color: #8295ab; font-size: .58rem; line-height: 1.35; }
.aida-meta span:last-child { text-align: right; }
body.aida-expanded { overflow: hidden; }
.aida-chat.expanded { position: fixed; z-index: 100; top: 50%; left: 50%; width: min(720px, calc(100vw - 40px)); height: min(720px, calc(100vh - 64px)); max-height: none; padding: 20px; border-color: rgba(77, 163, 255, .48); background: rgba(0, 31, 66, .98); box-shadow: 0 0 0 100vmax rgba(0, 12, 27, .82), 0 24px 80px rgba(0, 0, 0, .5); animation: aida-expand-in .22s cubic-bezier(.2, .8, .2, 1) both; }
.aida-chat.expanded.closing { animation: aida-expand-out .18s ease-in both; }
@keyframes aida-expand-in { from { opacity: 0; transform: translate(-50%, -47%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes aida-expand-out { from { opacity: 1; transform: translate(-50%, -50%) scale(1); } to { opacity: 0; transform: translate(-50%, -47%) scale(.94); } }
.aida-chat.expanded .aida-head, .aida-chat.expanded .aida-messages, .aida-chat.expanded .aida-form, .aida-chat.expanded .aida-meta { width: min(960px, 100%); margin-left: auto; margin-right: auto; }
.aida-chat.expanded .aida-messages { margin-top: 18px; margin-bottom: 14px; }
.aida-chat.expanded .aida-message { max-width: min(78%, 720px); padding: 11px 13px; font-size: .88rem; }
.aida-chat.expanded .aida-form textarea { min-height: 76px; font-size: .85rem; }
.aida-chat.expanded .aida-form button { min-height: 42px; font-size: .82rem; }
.sidebar-help { margin-top: 12px; padding: 9px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 123, 238, .1); }
.sidebar-help > .material-symbols-outlined { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--mh-primary); }
.sidebar-help strong { display: block; font-size: .82rem; }
.sidebar-help p { display: none; }
.sidebar-help a { padding: 7px 9px; border-radius: 9px; background: var(--mh-primary); color: #fff; text-align: center; text-decoration: none; white-space: nowrap; font-size: .7rem; font-weight: 700; transition: background .15s; }
.sidebar-help a:hover { background: var(--mh-primary-light); }
.sidebar-backdrop { display: none; }

main { min-width: 0; }
.hero { padding: 6px 8px 24px; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.headline { display: flex; align-items: center; gap: 16px; }
.headline-logo-link { display: block; flex: 0 0 auto; border-radius: 18px; transition: transform .2s ease, filter .2s ease; }
.headline-logo { display: block; width: clamp(72px, 6vw, 88px); height: clamp(72px, 6vw, 88px); object-fit: contain; }
.headline-logo-link:hover { transform: translateY(-2px) scale(1.09) rotate(-2deg); filter: drop-shadow(0 10px 18px rgba(77, 163, 255, .48)); }
.headline-logo-link:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(77, 163, 255, .5); }
h1, h2 { font-family: var(--display-font); font-weight: 400; }
h1 { margin: 0 0 6px; font-size: clamp(2rem, 3.5vw, 3.25rem); line-height: 1.08; letter-spacing: .01em; }
.headline p { max-width: 720px; margin: 0; color: var(--muted); font-size: .93rem; }
.hero-actions { display: flex; align-items: center; flex: none; gap: 10px; }
.hero-meta { display: flex; gap: 20px; margin: 11px 0 0 104px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.hero-meta > span { display: flex; align-items: center; gap: 7px; }
.hero-meta .material-symbols-outlined { color: var(--mh-primary-light); font-size: 18px; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0; padding: 14px 16px; border: 1px solid rgba(77, 163, 255, .38); border-radius: var(--radius); background: rgba(0, 123, 238, .14); }
.notice > .material-symbols-outlined { flex: none; margin-top: 2px; color: var(--mh-primary-light); }
.notice p { margin: 0; color: #d5e2f0; font-size: .82rem; }
.notice strong { color: #fff; }
.search-box { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 25px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: rgba(0, 31, 66, .82); transition: border .15s, box-shadow .15s; }
.search-box:focus-within { border-color: var(--mh-primary-light); box-shadow: 0 0 0 3px rgba(0, 123, 238, .2); }
.search-box > .material-symbols-outlined { color: var(--mh-primary-light); }
.search-box input { min-width: 0; flex: 1; height: 48px; padding: 0; border: 0; outline: 0; background: transparent; color: #fff; }
.search-box input::placeholder { color: #91a4b9; }
kbd { padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255, 255, 255, .05); color: var(--muted); font: 600 .65rem Inter, sans-serif; }
.search-empty { padding: 35px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.rules { display: grid; gap: 34px; }
.rule-section { scroll-margin-top: 24px; }
.section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-icon { width: 43px; height: 43px; display: grid; flex: none; place-items: center; border: 1px solid rgba(77, 163, 255, .4); border-radius: var(--radius); background: rgba(0, 123, 238, .18); color: var(--mh-primary-light); }
.section-heading > div { display: flex; align-items: center; gap: 10px; }
.section-heading > div > span { color: var(--mh-primary-light); font-family: var(--display-font); font-size: 1.35rem; font-weight: 400; line-height: 1.1; }
.section-heading h2 { margin: 0; font-size: 1.35rem; line-height: 1.1; }
.paragraph + .paragraph { margin-top: 18px; }
.paragraph-heading { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 53, 108, .94); color: #fff; cursor: pointer; font-size: .9rem; font-weight: 800; list-style: none; transition: background .15s, border-color .15s, border-radius .15s; }
.paragraph-heading::-webkit-details-marker { display: none; }
.paragraph-heading:hover { border-color: rgba(77, 163, 255, .52); background: rgba(0, 67, 133, .96); }
.paragraph-mark { flex: none; padding: 4px 8px; border-radius: 8px; background: rgba(0, 123, 238, .28); color: var(--mh-primary-light); font-size: .7rem; font-weight: 800; }
.paragraph-title { min-width: 0; }
.paragraph-chevron { margin-left: auto; color: var(--mh-primary-light); transition: transform .2s ease; }
.paragraph[open] > .paragraph-heading { border-bottom-color: rgba(77, 163, 255, .2); border-radius: var(--radius) var(--radius) 0 0; }
.paragraph[open] > .paragraph-heading .paragraph-chevron { transform: rotate(180deg); }
.paragraph > .rule-list { border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
.rule-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 31, 66, .84); box-shadow: 0 8px 28px rgba(0, 17, 39, .18); }
.rule-card { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; padding: 18px 19px; border-bottom: 1px solid var(--line); transition: background .15s; }
.rule-card:last-child { border-bottom: 0; }
.rule-card:hover { background: rgba(0, 123, 238, .11); }
.rule-card.important { box-shadow: inset 3px 0 0 var(--mh-primary-light); }
.rule-number { width: 42px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: rgba(0, 123, 238, .18); color: var(--mh-primary-light); font-size: .72rem; font-weight: 800; }
.rule-card h3 { margin: 1px 0 5px; color: #fff; font-size: .94rem; line-height: 1.35; }
.rule-card p { margin: 0; color: var(--muted); font-size: .81rem; line-height: 1.55; }
.database-rule { grid-template-columns: 48px minmax(0, 1fr); }
.rule-copy { color: #dce6f2; font-size: .86rem; line-height: 1.55; }
.database-rule p { color: inherit; font-size: inherit; line-height: inherit; }
.rule-link { color: var(--mh-primary-light); font-weight: 600; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: rgba(77, 163, 255, .5); text-underline-offset: 2px; transition: color .15s, text-decoration-color .15s; }
.rule-link:hover { color: #fff; text-decoration-color: #fff; }
.rule-link:focus-visible { border-radius: 3px; outline: 2px solid var(--mh-primary-light); outline-offset: 2px; }
.rule-reference { display: inline-flex; align-items: center; margin: 0 2px; padding: 1px 7px; border: 1px solid rgba(77, 163, 255, .52); border-radius: 6px; background: rgba(77, 163, 255, .13); color: #9dceff; cursor: pointer; font: inherit; font-size: .9em; font-weight: 700; line-height: 1.35; vertical-align: baseline; text-decoration: none; transition: color .15s, background .15s, border-color .15s; }
.rule-reference:hover { border-color: var(--mh-primary-light); background: rgba(77, 163, 255, .25); color: #fff; }
.rule-reference:focus-visible { border-radius: 3px; outline: 2px solid var(--mh-primary-light); outline-offset: 2px; }
.rule-body { display: grid; gap: 5px; margin: 10px 0 0; padding-left: 20px; color: inherit; font-size: inherit; line-height: inherit; }
.rule-body li::marker { color: var(--mh-primary-light); }
.rule-badge { align-self: start; padding: 5px 9px; border: 1px solid rgba(77, 163, 255, .38); border-radius: var(--radius-pill); background: rgba(0, 123, 238, .14); color: #9dceff; font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.rule-card[hidden], .rule-section[hidden] { display: none; }
.load-error { display: flex; align-items: flex-start; gap: 13px; padding: 24px; border: 1px solid rgba(217, 45, 74, .45); border-radius: var(--radius); background: rgba(120, 18, 38, .22); }
.load-error > .material-symbols-outlined { color: #ff8298; }
.load-error strong { display: block; color: #fff; }
.load-error p { margin: 3px 0 0; color: var(--muted); }
.reference-dialog { position: fixed; z-index: 80; max-width: calc(100% - 24px); max-height: min(360px, calc(100vh - 24px)); padding: 0; overflow: hidden auto; border: 1px solid rgba(77, 163, 255, .48); border-radius: var(--radius); background: rgba(0, 39, 82, .98); box-shadow: 0 16px 42px rgba(0, 0, 0, .42); color: var(--text); animation: reference-popover-in .15s ease-out; }
body.aida-expanded .reference-dialog { z-index: 120; }
.reference-dialog[hidden] { display: none; }
@keyframes reference-popover-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.reference-dialog-header { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: rgba(0, 39, 82, .98); }
.reference-dialog-header > div > span { color: var(--mh-primary-light); font-size: .65rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.reference-dialog-header h2 { margin: 3px 0 0; font-size: 1.25rem; }
.reference-dialog-header button { width: 38px; height: 38px; display: grid; flex: none; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 123, 238, .12); color: var(--text); cursor: pointer; transition: background .15s, border-color .15s; }
.reference-dialog-header button:hover { border-color: var(--mh-primary-light); background: rgba(0, 123, 238, .25); }
.reference-dialog-content { padding: 16px 18px 18px; color: #dce6f2; font-size: .84rem; line-height: 1.6; }
.reference-dialog-content p { margin: 0; }
.legal-notice { margin: -14px 24px 24px; color: rgba(184, 194, 208, .65); font-size: .68rem; line-height: 1.5; text-align: center; }

@media (max-width: 900px) {
  .menu-toggle, .sidebar-close { display: flex; }
  .sidebar-head { display: flex; justify-content: flex-end; padding: 0 0 10px; }
  .page-layout { width: 100%; display: block; padding: 22px 18px 42px; }
  .sidebar-column { position: fixed; z-index: 50; top: 0; left: 0; width: min(330px, calc(100% - 42px)); height: 100vh; max-height: none; padding: 10px; overflow: auto; border-radius: 0 var(--radius) var(--radius) 0; background: rgba(0, 20, 45, .96); transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar-column.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 45; inset: 0; background: rgba(0, 12, 27, .65); backdrop-filter: blur(3px); }
  .sidebar-backdrop.open { display: block; }
  body.menu-open { overflow: hidden; }
}

@media (max-width: 600px) {
  .aida-chat.expanded { top: 50%; left: 50%; width: calc(100vw - 16px); height: calc(100vh - 16px); padding: 14px; }
  .aida-chat.expanded .aida-message { max-width: 92%; font-size: .8rem; }
  .language-picker summary { min-width: 44px; padding: 9px; }
  .language-picker summary > span:not(:last-child) { display: none; }
  .page-layout { padding: 14px 11px 34px; }
  .hero { padding: 4px 3px 20px; }
  .hero-top { position: relative; min-width: 0; }
  .hero-actions { position: absolute; top: 0; right: 0; flex-direction: column; }
  .headline { width: 100%; min-width: 0; align-items: flex-start; padding-right: 54px; }
  .headline > div { min-width: 0; }
  .headline-logo { width: 64px; height: 64px; }
  h1 { margin-top: 2px; font-size: clamp(1.55rem, 8vw, 2rem); }
  .headline p { font-size: .8rem; }
  .hero-meta { flex-direction: column; gap: 5px; margin: 10px 0 0 78px; }
  .notice { padding: 12px; }
  kbd { display: none; }
  .rule-card { grid-template-columns: 42px minmax(0, 1fr); gap: 10px; padding: 15px 13px; }
  .rule-badge { grid-column: 2; justify-self: start; }
  .rule-card p { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .headline-logo-link:hover { transform: none; }
}
