:root {
  --bg: #faf7f9; --surface: #fff; --text: #1d1d1f; --muted: #6b6b70; --line: #ecdfe6;
  --accent: #d63384; --accent-soft: #fde7f2; --ok: #1e7a46; --ok-soft: #e3f4ea; --err: #b42318;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161416; --surface: #211e21; --text: #f2eef1; --muted: #a59fa4; --line: #3a3338;
    --accent: #f06aa8; --accent-soft: #3d2231; --ok: #5fd08f; --ok-soft: #173525; --err: #ff8a80;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 1100px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 999px; font: 600 15px/1 inherit; cursor: pointer; text-decoration: none;
  font-family: inherit;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.import {
  display: flex; gap: 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px; box-shadow: var(--shadow); margin-bottom: 8px;
}
.import input {
  flex: 1 1 280px; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px;
  font: inherit; background: var(--bg); color: var(--text);
}
.import select {
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px;
  font: inherit; background: var(--bg); color: var(--text);
}
.msg { min-height: 24px; margin: 4px 4px 20px; font-size: 14px; color: var(--muted); }
.msg.ok { color: var(--ok); } .msg.err { color: var(--err); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; font: 500 14px/1 inherit; font-family: inherit;
}
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.search {
  margin-left: auto; flex: 0 1 240px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  font: inherit; font-size: 14px; background: var(--surface); color: var(--text);
}

.resume {
  display: flex; gap: 16px; align-items: center; background: var(--accent-soft); border-radius: 16px;
  padding: 14px 16px; margin-bottom: 28px; text-decoration: none; color: var(--text);
}
.resume img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; flex: none; }
.resume small { color: var(--muted); display: block; }
.resume strong { font-size: 17px; }
.resume .go { margin-left: auto; color: var(--accent); font-weight: 600; white-space: nowrap; }

.group h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.card:hover { transform: translateY(-2px); }
.card .img { aspect-ratio: 16/9; background: var(--accent-soft) center/cover no-repeat; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .kicker { font-size: 13px; color: var(--muted); }
.card .topic { font-size: 19px; font-weight: 650; line-height: 1.25; color: inherit; text-decoration: none; }
.card .topic::after { content: ""; position: absolute; inset: 0; } /* cala karta klikalna */
.card .days { font-size: 13.5px; color: var(--muted); }
.rename {
  position: absolute; top: 10px; right: 10px; z-index: 2; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.9); color: #1d1d1f; font: 500 12.5px/1 inherit; font-family: inherit;
  padding: 6px 10px; cursor: pointer; opacity: 0; transition: opacity .12s;
}
.card:hover .rename, .rename:focus-visible { opacity: 1; }
@media (hover: none) { .rename { opacity: 1; } }
.rename-input {
  position: relative; z-index: 2; font: 650 18px/1.25 inherit; font-family: inherit; width: 100%;
  border: 1px solid var(--accent); border-radius: 8px; padding: 4px 8px; background: var(--bg); color: var(--text);
}
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.pill { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; font-weight: 600; }
.pill.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; border: 1px dashed var(--line); border-radius: 16px; }

.missing main { max-width: 640px; padding-top: 80px; }
.missing p { display: flex; gap: 8px; flex-wrap: wrap; }
.missing code { background: var(--accent-soft); padding: 2px 6px; border-radius: 6px; }

@media (max-width: 600px) {
  h1 { font-size: 24px; }
  .search { margin-left: 0; flex: 1 1 100%; }
  .resume img { width: 56px; height: 56px; }
}

.narrow { max-width: 760px; }
.steps { padding-left: 20px; display: grid; gap: 18px; }
.steps pre {
  white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0;
}
.steps textarea, .steps select {
  width: 100%; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; background: var(--surface); color: var(--text); margin: 8px 0;
}
.row { display: block; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 5px; font-size: 13px; background: var(--surface); }
.foot { margin-top: 40px; font-size: 14px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.login main { max-width: 380px; padding-top: 12vh; }
.login form { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.login label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.login input { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); color: var(--text); }
.login .msg { margin: 0; }
