/* The shell: icon rail, module header with sub-navigation, content; and the auth layout. */

.shell { display: flex; min-height: 100vh; }

.rail {
  flex: 0 0 var(--rail-w);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 6px;
  background: var(--rail-bg);
  color: var(--rail-ink);
}
.rail__brand { align-self: center; margin-bottom: 12px; }
.rail__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  min-height: var(--touch);
  padding: 8px 2px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--rail-ink);
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}
.rail__item:hover { background: var(--rail-hover); color: #ffffff; }
.rail__item[aria-current="page"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.rail__item--soon { opacity: 0.45; cursor: default; }
.rail__item--soon:hover { background: none; color: var(--rail-ink); }
.rail__spacer { flex: 1 1 auto; }
.rail__user { display: flex; justify-content: center; padding: 6px 0; }
.rail form { margin: 0; }

.shell__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.header { background: var(--bg-muted); border-bottom: 1px solid var(--line); }
.header__row { display: flex; align-items: center; gap: 16px; padding: 12px 24px; flex-wrap: wrap; }
.header__title { font-size: 18px; }
.header__toolbar { flex: 1 1 280px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 0; }

.subnav { display: flex; gap: 4px; padding: 0 16px; flex-wrap: wrap; }
.subnav__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-bottom: 3px solid transparent;
  color: var(--ink);
  text-decoration: none;
}
.subnav__link:hover { color: var(--accent-strong); }
.subnav__link[aria-current="page"] { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.subnav__link--push { margin-left: auto; }

.shell .flashes { padding: 16px 24px 0; }
.shell .flashes:empty { display: none; }
.content { flex: 1 1 auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }

/* Phones: the rail becomes a scrolling strip across the top. */
@media (max-width: 767px) {
  .shell { flex-direction: column; }
  .rail {
    position: static;
    height: auto;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 8px;
  }
  .rail__brand { margin: 0 6px 0 0; }
  .rail__item { width: auto; min-width: 64px; }
  .rail__spacer { flex: 0 0 8px; }
  .rail__user { display: none; }
  .header__row, .content, .shell .flashes { padding-left: 16px; padding-right: 16px; }
}

/* Sign in, password reset, unlock. */
.auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px 16px;
  background: var(--bg-muted);
}
.auth__brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 600; }
.auth__brand .brand-mark { width: 40px; height: 40px; border-radius: 10px; font-size: 16px; }
.auth .flashes { width: 100%; max-width: 400px; }
.auth .flashes:empty { display: none; }
.auth__card {
  width: 100%;
  max-width: 400px;
  padding: 28px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth__title { font-size: 20px; }
.auth__links { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.auth__divider { display: flex; align-items: center; gap: 12px; color: var(--ink-muted); font-size: 13px; }
.auth__divider::before, .auth__divider::after { content: ""; flex: 1; border-top: 1px solid currentColor; opacity: .35; }
.auth__hint { margin: 0; }
