/* The shared board kit (js/settings-board.js). Everything here is built from Huddle's tokens, so
   Nova and Classic, light and dark, and every --font-scale follow the rest of the app. */

/* A board: columns at least 260 px side by side on a computer, one tile per row on a phone. */
.settings-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (min-width: 861px) {
  .settings-board {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

.settings-tile {
  position: relative;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* The title and its badge share one line. The badge takes up its own space at the right, so a
   long badge or larger text moves the title's words over instead of covering them. */
.settings-tile .tile-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.settings-tile .tile-title {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--heading);
  font-weight: 650;
  overflow-wrap: anywhere;
}

/* A tile's badge, top right, in the app's badge style (ok, danger, plain). */
.settings-tile .tile-badge {
  flex: none;
}

.settings-tile .tile-note {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: round(nearest, calc(13px * var(--font-scale)), 1px);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Switches side by side in a tile, each in its own bordered box, at least 44 px tall. A box is
   never narrower than its label plus its track, so the label can't slide under the switch. */
.settings-tile .tile-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  container-type: inline-size;
}

.settings-tile .tile-switches > .switch-control {
  flex: 1 1 auto;
  width: auto;
  min-width: max-content;
  padding-inline: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.settings-tile .tile-switches > .switch-control .switch-copy {
  flex: 0 1 auto;
  min-width: max-content;
}

/* A narrow tile (a phone, or two columns just above the phone breakpoint): a shorter track keeps
   On and Writes on one line with their whole labels. */
@container (max-width: 260px) {
  .settings-tile .tile-switches > .switch-control .switch-track {
    flex-basis: 40px;
    width: 40px;
  }

  .settings-tile .tile-switches > .switch-control.is-on .switch-thumb {
    transform: translateX(10px);
  }
}

@media (hover: hover) {
  .settings-tile .tile-switches > .switch-control:not(.is-disabled):not(.is-busy):hover { background: var(--surface-2); }
}

/* The Setup screen's head: the bot's 48 px picture before its name. */
.setup-board-head .setup-head-name {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.setup-board-head .setup-head-name .bot-avatar {
  flex: none;
}

/* An office that's off dims its Writes box, as it did in the old office row. */
.settings-tile.setup-office-tile:not(.is-on) .setup-writes-switch .switch-label {
  color: var(--muted);
}
