/* Portal-only styles: dashboard tiles, bottom bar, login box, launch states. */
.empty {
  margin-top: 14px;
  font-size: 14px;
  text-align: center;
  color: var(--fg-dim);
}

/* One centered column for the header, the grid and the bottom bar. The gutter and the safe areas
   are the body's padding (base.css). */
main,
.bar {
  width: 100%;
  max-width: 56rem;
  margin-inline: auto;
}

main:not(.center) .wm,
main:not(.center) .sub {
  text-align: center;
}

/* The matrix: always three columns, a multiple of three slots (index.html). 480px is a literal:
   media queries can't use custom properties. */
.grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(96px, auto);
  margin-top: 14px;
}

@media (min-width: 480px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 160px));
    justify-content: center;
  }
}

/* An unused slot: decoration only. Never interactive, so no hover, focus or active styles. */
.slot {
  border: var(--border) dashed var(--line);
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: var(--tap-target);
  padding: 8px;
  border: var(--border) solid var(--line);
  color: var(--fg);
  text-align: left;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s, opacity 0.15s;
}

@media (min-width: 480px) {
  .tile {
    padding: 12px;
  }
}

.tile svg {
  width: 34px;
  height: 34px;
}

.tile .n {
  font-size: 13px;
}

.tile .d {
  font-size: 11px;
  color: var(--fg-dim);
  /* Below 480px: hidden visually only (not display: none), so the accessible name keeps it. */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 480px) {
  .tile .d {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }
}

.tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tile:active {
  border-color: var(--fg);
}

@media (hover: hover) {
  .tile:hover {
    border-color: var(--fg);
  }
}

.tile.is-launching {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

.tile.is-launching .d {
  color: var(--accent);
}

.tile.is-dimmed {
  opacity: 0.35;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 8px;
  border-top: var(--border) solid var(--line);
  font-size: 12px;
  color: var(--fg-dim);
}

.bar form {
  margin: 0;
}

.bar button {
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--fg-dim);
  font-size: 12px;
}

.bar button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.bar button:active {
  background: transparent;
  color: var(--fg);
}

@media (hover: hover) {
  .bar button:hover {
    background: transparent;
    color: var(--fg);
  }
}

.bar-status.is-launching {
  color: var(--accent);
}

.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 22rem;
  padding: 18px;
  border: var(--border) solid var(--line);
}

/* The 403 page (spec 005): one fixed message, pink because it is an error. */
.denied {
  align-items: center;
  text-align: center;
}

.denied-title {
  font-size: 22px;
  color: var(--accent);
}

.denied-hint {
  font-size: 12px;
  font-style: italic;
  color: var(--fg-dim);
}

/* The 403 page's link back to the dashboard. */
.back {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target);
  color: var(--fg-dim);
  font-size: 12px;
  text-decoration: none;
}

.back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  color: var(--fg);
}

.back:active {
  color: var(--fg);
}

@media (hover: hover) {
  .back:hover {
    color: var(--fg);
  }
}

.field label {
  margin-bottom: 6px;
}

.f {
  position: relative;
  display: block;
}

.f.has-toggle input {
  padding-right: 48px;
}

/* Our eye replaces the browser's own reveal button (Edge); without JS the native one stays. */
.has-toggle input[type="password"]::-ms-reveal {
  display: none;
}

.eye {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg-dim);
}

.eye svg {
  width: 22px;
  height: 22px;
}

.eye[aria-pressed="true"] {
  color: var(--fg);
}

.eye:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.eye:active {
  background: transparent;
  color: var(--fg);
}

@media (hover: hover) {
  .eye:hover {
    background: transparent;
    color: var(--fg);
  }
}
