/* Órarendtervező – egységes, modern megjelenés */

:root {
  --bg: #eef1ef;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --border: #dde3e0;
  --border-strong: #c6cfcb;
  --text: #16232a;
  --muted: #5b6b70;
  --accent: #0d6b73;
  --accent-hover: #09545b;
  --accent-soft: #e2f0ef;
  --danger: #d92d20;
  --danger-soft: #fef1f0;
  --warning: #b54708;
  --warning-soft: #fff6e6;
  --ok: #079455;
  --ok-soft: #ebf8f1;
  --radius: 10px;
  --radius-xs: 5px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 36, 40, .06);
  --shadow: 0 1px 3px rgba(16, 36, 40, .08), 0 4px 12px rgba(16, 36, 40, .05);
  --shadow-lg: 0 20px 48px rgba(16, 36, 40, .18);
  --ring: 0 0 0 3px rgba(13, 107, 115, .22);
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1 { font-size: 1.7rem; font-weight: 650; letter-spacing: -.022em; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.12rem; font-weight: 650; margin: 1.6rem 0 .75rem; }
h3 { font-size: 1rem; font-weight: 650; margin: 1.1rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

/* --- Alkalmazás-keret: oldalsáv + tartalom ------------------------------------------ */
:root { --sidebar-w: 248px; }
html.nav-compact { --sidebar-w: 68px; }
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .18s; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: .4rem;
  padding: .9rem .7rem; background: var(--surface-2); border-right: 1px solid var(--border); color: #33444a;
  overflow-y: auto; overflow-x: hidden; z-index: 20;
}
.sidebar a { color: #33444a; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: 0 .2rem .5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 650; font-size: 1rem; color: var(--text) !important; letter-spacing: -.015em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { flex: 0 0 auto; display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--accent); }
.brand-logo svg { width: 30px; height: 30px; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: #e6ebe9; color: var(--text); }
.semester-select { padding: .1rem .2rem .7rem; border-bottom: 1px solid var(--border); }
.semester-select .label { display: block; margin-bottom: .25rem; color: var(--muted); font-weight: 550; }
.semester-select select { width: 100%; font-size: .88rem; font-weight: 550; }
.side-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.side-heading { margin: 1rem .7rem .3rem; font-size: .78rem; color: var(--muted); font-weight: 550; }
.side-nav a, .side-group > summary, .sidebar-bottom > a {
  display: flex; align-items: center; gap: .65rem; padding: .48rem .65rem; border-radius: 6px; font-weight: 500; font-size: .92rem;
  white-space: nowrap; cursor: pointer; transition: background .12s, color .12s;
}
.side-nav a:hover, .side-group > summary:hover, .sidebar-bottom > a:hover { background: #e8edeb; color: var(--text); text-decoration: none; }
.side-nav a.active, .sidebar-bottom > a.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.side-nav .icon, .side-group .icon, .sidebar-bottom .icon { flex: 0 0 18px; color: var(--muted); }
.side-nav a.active .icon, .sidebar-bottom > a.active .icon { color: var(--accent); }
.side-group > summary { list-style: none; }
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary::after { content: ""; margin-left: auto; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); opacity: .55; }
.side-group[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.side-group a.sub { padding-left: 2.85rem; font-size: .88rem; color: var(--muted); }
.side-group a.sub.active { color: var(--accent-hover); background: var(--accent-soft); }
.count {
  margin-left: auto; min-width: 1.4rem; padding: 0 .4rem; border-radius: 4px; background: var(--warning-soft); color: var(--warning);
  font-size: .74rem; font-weight: 650; text-align: center; line-height: 1.35rem;
}
.sidebar-bottom { display: flex; flex-direction: column; gap: 1px; padding-top: .5rem; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: .6rem; padding: .55rem .4rem .1rem; }
.user-card .label { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.user-card strong { color: var(--text); font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card small { color: var(--muted); }
.user-card form { margin: 0; }
.avatar {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px;
  background: var(--accent); color: #fff; font-weight: 650; font-size: .82rem;
}
html.nav-compact .sidebar .label, html.nav-compact .side-group > summary::after, html.nav-compact .side-group a.sub,
html.nav-compact .semester-select { display: none; }
html.nav-compact .sidebar-top { flex-direction: column; }
html.nav-compact .side-nav a, html.nav-compact .side-group > summary, html.nav-compact .sidebar-bottom > a { justify-content: center; padding: .6rem; }
html.nav-compact .side-nav a { position: relative; }
html.nav-compact .count { position: absolute; top: 2px; right: 2px; margin: 0; min-width: 1.1rem; line-height: 1.1rem; font-size: .62rem; padding: 0 .25rem; }
html.nav-compact .user-card { flex-direction: column; }
.app-main { min-width: 0; }

main { max-width: 1320px; margin: 0 auto; padding: 1.75rem 1.75rem 4rem; }
main.wide { max-width: none; padding: 1rem 1.1rem 2rem; }

/* --- Üzenetek (SweetAlert2 hiányában) ----------------------------------------- */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .7rem 1rem; border-radius: var(--radius); background: var(--ok-soft); color: var(--ok); margin-bottom: .4rem; }
.messages li.error { background: var(--danger-soft); color: var(--danger); }
.js-ready .messages { display: none; }

/* --- Gombok, mezők ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .95rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 550; font-size: .92rem; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f5c2bd; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; box-shadow: none; font-weight: 500; }
.btn.link:hover { text-decoration: underline; }
.btn.small { padding: .3rem .6rem; font-size: .84rem; }
.input, input[type=text], input[type=number], input[type=password], input[type=date], input[type=search], select, textarea {
  font: inherit; font-size: .94rem; padding: .48rem .65rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); max-width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=checkbox] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); vertical-align: -2px; }
select[multiple] { min-width: 28rem; }

/* --- Kártyák -------------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); }
.card .num { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; }
.card .label { color: var(--muted); font-size: .9rem; }
.card a.title, .card .title { font-weight: 650; color: var(--text); }
.card a.title:hover { color: var(--accent); }

/* --- Listák -------------------------------------------------------------------- */
.toolbar { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .spacer { flex: 1; }
.toolbar input[type=search] { min-width: 20rem; padding-left: 2.1rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat .7rem center; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: #e3e8e6; border-radius: var(--radius-sm); }
.segmented a { padding: .35rem .8rem; color: var(--muted); border-radius: 6px; font-weight: 500; font-size: .9rem; }
.segmented a:hover { color: var(--text); text-decoration: none; }
.segmented a.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .62rem .85rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .82rem; color: var(--muted); background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: #f3f7f6; }
td.actions { white-space: nowrap; text-align: right; }
.pager { display: flex; gap: .75rem; align-items: center; margin-top: 1rem; color: var(--muted); font-size: .9rem; }
.empty { padding: 2.5rem; text-align: center; color: var(--muted); }

/* --- Űrlapok -------------------------------------------------------------------- */
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.5rem; max-width: 780px; box-shadow: var(--shadow-sm); }
.form .row { display: grid; grid-template-columns: 210px 1fr; gap: .4rem 1rem; padding: .5rem 0; align-items: start; }
.form .row > label { padding-top: .5rem; font-weight: 550; font-size: .93rem; }
.form .row > label .req { color: var(--danger); margin-left: .15rem; }
.form .help { color: var(--muted); font-size: .83rem; margin-top: .25rem; }
.form .errorlist { list-style: none; margin: .3rem 0 0; padding: 0; color: var(--danger); font-size: .88rem; }
.form .nonfield { background: var(--danger-soft); color: var(--danger); padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: .8rem; }
.form ul.checkboxes, .form div[id$=allowed_faculties], .form div[id$=repeat_weeks] {
  display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; list-style: none; padding: 0; margin: .4rem 0 0;
}
.form .buttons { display: flex; gap: .6rem; align-items: center; margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.readonly-note { background: var(--accent-soft); color: #0a4f55; padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; max-width: 780px; }
.history { max-width: 780px; }
.history td { font-size: .9rem; }
.changes { margin: 0; padding-left: 1rem; }

/* --- Belépés -------------------------------------------------------------------- */
.login { max-width: 400px; margin: 9vh auto; }
.login .brand { justify-content: center; font-size: 1.35rem; margin-bottom: .4rem; display: flex; }
.login .lead { text-align: center; color: var(--muted); margin: 0 0 1.4rem; }
.login .form { max-width: none; padding: 1.6rem; box-shadow: var(--shadow); }
.login .row { grid-template-columns: 1fr; }
.login .buttons .btn { width: 100%; justify-content: center; }

/* --- Súgódobozok, kezdőlap, teendők ------------------------------------------------ */
.help-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 1.1rem; }
.help-box > summary { cursor: pointer; padding: .7rem 1rem; font-weight: 600; list-style: none; color: #0a4f55; }
.help-box > summary::-webkit-details-marker { display: none; }
.help-box > summary::after { content: 'elrejtés'; float: right; font-weight: 400; color: var(--muted); font-size: .85rem; }
.help-box:not([open]) > summary::after { content: 'megnyitás'; }
.help-box .help-content { padding: 0 1rem .9rem 1rem; color: #2f3e44; font-size: .93rem; }
.help-box .help-content ol, .help-box .help-content ul { margin: .2rem 0; padding-left: 1.2rem; }
.help-box .help-content li { margin: .2rem 0; }
kbd { font: inherit; font-size: .8rem; padding: .05rem .35rem; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); }

/* Oldalfej: cím balra, fő műveletek jobbra */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .2rem 0 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.hero h1 { margin: 0; }
.hero p { margin: .25rem 0 0; color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.panel h2 { margin: 0; font-size: 1rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: .3rem 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.panel-head p { margin: 0; flex-basis: 100%; }
.overview { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2.1fr); gap: 1rem; margin-bottom: 1rem; }
.status h2 { margin-top: 1.4rem; margin-bottom: .4rem; }
.status-figure { margin: 0 0 .6rem; display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.status-figure strong { font-size: 2.1rem; font-weight: 650; letter-spacing: -.03em; line-height: 1; }
.status-figure span { color: var(--muted); }
.todo-lines { list-style: none; margin: 0; padding: 0; }
.todo-lines li { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-top: 1px solid var(--border); }
.todo-lines li::before { content: ""; flex: 0 0 8px; height: 8px; border-radius: 2px; background: var(--ok); }
.todo-lines li.warn::before { background: #d99a1e; }
.todo-lines li.bad::before { background: var(--danger); }
.todo-lines a { flex: 1; color: var(--text); }
.todo-lines b { font-weight: 650; }
.todo-lines li.done b { color: var(--muted); font-weight: 500; }

/* Heti terhelés: napok × órák hőtérkép */
.heat { display: grid; grid-template-columns: 2.4rem repeat(var(--cols), minmax(0, 1fr)); gap: 3px; }
.heat-hour { font-size: .72rem; color: var(--muted); text-align: left; padding-left: 1px; }
.heat-day { font-size: .82rem; font-weight: 600; color: #33444a; align-self: center; }
.heat-cell { display: block; aspect-ratio: 1.5; border-radius: 3px; background: #edf1ef; }
.heat-cell.l1 { background: #cfe6e4; }
.heat-cell.l2 { background: #8fc7c3; }
.heat-cell.l3 { background: #3f9a9b; }
.heat-cell.l4 { background: #0b5a61; }
.heat-legend { display: flex; align-items: center; gap: 3px; margin-top: .8rem; justify-content: flex-end; }
.heat-legend .heat-cell { width: 18px; aspect-ratio: 1.5; }
.heat-legend span { margin: 0 .35rem; }
.change-list { list-style: none; margin: 0; padding: 0; }
.change-list li { display: flex; flex-direction: column; padding: .5rem 0; border-top: 1px solid var(--border); font-size: .92rem; }
.change-list li:first-child { border-top: 0; padding-top: 0; }
.change-list small { font-size: .8rem; }

.btn .icon, a > .icon { flex: 0 0 auto; vertical-align: -4px; }
p > a > .icon:first-child { margin-right: .15rem; }
.pill { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.pill.warn { background: var(--warning-soft); color: var(--warning); border-color: #fedf89; }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: #fecdca; }
.pill.good { background: var(--ok-soft); color: var(--ok); border-color: #abefc6; }
.progress { height: 8px; background: #e3e8e6; border-radius: 2px; overflow: hidden; margin-bottom: .45rem; }
.progress > span { display: block; height: 100%; background: var(--accent); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.steps li { counter-increment: step; display: flex; gap: .7rem; align-items: baseline; }
.steps li::before {
  content: counter(step); flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-hover); font-size: .78rem; font-weight: 650; border-radius: 5px;
}
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; align-items: start; }
.todo-section { margin-bottom: 1.4rem; }
.todo-section h2 { display: flex; align-items: center; gap: .6rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { display: inline-flex; gap: .35rem; align-items: center; padding: .3rem .7rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .88rem; }
.chip:hover { border-color: #a7d3d0; text-decoration: none; color: var(--accent); }
.chip b { color: var(--danger); }

.help-page { max-width: 900px; }
.help-page section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem 1.4rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.help-page dl { display: grid; grid-template-columns: 180px 1fr; gap: .5rem 1rem; }
.help-page dt { font-weight: 600; }
.help-page dd { margin: 0; color: #2f3e44; }
.toc { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.2rem; }

@media (max-width: 760px) {
  .overview { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
  .toolbar input[type=search] { min-width: 0; width: 100%; }
  select[multiple] { min-width: 0; width: 100%; }
  .split { grid-template-columns: 1fr; }
  .help-page dl { grid-template-columns: 1fr; }
  main { padding: 1.2rem 1rem 3rem; }
}

/* --- Órarend-választó ----------------------------------------------------------- */
.pick-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; }
.pick-columns section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .3rem 1.1rem 1rem; box-shadow: var(--shadow-sm); }
.pick-list { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow-y: auto; }
.pick-list li { padding: .4rem .3rem; border-bottom: 1px solid var(--surface-2); }
.pick-list li a { font-weight: 550; }
.recent { margin-bottom: 1rem; }
.recent:empty { display: none; }

/* --- Heti rács ------------------------------------------------------------------ */
:root {
  --row: 46px;
  --kind-e: #e6ecfb; --kind-e-border: #3f63c9; --kind-e-ink: #1f3a85;
  --kind-g: #fbf0da; --kind-g-border: #c98a17; --kind-g-ink: #6e4a07;
  --kind-x: #eef1f0; --kind-x-border: #8d9a9a; --kind-x-ink: #3b4a4e;
  --rule: #e4e9e7; --rule-faint: #f0f3f2;
  --lvl-ok: #e6f6ed; --lvl-warning: #fff4dc; --lvl-error: #fde7e5;
}
.grid-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .4rem; }
.grid-header h1 { margin: 0; }
.grid-meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .84rem; margin: .6rem 0 1rem; align-items: center; color: #41535a; }
.legend .sw { display: inline-block; width: .95rem; height: .95rem; border-radius: 4px; vertical-align: -2px; margin: 0 .3rem 0 .4rem; border: 1px solid var(--border); }
.sw.kind-e { background: var(--kind-e); border: 0; box-shadow: inset 3px 0 0 var(--kind-e-border); }
.sw.kind-g { background: var(--kind-g); border: 0; box-shadow: inset 3px 0 0 var(--kind-g-border); }
.sw.problem { background: #fff; border: 2px solid var(--danger); }
.sw.blocked { background: repeating-linear-gradient(45deg, #e5e7eb 0 4px, #f8f9fb 4px 8px); }
.sw.lvl-ok { background: var(--lvl-ok); } .sw.lvl-warning { background: var(--lvl-warning); } .sw.lvl-error { background: var(--lvl-error); }

.schedule { display: grid; grid-template-columns: 1fr 250px; gap: 1rem; align-items: start; }
.week { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-sm); }
.hours-col { flex: 0 0 52px; background: var(--surface); border-right: 1px solid var(--border-strong); }
.day { flex: 1 1 0; min-width: 104px; border-left: 1px solid var(--rule); }
.hours-col + .day { border-left: 0; }
.day-head { height: 42px; display: flex; align-items: center; justify-content: flex-start; padding: 0 .7rem; font-weight: 650; font-size: .9rem; border-bottom: 1px solid var(--border-strong); background: var(--surface); }
.day-body { position: relative; height: calc(var(--rows) * var(--row)); }
.hour-label { position: absolute; top: calc(var(--start) * var(--row)); right: 8px; font-size: .76rem; font-weight: 550; color: var(--muted); transform: translateY(4px); }
.slot { position: absolute; left: 0; right: 0; top: calc(var(--start) * var(--row)); height: var(--row); border-bottom: 1px solid var(--rule); background-image: linear-gradient(to bottom, transparent calc(50% - .5px), var(--rule-faint) calc(50% - .5px), var(--rule-faint) calc(50% + .5px), transparent calc(50% + .5px)); transition: background-color .12s; }
.slot.lvl-ok { background-color: var(--lvl-ok); }
.slot.lvl-warning { background-color: var(--lvl-warning); }
.slot.lvl-error { background-color: var(--lvl-error); }
.slot.target { box-shadow: inset 0 0 0 2px var(--accent); background-color: rgba(13, 107, 115, .1); }
.block {
  position: absolute; left: 0; right: 0; top: calc(var(--start) * var(--row)); height: calc(var(--len) * var(--row));
  background: repeating-linear-gradient(45deg, #e8eaef 0 6px, #f7f8fa 6px 12px); color: var(--muted);
  font-size: .74rem; padding: 3px 5px; pointer-events: none;
}

.schedule .card {
  border: 0; border-left: 3px solid var(--kind-x-border); background: var(--kind-x); color: var(--kind-x-ink); border-radius: var(--radius-xs); padding: 4px 6px 4px 7px;
  font-size: .78rem; line-height: 1.3; overflow: hidden; cursor: pointer; user-select: none; box-shadow: 0 0 0 1px rgba(16, 36, 40, .06);
  transition: box-shadow .15s, transform .15s;
}
.schedule .card:hover { box-shadow: var(--shadow); z-index: 2; }
.day-body .card {
  position: absolute; top: calc(var(--start) * var(--row) + 2px); height: calc(var(--len) * var(--row) - 4px);
  left: calc(var(--lane) / var(--lanes) * 100% + 2px); width: calc(100% / var(--lanes) - 4px);
}
.card.kind-e { background: var(--kind-e); border-color: var(--kind-e-border); color: var(--kind-e-ink); }
.card.kind-g { background: var(--kind-g); border-color: var(--kind-g-border); color: var(--kind-g-ink); }
.card.parity { background-image: repeating-linear-gradient(135deg, transparent 0 7px, rgba(255,255,255,.55) 7px 10px); }
.card.problem { border-left-color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }
.card[draggable=true] { cursor: grab; }
.card.dragging { opacity: .45; }
.card-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title .kind { font-weight: 550; opacity: .7; font-size: .7rem; }
.card-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.badge { font-size: .66rem; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 0 5px; font-weight: 600; color: #41535a; }
.no-room { color: var(--danger); font-weight: 500; }
body.is-dragging .card:not(.dragging) { pointer-events: none; opacity: .7; }

.unplaced { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .3rem .8rem .8rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; box-shadow: var(--shadow-sm); }
.unplaced h2 { margin-top: .7rem; }
.unplaced .card { margin-bottom: .45rem; }
.unplaced.drop-hover { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--accent-soft); }

/* --- Modális ablakok ----------------------------------------------------------- */
.dialog {
  border: 0; border-radius: 16px; padding: 1.5rem 1.6rem; width: min(580px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg); color: var(--text); max-height: calc(100vh - 48px);
}
.dialog.wide { width: min(820px, calc(100vw - 32px)); }
.dialog[open] { animation: pop .18s ease-out; }
.dialog::backdrop { background: rgba(16, 36, 40, .45); backdrop-filter: blur(2px); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog h2 { margin-top: 0; padding-right: 2rem; }
.dialog-close { position: absolute; top: .9rem; right: 1rem; margin: 0; }
.dialog-close .btn { font-size: 1.1rem; color: var(--muted); }
.dialog dl { display: grid; grid-template-columns: 115px 1fr; gap: .35rem .8rem; margin: 0 0 1rem; }
.dialog dt { color: var(--muted); font-size: .9rem; }
.dialog dd { margin: 0; }
.dialog .buttons { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.1rem; }
.dialog .form { border: 0; padding: 0; box-shadow: none; max-width: none; }
.dialog .form .row { grid-template-columns: 180px 1fr; }
.conflicts, .auto-list { list-style: none; padding-left: 0; margin: .4rem 0; text-align: left; }
.conflicts li { margin: .3rem 0; }
.conflicts li, .auto-list li { position: relative; padding-left: 1.1rem; }
.conflicts li::before, .auto-list li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 2px; background: var(--muted); }
.conflicts li.error::before { background: var(--danger); }
.conflicts li.warning::before, .auto-list li.warning::before { background: #d99a1e; }
.auto-list li.ok::before { background: var(--ok); }
.conflicts li.error { color: var(--danger); }
.conflicts li.warning { color: var(--warning); }
.room-list, .slot-list { list-style: none; padding: 0; margin: .4rem 0; max-height: 230px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.room-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem .7rem; border-bottom: 1px solid var(--surface-2); }
.room-list li:last-child { border-bottom: 0; }
.slot-list { display: flex; flex-wrap: wrap; gap: .35rem; padding: .5rem; }
.slot-list button { border: 1px solid #abefc6; background: var(--ok-soft); color: var(--ok); border-radius: 999px; padding: .2rem .65rem; font: inherit; font-size: .85rem; cursor: pointer; }
.slot-list button.warning { border-color: #fedf89; background: var(--warning-soft); color: var(--warning); }
.slot-list button:hover { filter: brightness(.96); }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.loading { color: var(--muted); padding: 1rem 0; }

.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: #1b2233; color: #fff; padding: .7rem 1.1rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 50; max-width: calc(100vw - 32px); }

/* SweetAlert2 igazítása a dizájnhoz */
.swal2-popup { border-radius: 16px !important; font-family: inherit !important; }
.swal2-styled.swal2-confirm { background: var(--accent) !important; border-radius: var(--radius-sm) !important; }
.swal2-styled.swal2-cancel { border-radius: var(--radius-sm) !important; }
.swal2-styled.swal2-deny { background: var(--danger) !important; border-radius: var(--radius-sm) !important; }
.swal2-toast { box-shadow: var(--shadow-lg) !important; }
.swal2-html-container { text-align: left !important; }

@media (max-width: 900px) {
  .schedule { grid-template-columns: 1fr; }
  .unplaced { position: static; max-height: none; }
}

/* --- Levelező naptár ------------------------------------------------------------ */
.week-strip { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 1rem; }
.week-strip a {
  min-width: 2.8rem; text-align: center; padding: .3rem .45rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted); font-size: .85rem; line-height: 1.15; box-shadow: var(--shadow-sm);
}
.week-strip a:hover { border-color: #a7d3d0; text-decoration: none; }
.week-strip a small { display: block; font-size: .7rem; }
.week-strip a.has { color: var(--text); font-weight: 650; }
.week-strip a.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.week-nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.card.blocked-card { background: repeating-linear-gradient(45deg, #e5e7eb 0 6px, #f3f4f6 6px 12px); border-color: #a7b0bf; }

/* --- Kimenetek ------------------------------------------------------------------ */
.cards.outputs { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.cards.outputs .label { margin: .45rem 0; }
table.compact th, table.compact td { padding: .35rem .55rem; font-size: .85rem; }
.bar { display: inline-block; width: 74px; height: 8px; background: #e3e8e6; border-radius: 999px; overflow: hidden; vertical-align: middle; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.usage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: .8rem; }
.usage-room { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; break-inside: avoid; box-shadow: var(--shadow-sm); }
.usage-title { font-weight: 650; margin-bottom: .35rem; font-size: .9rem; }
.usage-table { width: 100%; font-size: .72rem; }
.usage-table th, .usage-table td { padding: 1px 3px; text-align: center; border-bottom: 1px solid var(--surface-2); }
.usage-table td.busy { background: var(--kind-e); }
.print-block { break-inside: avoid-page; }
.signature { margin-top: 1.5rem; }

/* --- Nyomtatás ------------------------------------------------------------------ */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  :root { --row: 34px; font-size: 11px; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .no-print, .topbar, .messages, dialog, .toast, .help-box, .swal2-container { display: none !important; }
  .schedule { display: block; }
  .week, .table-wrap, .card, .form { box-shadow: none !important; }
  .week { border-color: #999; overflow: visible; }
  .schedule .card { border-color: #666 !important; break-inside: avoid; }
  .card.kind-e { background: #e8edff !important; }
  .card.kind-g { background: #eef8f1 !important; }
  .slot { border-bottom-color: #ddd; }
  .table-wrap { border: 0; overflow: visible; }
  th, td { border-bottom-color: #ccc; }
  a { color: inherit; text-decoration: none; }
  .print-page { break-after: page; }
  .print-page:last-child { break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* --- Tervezőasztal: bal panel | rács | jobb oldali részletek --------------------------- */
.planner { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: .9rem; align-items: start; }
.planner > aside {
  position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.planner-left { padding: .8rem; display: flex; flex-direction: column; gap: .9rem; }
.planner-left h3 { margin: 0 0 .45rem; font-size: .84rem; font-weight: 650; color: var(--text); }
.planner-left input[type=search] { width: 100%; min-width: 0; }
.quick-results { list-style: none; margin: .4rem 0 0; padding: 0; max-height: 240px; overflow-y: auto; }
.quick-results li a { display: flex; justify-content: space-between; gap: .4rem; padding: .35rem .5rem; border-radius: 7px; color: var(--text); font-size: .9rem; }
.quick-results li a:hover { background: var(--accent-soft); text-decoration: none; }
.quick-results small { color: var(--muted); }
.view-tabs { display: flex; flex-wrap: wrap; gap: .3rem; }
.view-tabs a { font-size: .82rem; padding: .2rem .5rem; border-radius: var(--radius-xs); border: 1px solid var(--border); color: var(--text); background: var(--surface-2); }
.view-tabs a:hover { border-color: #a7d3d0; color: var(--accent); text-decoration: none; }
.planner .unplaced { position: static; max-height: none; border: 0; box-shadow: none; padding: 0; overflow: visible; }
.planner-main { min-width: 0; }
.planner-main .week { max-height: calc(100vh - 170px); overflow: auto; }
.planner-main .day-head { position: sticky; top: 0; z-index: 3; }
.planner-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.planner-head h1 { font-size: 1.5rem; margin: 0; }
.planner-head .meta { color: var(--muted); font-size: .88rem; display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.inspector { padding: 1rem 1.1rem; }
.inspector h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.inspector h3 { font-size: .84rem; font-weight: 650; color: var(--text); margin: 1.2rem 0 .45rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.inspector dl { display: grid; grid-template-columns: 92px 1fr; gap: .3rem .6rem; margin: 0; font-size: .92rem; }
.inspector dt { color: var(--muted); }
.inspector dd { margin: 0; }
.inspector .empty-state { text-align: center; color: var(--muted); padding: 1.2rem .3rem; }
.inspector .empty-state .big { color: var(--accent); }
.inspector .empty-state .big .icon { width: 36px; height: 36px; }
.inspector .buttons { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.suggestions { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.suggestions li button {
  width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; align-items: center;
  padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; font: inherit;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.suggestions li button:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-sm); }
.suggestions li button strong { font-size: .92rem; }
.suggestions li button small { grid-column: 1 / -1; color: var(--muted); font-size: .78rem; }
.suggestions li button .go { color: var(--accent); font-weight: 600; font-size: .85rem; }
.suggestions li.best button { border-color: #a7d3d0; background: #f0f7f6; }
.schedule .card.selected-card { outline: 3px solid var(--accent); outline-offset: 1px; z-index: 3; }
.live-banner {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .9rem; margin-bottom: .7rem; border-radius: var(--radius);
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: .9rem;
}
.live-banner[hidden] { display: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(7, 148, 85, .2); display: inline-block; }
.live-status { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .8rem; }
.auto-list { max-height: 50vh; overflow-y: auto; }
.auto-list li { padding-top: .35rem; padding-bottom: .35rem; border-bottom: 1px solid var(--surface-2); font-size: .9rem; }

@media (max-width: 1380px) {
  .planner { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .planner { grid-template-columns: 1fr; }
  .planner > aside { position: static; max-height: none; }
}
@media print {
  .app { display: block; }
  .sidebar, .planner-left, .inspector, .live-banner { display: none !important; }
  .planner { display: block; }
  .planner-main .week { max-height: none; overflow: visible; }
}

/* Üres napok keskenyebben (pl. levelezőn hétfő–csütörtök), hogy a foglalt napok kiférjenek */
.day.empty-day { flex: .45 1 0; min-width: 64px; }
.day.empty-day .day-head { font-size: .8rem; color: var(--muted); overflow: hidden; white-space: nowrap; }
.day.empty-day .day-head .muted { display: none; }
body.is-dragging .day.empty-day { flex: 1 1 0; min-width: 110px; }

/* Gépeléssel szűrhető választó a hosszú lenyíló listák helyett */
.combo { position: relative; max-width: 100%; }
.combo-input { width: 100%; }
.combo-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .25rem; list-style: none;
  max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.combo-list li { padding: .35rem .55rem; border-radius: 6px; cursor: pointer; font-size: .92rem; }
.combo-list li.active, .combo-list li:hover { background: var(--accent-soft); }
.combo-list li.muted { cursor: default; background: none; font-size: .85rem; }
.combo-filter { display: block; width: 100%; margin-bottom: .35rem; }
.semester-new { display: inline-block; margin-top: .45rem; font-size: .82rem; font-weight: 550; color: var(--accent) !important; }
html.nav-compact .semester-new { display: none; }

/* Telefonon az oldalsáv vízszintes, görgethető menüsor, hogy ne foglalja el az első képernyőt */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem 1rem; overflow: visible; min-width: 0; }
  .sidebar-top { flex: 1; padding: 0; }
  .sidebar-top [data-toggle-sidebar] { display: none; }
  .semester-select { flex: 1 1 100%; order: 3; padding: 0; border: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
  .semester-select .label { margin: 0; }
  .semester-select select { flex: 1; width: auto; }
  .side-nav { flex: 1 1 100%; order: 4; flex-direction: row; overflow-x: auto; gap: .25rem; scrollbar-width: none; }
  .side-heading, .side-group a.sub, .side-group > summary::after { display: none; }
  .side-nav a, .side-group > summary { padding: .45rem .65rem; }
  .side-group[open] { display: contents; }
  .sidebar-bottom { order: 2; flex-direction: row; align-items: center; border: 0; padding: 0; }
  .sidebar-bottom > a .label, .user-card .label { display: none; }
  .user-card { padding: 0; }
}

/* Oldalcím alatti alcím (félév, kar) – a „Cím · szürke rész” helyett */
h1:has(+ .page-sub) { margin-bottom: .2rem; }
.page-sub { margin: 0 0 1.2rem; color: var(--muted); }
.planner-head .page-sub, .grid-header .page-sub { margin-bottom: .3rem; }
.cards.outputs .card { display: flex; flex-direction: column; }
.card-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: auto 0 0; padding-top: .4rem; }
.form .row > input:not([type=checkbox]):not([type=radio]), .form .row > select:not([multiple]), .form .row > textarea, .form .row > .combo { width: 100%; max-width: 28rem; }

/* --- A kiválasztott óra: jobbról becsúszó fiók, a rács megkapja a teljes szélességet --------- */
.planner > .drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 100vw); max-height: none; z-index: 45;
  border-radius: 0; border: 0; border-left: 1px solid var(--border); box-shadow: -18px 0 40px rgba(16, 36, 40, .12);
  padding: 1.1rem 1.2rem 2rem; overflow-y: auto; transform: translateX(105%); visibility: hidden;
  transition: transform .2s ease, visibility 0s linear .2s;
}
.planner > .drawer.open { transform: none; visibility: visible; transition: transform .2s ease; }
.drawer-close { position: absolute; top: .8rem; right: .8rem; }
.drawer h2 { padding-right: 2.2rem; }
@media (prefers-reduced-motion: reduce) { .planner > .drawer { transition: none; } }
@media (min-width: 1100px) {
  .planner.drawer-open { padding-right: 344px; }
  .planner.drawer-open .day { min-width: 88px; }
}
.place-hint { margin: .9rem 0 0; padding: .6rem .75rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent-hover); font-size: .88rem; }
.planner.placing .slot.lvl-ok { cursor: pointer; }
.planner.placing .slot.lvl-ok:hover, .planner.placing .slot.target { box-shadow: inset 0 0 0 2px var(--accent); }
.planner.placing .slot.lvl-error { cursor: not-allowed; }
.undo-count:not(:empty) { min-width: 1.2rem; padding: 0 .3rem; border-radius: 4px; background: var(--accent-soft); color: var(--accent-hover); font-size: .74rem; font-weight: 650; text-align: center; }
.btn:disabled { opacity: .5; cursor: default; }

/* --- Teendősor --------------------------------------------------------------- */
.queue-progress { max-width: 640px; margin: -.4rem 0 1.2rem; }
.queue-progress .progress { height: 10px; }
.queue-last { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .6rem .9rem; margin-bottom: 1rem; border-radius: var(--radius); background: var(--ok-soft); color: #064e30; }
.queue { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1rem; align-items: start; }
.queue-card { padding: 1.4rem 1.5rem; border-left: 4px solid var(--kind-x-border); }
.queue-card h2 { font-size: 1.5rem; margin: .2rem 0 0; letter-spacing: -.02em; line-height: 1.2; }
.queue-card > .muted { margin: .1rem 0 1rem; }
.queue-card dl { display: grid; grid-template-columns: 90px 1fr; gap: .35rem .8rem; margin: 0 0 1.2rem; }
.queue-card dt { color: var(--muted); }
.queue-card dd { margin: 0; }
.queue-kind { margin: 0; font-size: .85rem; font-weight: 650; color: var(--kind-x-ink); }
.queue-kind.kind-e { color: var(--kind-e-ink); }
.queue-kind.kind-g { color: var(--kind-g-ink); }
.queue-card:has(.kind-e) { border-left-color: var(--kind-e-border); }
.queue-card:has(.kind-g) { border-left-color: var(--kind-g-border); }
.queue-choices h2 { margin: 0 0 .6rem; font-size: 1rem; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; margin-bottom: .5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.choice div { display: flex; flex-direction: column; min-width: 0; }
.choice small { color: var(--muted); }
.choice.best { border: 2px solid var(--accent); padding: 1rem 1.1rem; }
.choice.best strong { font-size: 1.12rem; }
.choice.warn small { color: var(--warning); }
.queue-skip { margin-top: .8rem; }
.queue-done { max-width: 640px; padding: 1.6rem; }
.queue-done h2 { margin: 0 0 .4rem; font-size: 1.2rem; }
@media (max-width: 900px) { .queue { grid-template-columns: 1fr; } }

/* --- Közös kereső (Ctrl+K) ------------------------------------------------------ */
.command-trigger {
  display: flex; align-items: center; gap: .6rem; width: 100%; margin: 0 0 .6rem; padding: .45rem .6rem; font: inherit; font-size: .9rem;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; cursor: pointer; text-align: left;
}
.command-trigger:hover { border-color: var(--accent); color: var(--text); }
.command-trigger .label:first-of-type { flex: 1; }
.command-trigger kbd { font-size: .72rem; }
html.nav-compact .command-trigger { justify-content: center; padding: .5rem; }
.command {
  width: min(620px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); color: var(--text); overflow: hidden;
}
.command::backdrop { background: rgba(16, 36, 40, .35); }
.command-field { display: flex; align-items: center; gap: .6rem; padding: .3rem .9rem; border-bottom: 1px solid var(--border); }
.command-field input { flex: 1; border: 0; box-shadow: none !important; font-size: 1.1rem; padding: .7rem 0; background: transparent; }
.command-results { list-style: none; margin: 0; padding: .35rem; max-height: 52vh; overflow-y: auto; }
.command-results a { display: grid; grid-template-columns: 7.5rem minmax(0, auto) 1fr; align-items: baseline; gap: .7rem; padding: .55rem .7rem; border-radius: 7px; color: var(--text); }
.command-results a:hover, .command-results a.active { background: var(--accent-soft); text-decoration: none; }
.command-results small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-type { font-size: .78rem; color: var(--muted); }
.command-empty { margin: 0; padding: 1rem 1.2rem 1.2rem; color: var(--muted); font-size: .9rem; }
@media (max-width: 900px) { .command-trigger { order: 1; flex: 0 0 auto; width: auto; margin: 0; } .command-trigger kbd { display: none; } }

.todo-cta { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: 0 0 .8rem; }
.choice .btn { white-space: nowrap; flex: 0 0 auto; }
.todo-lines li > span { flex: 1; }
.start-choice { display: grid; gap: .5rem; }
.start-option { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 400 !important; }
.start-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.start-option input { margin-top: .25rem; accent-color: var(--accent); }
.start-option span { display: flex; flex-direction: column; gap: .15rem; }
.start-option small { color: var(--muted); font-size: .84rem; }

/* --- Súgó menü (oldalsáv alja) ------------------------------------------------- */
.help-menu { position: relative; }
.help-trigger {
  display: flex; align-items: center; gap: .65rem; width: 100%; padding: .48rem .65rem; border: 0; border-radius: 6px; background: none;
  color: #33444a; font: inherit; font-weight: 500; font-size: .92rem; cursor: pointer; text-align: left;
}
.help-trigger:hover, .help-trigger[aria-expanded="true"] { background: #e8edeb; color: var(--text); }
.help-trigger.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.help-trigger .icon { flex: 0 0 18px; color: var(--muted); }
html.nav-compact .help-trigger { justify-content: center; padding: .6rem; }
.help-pop {
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 50; min-width: 270px; padding: .35rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.help-pop button, .help-pop a {
  display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .65rem; border: 0; border-radius: 7px; background: none;
  color: var(--text) !important; font: inherit; font-size: .9rem; text-align: left; cursor: pointer; white-space: nowrap;
}
.help-pop button:hover:not(:disabled), .help-pop a:hover { background: var(--accent-soft); text-decoration: none; }
.help-pop button:disabled { color: var(--muted) !important; cursor: default; }
.help-pop .icon { color: var(--accent); }
@media (max-width: 900px) { .help-pop { left: auto; right: 0; bottom: auto; top: calc(100% + 6px); } .help-trigger .label { display: none; } }

/* --- Üdvözlő ablak ------------------------------------------------------------- */
.welcome-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(10, 30, 34, .5); backdrop-filter: blur(2px); animation: fade-in .15s ease; }
.welcome {
  position: relative; display: grid; grid-template-columns: 300px 1fr; width: 100%; max-width: 860px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border-radius: 18px; box-shadow: 0 30px 80px rgba(10, 30, 34, .35); animation: pop .2s ease-out;
}
.welcome-art { display: grid; place-items: center; padding: 24px; background: var(--accent-soft); }
.welcome-anim { width: 100%; max-width: 260px; aspect-ratio: 1; }
.welcome-anim.no-anim { display: none; }
.welcome-body { padding: 32px 32px 26px; }
.welcome-kicker { margin: 0; color: var(--accent); font-weight: 600; font-size: .9rem; }
.welcome-body h2 { margin: .15rem 0 .5rem; font-size: 1.9rem; letter-spacing: -.025em; }
.welcome-body > .muted { margin: 0; }
.welcome-list { list-style: none; padding: 0; margin: 1.2rem 0 1.5rem; display: grid; gap: .85rem; }
.welcome-list li { display: flex; gap: .8rem; align-items: flex-start; }
.welcome-list li > span:last-child { display: flex; flex-direction: column; }
.welcome-list small { color: var(--muted); font-size: .88rem; }
.welcome-ico { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.welcome-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.welcome-note { margin: .8rem 0 0; color: var(--muted); font-size: .82rem; text-align: right; }
.welcome-close { position: absolute; top: 10px; right: 10px; font-size: 1.4rem; color: var(--muted); }
@keyframes fade-in { from { opacity: 0; } }
@media (max-width: 720px) {
  .welcome { grid-template-columns: 1fr; }
  .welcome-art { padding: 14px; }
  .welcome-anim { max-width: 150px; }
  .welcome-body { padding: 20px 18px 18px; }
  .welcome-body h2 { font-size: 1.5rem; }
  .welcome-actions .btn { flex: 1; justify-content: center; }
  .welcome-note { text-align: left; }
}

/* --- Kiemeléses túra ----------------------------------------------------------- */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-block { position: absolute; inset: 0; }
.tour-dim { position: absolute; inset: 0; background: rgba(10, 30, 34, .55); }
.tour-hole {
  position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(10, 30, 34, .55); outline: 2px solid #6fd3cc; outline-offset: 2px;
  pointer-events: none; transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
}
.tour-pop {
  position: fixed; padding: 14px 16px; background: var(--surface); color: var(--text); border-radius: 12px;
  box-shadow: 0 18px 50px -10px rgba(0, 0, 0, .45); transition: left .25s ease, top .25s ease; outline: 0;
}
.tour-pop::before { content: ""; position: absolute; width: 12px; height: 12px; background: var(--surface); transform: rotate(45deg); display: none; }
.tour-pop.arrow-left::before { display: block; left: -6px; top: calc(50% - 6px); }
.tour-pop.arrow-top::before { display: block; top: -6px; left: calc(50% - 6px); }
.tour-pop.arrow-bottom::before { display: block; bottom: -6px; left: calc(50% - 6px); }
.tour-top { display: flex; justify-content: space-between; align-items: center; }
.tour-top .icon-btn { font-size: 1.2rem; color: var(--muted); width: 26px; height: 26px; }
.tour-count { font-size: .76rem; font-weight: 650; color: var(--accent); }
.tour-title { margin: .1rem 0 .3rem; font-size: 1.05rem; }
.tour-body { margin: 0; font-size: .9rem; line-height: 1.5; color: #3b4a50; }
.tour-dots { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.tour-dots span { width: 6px; height: 6px; border-radius: 99px; background: var(--border-strong); transition: width .2s; }
.tour-dots span.on { width: 16px; background: var(--accent); }
.tour-actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 12px; }
.tour-skip { color: var(--muted) !important; font-size: .86rem; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-pop { transition: none; } .welcome, .welcome-backdrop { animation: none; } }
.tour [hidden], .help-pop [hidden], .btn[hidden] { display: none !important; }

.help-hero { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; align-items: center; padding: 1.4rem; margin-bottom: 1.2rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.help-hero h1 { margin: 0 0 .3rem; }
.help-hero-art { display: grid; place-items: center; background: var(--accent-soft); border-radius: 12px; padding: .8rem; }
.help-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
.help-actions form { margin: 0; }
@media (max-width: 700px) { .help-hero { grid-template-columns: 1fr; } .help-hero-art { max-width: 160px; } }

.first-steps { margin-bottom: 1.2rem; border-left: 4px solid var(--accent); }
.first-steps h2 { margin-top: 0; }
.first-steps ol { margin: .6rem 0 1rem; padding-left: 1.3rem; line-height: 1.7; }
