/* Add bar and the add-first sheet. Stencil for headers and the big count.
   Oswald for everything else. Colors come from the live palette. */

.rh-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.af-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--rh-obsidian);
  z-index: 6;
}
.af-bar-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  background: var(--rh-plate);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  cursor: pointer;
}
.af-bar-logo img { width: 26px; height: 26px; display: block; }
.af-bar-form { flex: 1 1 auto; min-width: 0; display: flex; }
.af-bar-form input {
  width: 100%;
  height: 40px;
  border-radius: 999px;
  border: 1.5px solid var(--rh-hero);
  background: var(--rh-surface);
  color: var(--fg-1);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 500;
  padding: 0 14px;
  min-width: 0;
}
.af-bar-form input::placeholder { color: var(--rh-steel); opacity: 1; }
.af-bar-form input:focus { outline: none; }
.af-bar-plus {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  border: 0;
  background: var(--rh-mark);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
}
.af-bar-gear {
  width: 36px;
  height: 40px;
  flex: 0 0 36px;
  border: 0;
  background: transparent;
  color: var(--fg-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.hub-bar { gap: 10px; }
.hub-bar-name {
  flex: 1 1 auto;
  text-align: center;
  font-family: var(--font-stencil);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-1);
  line-height: 1;
}

.af-host {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.af-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 23, 28, 0.45);
  border: 0;
  padding: 0;
}
.af-host { overflow: hidden; }
.af-sheet {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  flex: 1 1 auto;
  height: auto;
  max-height: 100%;
  background: var(--rh-obsidian);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: var(--shadow-3);
}
.af-grab {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: var(--rh-obsidian-400);
  margin: 8px auto 0;
  flex: 0 0 auto;
}
.af-head {
  display: grid;
  grid-template-columns: 72px 1fr 44px;
  align-items: center;
  padding: 0 8px;
  min-height: 44px;
  flex: 0 0 auto;
}
.af-iconbtn {
  border: 0;
  background: transparent;
  color: var(--fg-1);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-height: 44px;
  cursor: pointer;
  padding: 0 6px;
}
.af-iconbtn.af-x { font-size: 28px; line-height: 1; justify-self: end; }
.af-stepname {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.af-bars {
  display: flex;
  gap: 4px;
  padding: 0 16px 8px;
  flex: 0 0 auto;
}
.af-seg { flex: 1; height: 4px; border-radius: 2px; background: var(--rh-obsidian-500); }
.af-seg.done { background: var(--rh-brass); }
.af-seg.on { background: var(--rh-mark); }
.af-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 16px 12px;
}
.af-foot {
  flex: 0 0 auto;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--rh-obsidian);
}
.af-title {
  font-family: var(--font-stencil);
  font-weight: 900;
  font-size: 40px;
  line-height: 0.9;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-1);
  margin: 4px 0 8px;
}
.af-sub {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-3);
  margin: 0 0 12px;
}
.af-kicker {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 16px 0 8px;
}
.af-type {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1.5px solid var(--rh-brass);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--rh-surface);
}
.af-type-label {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--fg-3);
}
.af-type textarea {
  width: 100%;
  border: 0;
  resize: none;
  background: transparent;
  color: var(--fg-1);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  padding: 0;
  min-height: 48px;
}
.af-type textarea:focus { outline: none; }
.af-type textarea::placeholder { color: var(--rh-steel); opacity: 1; }
.af-tip {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--fg-3);
  margin: 8px 0 0;
}
.af-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.af-tile {
  text-align: left;
  background: var(--rh-surface);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  min-height: 112px;
  padding: 14px;
  cursor: pointer;
  color: var(--fg-1);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.af-tile-ico { color: var(--rh-mark); display: flex; }
.af-tile strong {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.af-tile > span:not(.af-tile-ico) {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-3);
}
.af-chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.af-chip, .af-repeat {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--rh-surface);
  color: var(--fg-1);
  min-height: 40px;
  padding: 8px 14px;
  cursor: pointer;
}
.af-chip.on, .af-ammo-chip.on {
  background: var(--rh-hero);
  color: #fff;
  border-color: var(--rh-hero);
}
.af-repeat { border-radius: 999px; }
.af-last {
  background: var(--rh-obsidian-700);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-1);
  margin-bottom: 12px;
}
.af-gun {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--rh-surface);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 14px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  color: var(--fg-1);
}
.af-gun.on { background: var(--rh-hero); color: #fff; border-color: var(--rh-hero); }
.af-gun-name {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  flex: 1;
}
.af-gun-meta {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
  text-align: right;
}
.af-gun.on .af-gun-meta { color: var(--rh-stone); }
.af-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 12px 0 8px;
}
.af-num {
  font-family: var(--font-stencil);
  font-weight: 900;
  font-size: 84px;
  line-height: 0.85;
  letter-spacing: 0.02em;
  color: var(--fg-1);
  min-width: 140px;
  text-align: center;
}
.af-num-label {
  display: block;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-top: 4px;
}
.af-stepper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--rh-surface);
  color: var(--fg-1);
  font-family: var(--font-ui);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}
.af-hint {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--fg-3);
  margin: 8px 0 0;
}
.af-ammo {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  background: var(--rh-surface);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  color: var(--fg-1);
}
.af-ammo.on { border-color: var(--rh-hero); box-shadow: inset 0 0 0 1px var(--rh-hero); }
.af-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--rh-hero);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.af-ammo.on .af-radio { background: var(--rh-mark); border-color: var(--rh-mark); }
.af-ammo.on .af-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.af-ammo > span:nth-child(2) { min-width: 0; }
.af-ammo-name { display: block; font-family: var(--font-ui); font-size: 16px; font-weight: 600; line-height: 1.25; }
.af-ammo-sub { display: block; font-family: var(--font-ui); font-size: 13px; color: var(--fg-3); margin-top: 2px; line-height: 1.3; }
.af-ammo-qty {
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.af-note {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--rh-success);
  margin: 8px 0 0;
}
.af-place {
  width: 100%;
  text-align: left;
  background: var(--rh-surface);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 8px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-1);
  cursor: pointer;
}
.af-place.on { background: var(--rh-hero); color: #fff; border-color: var(--rh-hero); }
.af-links { display: flex; gap: 16px; margin-top: 8px; }
.af-link {
  border: 0;
  background: transparent;
  color: var(--rh-mark);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  min-height: 44px;
}
.af-field {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--rh-surface);
  color: var(--fg-1);
  font-family: var(--font-ui);
  font-size: 16px;
  padding: 12px;
  margin-top: 8px;
}
.af-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-hairline);
}
.af-row-k {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.af-row-v {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg-1);
}
.af-row-sub {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-3);
  margin-top: 2px;
}
.af-edit {
  border: 0;
  background: transparent;
  color: var(--rh-mark);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  padding: 0 0 0 8px;
}
.af-notes {
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: transparent;
  color: var(--fg-1);
  font-family: var(--font-ui);
  font-size: 16px;
  padding: 12px 14px;
  min-height: 48px;
  resize: vertical;
}
.af-deduct {
  margin-top: 8px;
  background: rgba(27, 107, 58, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--rh-success);
  line-height: 1.4;
}
.af-deduct div + div { margin-top: 4px; }
.af-go {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--rh-mark);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.af-go:disabled { opacity: 0.4; cursor: default; }
.af-ammo-chip {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--rh-surface);
  color: var(--fg-1);
  min-height: 44px;
  padding: 8px 14px;
  cursor: pointer;
}
.af-check {
  color: var(--rh-success);
  font-family: var(--font-ui);
  font-weight: 600;
  margin-right: 8px;
}
.af-got {
  background: var(--rh-surface);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  overflow: hidden;
}
.af-got-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-hairline);
  font-family: var(--font-ui);
}
.af-got-row:last-child { border-bottom: 0; }
.af-got-k {
  width: 72px;
  flex: 0 0 72px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.af-got-v { font-size: 16px; font-weight: 600; color: var(--fg-1); }
.af-q {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rh-mark);
  margin: 14px 0 8px;
}
