* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font: var(--fw-regular) var(--fs-sm)/var(--lh-body) var(--font);
  background: var(--c-bg); color: var(--c-text);
  display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 100%;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -0.01em; margin: 0; }
h1 { font: var(--fw-bold) var(--fs-h1)/var(--lh-tight) var(--font); letter-spacing: -0.02em; }
h2 { font: var(--fw-bold) var(--fs-h2)/var(--lh-tight) var(--font); }
h3 { font: var(--fw-semibold) var(--fs-lg)/var(--lh-tight) var(--font); }
p { margin: 0; }
a { color: var(--c-text-link); }
a:hover { text-decoration-thickness: 2px; }
:where(button, input, select, textarea) { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--c-focus-outer); outline-offset: 2px; box-shadow: 0 0 0 2px var(--c-focus-inner); }
:focus:not(:focus-visible) { outline: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Every view fills #view; direct children get an even vertical rhythm. */
#view { min-width: 0; padding: var(--sp-6) var(--sp-8) var(--sp-12); background: var(--c-bg); }
#view > * + * { margin-top: var(--sp-4); }
#view > h1 { margin-bottom: var(--sp-2); }
.page-narrow { max-width: 880px; }
body.fullscreen { display: block; }
body.fullscreen .rail { display: none; }
body.fullscreen #view { padding: 0; height: 100vh; }
body.fullscreen #view > * + * { margin-top: 0; }

/* Navigation rail: sized by its widest label, so no font or zoom level can clip "Bewerbungen" or "Einstellungen". */
.rail {
  position: sticky; top: 0; height: 100vh; background: var(--c-bg);
  box-shadow: var(--shadow-side); display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-2); padding: var(--sp-4) var(--sp-1); z-index: 5; width: max-content; min-width: var(--rail);
}
.rail .brand {
  font-weight: var(--fw-bold); font-size: var(--fs-lg); text-decoration: none; color: var(--c-text);
  letter-spacing: -0.03em; margin-bottom: var(--sp-1);
}
.rail nav { display: flex; flex-direction: column; gap: var(--sp-1); width: 100%; margin-top: var(--sp-3); }
.rail nav a, .rail-create {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none;
  color: var(--c-text); font-size: 11px; line-height: 1.2; font-weight: var(--fw-medium); border: 0; background: transparent;
  border-radius: var(--r-md); padding: var(--sp-2) var(--sp-1); cursor: pointer; width: 100%; white-space: nowrap;
}
.rail nav a svg, .rail-create svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.rail nav a:hover { background: var(--c-bg-secondary); }
.rail nav a.active { background: var(--c-bg-secondary); font-weight: var(--fw-semibold); }
.rail-create { background: var(--c-accent); color: var(--c-on-accent); border-radius: var(--r-pill); width: 44px; height: 44px; padding: 0; justify-content: center; }
.rail-create:hover { background: var(--c-accent-hover); }

@media (max-width: 760px) {
  body { grid-template-columns: minmax(0, 1fr); padding-bottom: 64px; }
  .rail {
    width: 100%; min-width: 0;
    position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: 64px; width: 100%;
    flex-direction: row; border-right: 0; border-top: 1px solid var(--c-border); padding: var(--sp-1) var(--sp-2);
  }
  .rail .brand { display: none; }
  .rail nav { flex-direction: row; justify-content: space-around; margin-top: 0; }
  .rail nav a { flex: 1; font-size: 10px; padding: var(--sp-1) 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .rail nav { flex: 1; min-width: 0; gap: 0; }
  .rail-create { flex: none; width: 44px; }
  #view { padding: var(--sp-4) var(--sp-4) var(--sp-8); }
  h1 { font-size: var(--fs-h2); }
}
@media (max-width: 375px) {
  #view { overflow-x: hidden; }
  .board { overflow-x: auto; }
}
