/* ============================================================================
   Brandpatch AI — Apps
   The desk's room again: a #E4E4E9 page, one white frame (28px radius, 16px
   inset), Plus Jakarta Sans at zero tracking, DM Mono only for the run tape.
   The catalog of jobs sits on the white canvas; the app you picked opens in
   the grey rail — its blanks, the ask they build, and every run with its reply.
   Phone: one column (the list, then the app), 44px targets, 16px inputs.
   No Playfair, no purple, nothing under 12px. Lime only while a run is live.
   Transitions 120–180ms; reduced motion kills them.
   ========================================================================== */

:root, .ap {
  --ap-page: #E4E4E9;
  --ap-frame: #FFFFFF;
  --ap-frame-edge: rgba(20, 20, 30, .04);
  --ap-side: #F5F5F7;
  --ap-card: #FFFFFF;
  --ap-card-edge: rgba(0, 0, 0, .06);
  --ap-field: #F1F1F4;
  --ap-field-edge: rgba(0, 0, 0, .08);
  --ap-control-edge: #858D85;
  --ap-hair: rgba(0, 0, 0, .06);
  --ap-ink: #1A1A1A;
  --ap-ink-2: #5C5C66;
  --ap-muted: #767680;
  --ap-on-ink: #FFFFFF;
  --ap-ink-hi: #2B2B2B;
  --ap-live: #DEEC71;
  --ap-live-ink: #0D0D0D;
  --ap-bad: #B4432E;
  --ap-bad-soft: #FBE5DF;
  --ap-bad-ink: #8F3322;
  --ap-ghost: #E4E4E9;
  --ap-sh-frame: 0 24px 60px rgba(20, 20, 30, .08);
  --ap-sh-card: 0 10px 28px rgba(40, 24, 16, .06);
  --ap-r-frame: 28px;
  --ap-inset: 16px;
  --ap-rail-w: clamp(380px, 40vw, 520px);
  --ap-fast: 120ms;
  --ap-mid: 180ms;
}

/* the shell's legacy tokens resolve to this palette, so the bar lands on the
   desk's greys whatever the theme cookie says */
body, html[data-theme="light"] body, html[data-theme="dark"] body, .ap {
  --room: var(--ap-page); --ink: var(--ap-side); --panel: var(--ap-card); --panel-2: var(--ap-field);
  --edge: var(--ap-field-edge); --edge-soft: var(--ap-hair); --edge-strong: rgba(0, 0, 0, .16);
  --bone: var(--ap-ink); --bone-dim: var(--ap-ink-2); --faint: var(--ap-muted);
  --on-bone: var(--ap-on-ink); --bone-hi: var(--ap-ink-hi);
  --glacier: var(--ap-ink); --glacier-dim: var(--ap-ink-2);
  --ember: var(--ap-bad); --ember-soft: var(--ap-bad); --ember-sunk: var(--ap-bad-soft);
  --code-fg: #2A2826; --strong-fg: var(--ap-ink);
  --lane: var(--ap-live); --lane-ink: var(--ap-live-ink);
  --display: var(--sans);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--room); color: var(--bone); font-family: var(--sans); font-size: 14px; line-height: 1.5; letter-spacing: 0; -webkit-font-smoothing: antialiased; }
body::before { display: none; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: 0; }
a { color: var(--ap-ink); text-decoration-color: var(--ap-muted); text-underline-offset: 2px; }
.ic { width: 16px; height: 16px; flex: none; display: block; }
.ap-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 99; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--ap-card); border: 1px solid var(--ap-card-edge); color: var(--ap-ink); font-weight: 600; text-decoration: none; box-shadow: 0 16px 40px rgba(20, 20, 30, .12); }
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--ap-ink); outline-offset: 2px; }
::selection { background: rgba(26, 26, 26, .14); color: inherit; }

.ap-meta { font-size: 12px; line-height: 1.45; color: var(--ap-muted); }
.ap-tape { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--ap-muted); font-variant-numeric: tabular-nums; }

/* ── the frame: one white sheet on the grey page, the height of the room ── */
.ap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ap-rail-w);
  grid-template-rows: minmax(0, 1fr);
  height: calc(100dvh - var(--bar-h, 52px) - 2 * var(--ap-inset));
  min-height: 480px;
  margin: var(--ap-inset);
  border-radius: var(--ap-r-frame);
  overflow: hidden;
  background: var(--ap-frame);
  color: var(--ap-ink);
  box-shadow: var(--ap-sh-frame), 0 0 0 1px var(--ap-frame-edge);
}
.ap > .ap-error, .ap > .ap-state, .ap > .ap-gate, .ap > .ap-boot { grid-column: 1 / -1; }
.ap-shell { display: contents; }
.ap:has(> .ap-error:not([hidden])) { grid-template-rows: auto minmax(0, 1fr); }
.ap:has(> .ap-error:not([hidden])) > .ap-error { grid-row: 1; }
.ap:has(> .ap-error:not([hidden])) .ap-catalog, .ap:has(> .ap-error:not([hidden])) .ap-run,
.ap:has(> .ap-error:not([hidden])) > .ap-state, .ap:has(> .ap-error:not([hidden])) > .ap-gate { grid-row: 2; }
.ap-error {
  align-self: start; margin: 20px 24px 0; padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--ap-bad) 30%, transparent); border-radius: 12px;
  background: var(--ap-bad-soft); color: var(--ap-bad-ink); font-size: 13px;
}

/* ── buttons: the desk's family — black pill, hairline pill, quiet text ── */
.btn-solid, .btn-outline, .btn-quiet {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color var(--ap-fast) var(--e-out), border-color var(--ap-fast) var(--e-out), color var(--ap-fast) var(--e-out), transform var(--ap-fast) var(--e-out);
}
.btn-solid { background: var(--ap-ink); color: var(--ap-on-ink); border-color: var(--ap-ink); }
.btn-solid:hover { background: var(--ap-ink-hi); border-color: var(--ap-ink-hi); }
.btn-outline { border-color: var(--ap-field-edge); color: var(--ap-ink); background: var(--ap-card); }
.btn-outline:hover { background: var(--ap-field); border-color: rgba(0, 0, 0, .16); }
.btn-quiet { color: var(--ap-ink-2); background: transparent; padding: 0 12px; font-weight: 500; }
.btn-quiet:hover { background: var(--ap-field); color: var(--ap-ink); }
.btn-solid:active, .btn-outline:active { transform: translateY(1px); }
.btn-solid:disabled, .btn-outline:disabled, .btn-quiet:disabled { opacity: .45; cursor: not-allowed; }
.btn-solid .ic, .btn-outline .ic { transition: transform var(--ap-mid) var(--e-out); }
@media (hover: hover) and (pointer: fine) {
  .btn-solid:not(:disabled):hover > .ic:last-child { transform: translateX(3px); }
}

/* ── loading: the catalog's own shape, drawn empty ─────────────────────── */
.ap-boot { display: grid; align-content: start; gap: 16px; padding: 32px; }
.ap-boot-head { display: grid; gap: 10px; }
.ap-bar { display: block; height: 10px; border-radius: 5px; background: var(--ap-field); }
.ap-bar.is-h1 { width: 9rem; height: 28px; border-radius: 8px; }
.ap-bar.is-lede { width: min(28rem, 80%); }
.ap-boot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 12px; max-width: 760px; }
.ap-skel {
  display: block; height: 96px; border-radius: 20px;
  background: linear-gradient(90deg, #ececf0 0%, #f7f7f9 45%, #ececf0 90%);
  background-size: 200% 100%; animation: ap-skel 1.2s ease-in-out infinite;
}
@keyframes ap-skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ── states that fill the frame: signed out, not on this host, broken ──── */
.ap-gate, .ap-state {
  align-self: stretch; justify-self: stretch; width: 100%; margin: 0;
  padding: clamp(32px, 5vw, 72px) clamp(24px, 5vw, 72px);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(20rem, .9fr);
  gap: clamp(32px, 5vw, 80px); align-items: center; align-content: center;
  overflow-y: auto;
}
.ap-pitch { display: grid; gap: 20px; min-width: 0; }
.ap-display { font-family: var(--sans); font-size: clamp(2.5rem, 5.2vw, 4.25rem); font-weight: 800; line-height: 1.04; letter-spacing: 0; color: var(--ap-ink); text-wrap: balance; }
.ap-display span { display: block; color: var(--ap-muted); }
.ap-lede { color: var(--ap-ink-2); font-size: 16px; line-height: 1.55; max-width: 50ch; }
.ap-door-card {
  display: grid; gap: 14px; align-content: start;
  padding: 28px; border-radius: 24px; background: var(--ap-side);
}
.ap-door-card h2 { font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--ap-ink); }
.ap-door-card p { color: var(--ap-ink-2); font-size: 14px; line-height: 1.55; }
.ap-door-card .btn-solid { width: 100%; min-height: 48px; justify-content: space-between; padding: 0 20px 0 22px; }
.ap-door-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-door-row .btn-outline, .ap-door-row .btn-quiet { flex: 1 1 10rem; }
.ap-door-foot { color: var(--ap-muted) !important; font-size: 13px !important; }
.ap-door-foot a { color: var(--ap-ink-2); }
.ap-door-card .ap-tape { overflow-wrap: anywhere; }
.ap-state-mark {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 14px; background: var(--ap-card); border: 1px solid var(--ap-card-edge); color: var(--ap-ink-2);
}
.ap-state.is-bad .ap-state-mark { background: var(--ap-bad-soft); color: var(--ap-bad); border-color: transparent; }

/* the gate's picture: one app card, drawn empty — its blanks are the slots
   the ask is built from */
.ap-ghost {
  display: grid; gap: 14px; padding: 18px; max-width: 30rem;
  border-radius: 20px; background: var(--ap-card); border: 1px solid var(--ap-card-edge); box-shadow: var(--ap-sh-card);
  transform: rotate(-1.2deg);
}
.ap-ghost-top { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: center; }
.ap-ghost-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--ap-ink); color: var(--ap-on-ink); }
.ap-ghost-lines { display: grid; gap: 8px; }
.ap-ghost-lines .ap-bar:first-child { width: 55%; height: 12px; background: var(--ap-ghost); }
.ap-ghost-lines .ap-bar:last-child { width: 85%; height: 8px; }
.ap-ghost-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border-radius: 14px; background: var(--ap-side); border: 1px solid var(--ap-hair); }
.ap-ghost-ask .ap-bar { height: 8px; }
.ap-ghost-slot { display: inline-block; width: 4.5rem; height: 24px; border-radius: 8px; border: 1.5px dashed var(--ap-field-edge); background: var(--ap-card); }
.ap-ghost-slot.is-filled { border-style: solid; border-color: var(--ap-ink); background: var(--ap-ink); width: 5.5rem; }

/* ── the catalog: white canvas, grouped by business, scrolls on its own ── */
.ap-catalog {
  grid-column: 1; grid-row: 1;
  min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 32px 40px;
  scrollbar-width: thin; scrollbar-color: var(--ap-field-edge) transparent;
}
.ap-catalog > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.ap-head { display: grid; gap: 6px; }
.ap-head h1 { font-size: 36px; line-height: 1.1; font-weight: 800; letter-spacing: 0; color: var(--ap-ink); }
.ap-head .ap-lede { font-size: 14px; max-width: 58ch; }
.ap-groups { display: grid; gap: 28px; margin-top: 28px; }
.ap-group { display: grid; gap: 12px; }
.ap-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--ap-hair); }
.ap-group-head h2 { font-size: 17px; font-weight: 700; color: var(--ap-ink); }
.ap-group-head p { color: var(--ap-ink-2); font-size: 13px; text-align: right; }
.ap-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 12px; }
.ap-cards > li { display: grid; min-width: 0; }

.ap-card {
  position: relative;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 32px; column-gap: 14px; row-gap: 4px; align-items: start;
  width: 100%; min-height: 96px; padding: 16px; text-align: left; min-width: 0;
  background: var(--ap-card); border: 1px solid var(--ap-card-edge); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(20, 20, 30, .03); color: var(--ap-ink-2); cursor: pointer;
  transition: border-color var(--ap-fast) var(--e-out), background-color var(--ap-mid) var(--e-out), box-shadow var(--ap-mid) var(--e-out), color var(--ap-fast) var(--e-out), transform var(--ap-fast) var(--e-out);
}
.ap-card:hover { border-color: var(--ap-field-edge); box-shadow: var(--ap-sh-card); transform: translateY(-1px); }
.ap-card:active { transform: translateY(1px); }
.ap-card-ic {
  grid-column: 1; grid-row: 1 / span 3; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 14px; background: var(--ap-field); color: var(--ap-ink);
  transition: background-color var(--ap-fast) var(--e-out), color var(--ap-fast) var(--e-out);
}
.ap-card-title { grid-column: 2; grid-row: 1; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--ap-ink); overflow-wrap: anywhere; }
.ap-card-blurb {
  grid-column: 2; grid-row: 2; font-size: 13px; line-height: 1.45; color: var(--ap-ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ap-card-kind { grid-column: 2; grid-row: 3; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--ap-muted); }
.ap-card-kind .ic { width: 14px; height: 14px; }
.ap-card-go {
  grid-column: 3; grid-row: 1 / span 2; display: grid; place-items: center; align-self: center;
  width: 32px; height: 32px; border-radius: 999px;
  border: 1px solid var(--ap-field-edge); background: var(--ap-card); color: var(--ap-ink-2);
  transition: background-color var(--ap-mid) var(--e-out), border-color var(--ap-mid) var(--e-out), color var(--ap-mid) var(--e-out);
}
.ap-card-go .ic { transition: transform var(--ap-mid) var(--e-out); }
@media (hover: hover) and (pointer: fine) {
  .ap-card:not([aria-current="true"]):hover .ap-card-go { background: var(--ap-ink); border-color: var(--ap-ink); color: var(--ap-on-ink); }
  .ap-card:not([aria-current="true"]):hover .ap-card-go .ic { transform: translateX(2px); }
  .ap-card:not([aria-current="true"]):hover .ap-card-ic { background: var(--ap-ink); color: var(--ap-on-ink); }
}
/* the open app: the desk's ink door */
.ap-card[aria-current="true"] { background: var(--ap-ink); border-color: var(--ap-ink); color: rgba(255, 255, 255, .72); box-shadow: 0 10px 28px rgba(20, 20, 30, .16); transform: none; }
.ap-card[aria-current="true"] .ap-card-title { color: var(--ap-on-ink); }
.ap-card[aria-current="true"] .ap-card-blurb { color: rgba(255, 255, 255, .78); }
.ap-card[aria-current="true"] .ap-card-kind { color: rgba(255, 255, 255, .7); }
.ap-card[aria-current="true"] .ap-card-ic { background: rgba(255, 255, 255, .14); color: var(--ap-on-ink); }
.ap-card[aria-current="true"] .ap-card-go { background: var(--ap-card); border-color: var(--ap-card); color: var(--ap-ink); }
/* a run is live on this app: the tile goes lime, the patch says so */
.ap-card.is-live .ap-card-ic { background: var(--ap-live); color: var(--ap-live-ink); }
.ap-card-live { position: absolute; right: 12px; bottom: 12px; }

.ap-empty {
  display: grid; gap: 8px; justify-items: start; margin-top: 28px; padding: 24px;
  border: 1.5px dashed var(--ap-field-edge); border-radius: 20px; background: var(--ap-side); color: var(--ap-ink-2);
}
.ap-empty h2 { font-size: 16px; font-weight: 700; color: var(--ap-ink); }
.ap-empty p { max-width: 48ch; font-size: 14px; }

/* the patch: lime ground while a run is live, ink on it, a hair of tilt */
.patch { display: inline-block; transform: rotate(-1.5deg); transform-origin: 40% 60%; }
.patch > * { display: inline-block; background: var(--ap-live); color: var(--ap-live-ink); padding: 2px 8px 3px; border-radius: 4px; line-height: 1.2; font-size: 12px; font-weight: 600; font-style: normal; transform-origin: right center; }

/* ── the rail: the app you picked, its blanks, the ask, and its runs ───── */
.ap-run {
  grid-column: 2; grid-row: 1;
  min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 24px 24px calc(32px + env(safe-area-inset-bottom));
  background: var(--ap-side); border-left: 1px solid var(--ap-hair);
  scrollbar-width: thin; scrollbar-color: var(--ap-field-edge) transparent;
}
.ap-run-empty { display: grid; gap: 20px; align-content: start; padding-top: 12px; }
.ap-run-empty .ap-ghost { transform: rotate(-1.5deg); max-width: none; }
.ap-run-empty h2 { font-size: 17px; font-weight: 700; color: var(--ap-ink); }
.ap-run-empty p { color: var(--ap-ink-2); font-size: 14px; max-width: 40ch; }
.ap-run-body { display: grid; gap: 16px; align-content: start; }
.ap-back { display: none; justify-self: start; margin-left: -8px; padding: 0 12px 0 8px; color: var(--ap-ink); font-weight: 600; }
.ap-back .ic { transform: rotate(180deg); }
.ap-run-head { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 4px; align-items: start; }
.ap-run-ic { grid-row: 1 / span 3; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--ap-ink); color: var(--ap-on-ink); }
.ap-run-head h2 { font-size: 22px; line-height: 1.2; font-weight: 800; color: var(--ap-ink); overflow-wrap: anywhere; }
.ap-run-head p { color: var(--ap-ink-2); font-size: 14px; line-height: 1.5; }
.ap-run-head .ap-tape { font-family: var(--sans); font-size: 12px; color: var(--ap-muted); }

/* the form: white card, blanks stacked, the ask under them, then Run */
.ap-form { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--ap-card-edge); border-radius: 20px; background: var(--ap-card); box-shadow: var(--ap-sh-card); }
.ap-fields { display: grid; gap: 14px; }
.ap-field-guide { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-width: 0; }
.ap-field-guide > p { flex: 1 1 140px; margin: 0; }
.ap-field-guide > button { min-height: 44px; max-width: 100%; padding: 10px 14px; font-size: 13px; white-space: normal; text-align: left; overflow-wrap: anywhere; }
.ap-field-guide[hidden] { display: none; }
.ap-disclosure { min-width: 0; border-block: 1px solid var(--ap-hair); }
.ap-disclosure > summary { min-height: 44px; padding: 10px 4px; color: var(--ap-ink); font-size: 14px; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.ap-disclosure > summary::marker { color: var(--ap-ink-2); }
.ap-disclosure > summary:hover { background: var(--ap-field); }
.ap-disclosure-body { display: grid; gap: 12px; padding: 4px 0 16px; min-width: 0; }
.ap-preset-picker, .ap-preset-save { display: grid; gap: 8px; min-width: 0; }
.ap-preset-picker label, .ap-preset-save label { font-size: 14px; font-weight: 600; color: var(--ap-ink); }
.ap-preset-picker select, .ap-preset-save input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--ap-control-edge); border-radius: 9px; background: var(--ap-field); color: var(--ap-ink); font: 400 16px/1.5 var(--sans); caret-color: var(--ap-ink); }
.ap-preset-picker select { height: 44px; min-block-size: 44px; }
.ap-preset-save { padding-top: 16px; border-top: 1px solid var(--ap-hair); }
.ap-preset-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-preset-help { display: grid; min-width: 0; }
.ap-preset-help > p { grid-area: 1 / 1; margin: 0; }
#apPresetHintSizer { visibility: hidden; pointer-events: none; user-select: none; }
.ap-presets .btn-outline, .ap-presets .btn-quiet { min-height: 44px; padding-inline: 14px; font-size: 13px; justify-self: start; }
.ap-preset-feedback { font-size: 13px; line-height: 1.6; color: var(--ap-ink-2); overflow-wrap: anywhere; }
.ap-preset-feedback.is-error { color: var(--ap-bad-ink); }
.ap-presets ::selection { background: var(--ap-live); color: var(--ap-live-ink); }
html[data-keyboard-nav] .ap :is(button, a):active { transform: none; }
.ap-fld { display: grid; gap: 6px; min-width: 0; }
.ap-fld label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ap-ink); }
.ap-fld label small { font-size: 12px; font-weight: 500; color: var(--ap-muted); }
.ap-fld input, .ap-fld textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; font-size: 16px; line-height: 1.45;
  border: 1px solid var(--ap-field-edge); border-radius: 12px; background: var(--ap-field); color: var(--ap-ink);
  transition: border-color var(--ap-fast) var(--e-out), background-color var(--ap-fast) var(--e-out);
}
.ap-fld textarea { min-height: 5.5rem; max-height: 16rem; resize: vertical; }
.ap-fld input::placeholder, .ap-fld textarea::placeholder { color: var(--ap-muted); }
.ap-fld input:focus-visible, .ap-fld textarea:focus-visible { border-color: var(--ap-ink); background: var(--ap-card); outline-offset: 1px; }
.ap-fld [aria-invalid="true"] { border-color: var(--ap-bad); background: var(--ap-card); }
.ap-fld-error { display: flex; align-items: center; gap: 6px; color: var(--ap-bad-ink); font-size: 13px; }
.ap-fld-error .ic { width: 14px; height: 14px; color: var(--ap-bad); }

/* the signature: the app's own ask, word for word, with its blanks as slots
   that fill while you type — what you see is what gets sent */
.ap-ask { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--ap-side); border: 1px solid var(--ap-hair); }
.ap-ask-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ap-ask-head h3 { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ap-ink); }
.ap-ask-head h3 .ic { color: var(--ap-ink-2); }
.ap-ask-toggle { min-height: 44px; margin: -8px -6px -8px 0; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ap-ink-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color var(--ap-fast) var(--e-out), color var(--ap-fast) var(--e-out); }
.ap-ask-toggle:hover { background: var(--ap-card); color: var(--ap-ink); }
.ap-ask-text {
  position: relative; max-height: 7.6em; overflow: hidden;
  font-size: 14px; line-height: 1.9; color: var(--ap-ink-2); white-space: pre-wrap; overflow-wrap: anywhere;
}
.ap-ask-text::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em; pointer-events: none;
  background: linear-gradient(to bottom, rgba(245, 245, 247, 0), var(--ap-side));
}
.ap-ask.is-open .ap-ask-text { max-height: none; }
.ap-ask.is-open .ap-ask-text::after, .ap-ask.is-short .ap-ask-text::after { display: none; }
.ap-ask.is-short .ap-ask-toggle { display: none; }
.ap-slot {
  display: inline; padding: 2px 7px; border-radius: 7px;
  font-weight: 600; color: var(--ap-ink); background: var(--ap-card); border: 1px solid var(--ap-field-edge);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-color var(--ap-fast) var(--e-out), border-color var(--ap-fast) var(--e-out), color var(--ap-fast) var(--e-out);
}
.ap-slot.is-empty { font-weight: 500; color: var(--ap-muted); border-style: dashed; background: transparent; }
.ap-slot.is-filled { background: var(--ap-ink); border-color: var(--ap-ink); color: var(--ap-on-ink); }
.ap-slot.is-missing { color: var(--ap-bad-ink); border-color: var(--ap-bad); border-style: dashed; background: var(--ap-bad-soft); }
.ap-slot.is-focus { border-color: var(--ap-ink); border-style: solid; }
.ap-slot.is-filled.is-focus { box-shadow: 0 0 0 2px var(--ap-side), 0 0 0 3px var(--ap-ink); }
.ap-ask-note { display: flex; align-items: flex-start; gap: 8px; color: var(--ap-ink-2); font-size: 12px; }
.ap-ask-note .ic { width: 14px; height: 14px; margin-top: 1px; color: var(--ap-muted); }

.ap-form-error { display: flex; align-items: center; gap: 8px; color: var(--ap-bad-ink); font-size: 13px; }
.ap-form-error .ic { color: var(--ap-bad); }
.ap-form-foot { display: grid; gap: 8px; }
.ap-form-foot .btn-solid { width: 100%; min-height: 48px; justify-content: space-between; padding: 0 20px 0 22px; }
/* the hint under Run keeps one 20px line whether it holds words or the
   "Follow it below" button (44px target, -12px margins = 20px): the form
   never grows when a run starts, nor shrinks when it lands */
.ap-form-foot .ap-meta { text-align: center; line-height: 20px; min-height: 20px; }
/* a live run: the same black pill, now the progress — lime dot, phase, clock */
.ap-form-foot .btn-solid.is-running { justify-content: flex-start; gap: 10px; cursor: progress; }
.ap-form-foot .btn-solid.is-running:hover { background: var(--ap-ink); border-color: var(--ap-ink); }
.ap-form-foot .btn-solid.is-running:active { transform: none; }
.btn-solid.is-running > .ic { display: none; }
.btn-solid.is-running #apRunLabel { flex: 1 1 auto; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.ap-run-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ap-live); animation: ap-breath 1.2s ease-in-out infinite; }
.ap-run-clock { flex: none; font-family: var(--mono); font-size: 12px; font-weight: 400; color: rgba(255, 255, 255, .72); font-variant-numeric: tabular-nums; }
.ap-follow {
  display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; padding: 0 4px;
  border: 0; background: transparent; color: var(--ap-ink-2); font-size: 12px; font-weight: 600; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--ap-muted); text-underline-offset: 2px;
  transition: color var(--ap-fast) var(--e-out);
}
.ap-follow:hover { color: var(--ap-ink); }

/* ── runs: the ask as you sent it, then the reply or the picture ───────── */
.ap-runs { display: grid; gap: 12px; }
.ap-runs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ap-runs-head h3 { font-size: 15px; font-weight: 700; color: var(--ap-ink); }
.ap-runs-head a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--ap-ink-2); text-align: right; }
.ap-run-list { list-style: none; padding: 0; display: grid; gap: 16px; }
.ap-turn { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.ap-turn.is-new { animation: ap-rise var(--ap-mid) var(--e-out) both; }
@keyframes ap-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
/* the ask you sent: the desk's user bubble, on the right */
.ap-said {
  justify-self: end; max-width: 92%; padding: 10px 14px; border-radius: 18px 18px 6px 18px;
  background: var(--ap-ink); color: var(--ap-on-ink); font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.ap-said.is-clamped .ap-said-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ap-said-more { justify-self: end; min-height: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--ap-ink-2); font-size: 12px; font-weight: 500; cursor: pointer; }
.ap-said-more:hover { background: var(--ap-card); color: var(--ap-ink); }
/* the reply: a white card; lime border only while the run is live */
.ap-reply {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 16px; min-width: 0;
  border: 1px solid var(--ap-card-edge); border-radius: 16px; background: var(--ap-card); color: var(--ap-ink);
  transition: border-color var(--ap-mid) var(--e-out);
}
.ap-reply.is-live { border-color: color-mix(in srgb, var(--ap-live) 80%, var(--ap-card-edge)); }
.ap-reply.is-failed { border-color: color-mix(in srgb, var(--ap-bad) 35%, transparent); }
.ap-reply-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.ap-reply-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ap-ink); }
.ap-reply-state .ic { width: 14px; height: 14px; }
.ap-reply.is-failed .ap-reply-state { color: var(--ap-bad-ink); }
.ap-reply.is-failed .ap-reply-state .ic { color: var(--ap-bad); }
.ap-reply-right { display: inline-flex; align-items: center; gap: 8px; }
.ap-reply-clock { font-family: var(--mono); font-size: 12px; color: var(--ap-muted); font-variant-numeric: tabular-nums; }
.ap-stop { min-height: 44px; padding: 0 12px; font-size: 13px; }
/* thinking: three ink dots, a slow breath — nothing lime but the patch */
.ap-wait { display: inline-flex; gap: 5px; padding: 6px 0; }
.ap-wait i { width: 6px; height: 6px; border-radius: 50%; background: var(--ap-ink-2); opacity: .35; animation: ap-breath 1.2s ease-in-out infinite; }
.ap-wait i:nth-child(2) { animation-delay: .15s; }
.ap-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes ap-breath { 0%, 100% { opacity: .25; } 50% { opacity: .8; } }

.ap-md { font-size: 14px; line-height: 1.6; color: var(--ap-ink); overflow-wrap: anywhere; min-width: 0; }
.ap-md > * + * { margin-top: .6em; }
.ap-md p, .ap-md ul, .ap-md ol { margin: 0; }
.ap-md ul, .ap-md ol { padding-left: 1.3em; }
.ap-md li + li { margin-top: .25em; }
.ap-md h1, .ap-md h2, .ap-md h3, .ap-md h4 { font-size: 15px; font-weight: 700; line-height: 1.35; margin: .9em 0 0; }
.ap-md strong { font-weight: 700; }
.ap-md code { font-family: var(--mono); font-size: 13px; padding: 1px 5px; border-radius: 5px; background: var(--ap-field); }
.ap-md pre { position: relative; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--ap-side); border: 1px solid var(--ap-hair); overflow-x: auto; }
.ap-md pre:has(> .code-copy) { padding-top: 50px; }
.ap-md pre code { padding: 0; background: transparent; white-space: pre-wrap; }
.ap-md .code-copy { position: absolute; right: 2px; top: 2px; min-height: 44px; min-width: 44px; padding: 0 10px; border: 1px solid var(--ap-card-edge); border-radius: 8px; background: var(--ap-card); font-size: 12px; cursor: pointer; }
.ap-md blockquote { margin: 0; padding-left: 12px; border-left: 2px solid var(--ap-field-edge); color: var(--ap-ink-2); }
.ap-md hr { border: 0; border-top: 1px solid var(--ap-hair); }
.ap-md a { color: var(--ap-ink); }
.ap-md table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
/* cells wrap at spaces, never inside a word ("Cana|l"): the table scrolls sideways instead */
.ap-md th, .ap-md td { padding: 6px 8px; border: 1px solid var(--ap-hair); text-align: left; font-size: 13px; overflow-wrap: normal; }

.ap-shot { display: block; max-width: 100%; border-radius: 12px; overflow: hidden; background: var(--ap-field); border: 1px solid var(--ap-card-edge); }
.ap-shot:not(.is-loaded) { min-height: 12rem; }
.ap-shot img { display: block; width: 100%; max-width: 100%; height: auto; max-height: 28rem; object-fit: contain; background: var(--ap-field); opacity: 0; transition: opacity var(--ap-mid) var(--e-out); }
.ap-shot.is-loaded img { opacity: 1; }
/* the picture exists but not as something this page can show: say where it is */
.ap-file {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 10px; row-gap: 10px; align-items: center;
  padding: 12px; border-radius: 12px; background: var(--ap-side); border: 1px solid var(--ap-hair); color: var(--ap-ink-2);
}
.ap-file > .ic { align-self: start; margin-top: 2px; color: var(--ap-muted); }
.ap-file-body { display: grid; gap: 6px; min-width: 0; font-size: 13px; line-height: 1.5; }
.ap-file-body code { justify-self: start; max-width: 100%; padding: 2px 6px; border-radius: 6px; background: var(--ap-card); border: 1px solid var(--ap-hair); font-family: var(--mono); font-size: 12px; color: var(--ap-ink); overflow-wrap: anywhere; }
.ap-file .btn-outline { grid-column: 2; justify-self: start; min-height: 44px; padding: 0 14px; font-size: 13px; }
.ap-reply { scroll-margin: 16px; }
.ap-reply-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-reply-actions .btn-outline, .ap-reply-actions .btn-quiet { min-height: 44px; padding: 0 14px; font-size: 13px; }
.ap-reply-actions .btn-quiet { padding: 0 10px; }
.ap-reply-actions > :is(a, button) { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.ap-reply-actions .is-done { color: var(--ap-ink); }
.ap-fail {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 10px; row-gap: 4px; align-items: start;
  padding: 10px 12px; border-radius: 10px; background: var(--ap-bad-soft);
  border: 1px solid color-mix(in srgb, var(--ap-bad) 18%, transparent); color: var(--ap-bad-ink);
}
.ap-fail > .ic { grid-row: 1 / span 2; margin-top: 2px; color: var(--ap-bad); }
.ap-fail p { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.ap-fail a { color: var(--ap-bad-ink); font-weight: 600; }
.ap-note { display: flex; align-items: flex-start; gap: 8px; color: var(--ap-ink-2); font-size: 13px; }
.ap-note .ic { width: 14px; height: 14px; margin-top: 2px; color: var(--ap-muted); }
.ap-reply-line { font-size: 12px; color: var(--ap-muted); overflow-wrap: anywhere; }
/* a reply with several versions: one card each, its own Copy */
.ap-vers { display: grid; gap: 10px; min-width: 0; }
.ap-ver-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ap-ver {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; align-items: center; min-width: 0;
  padding: 10px 10px 12px 12px; border-radius: 12px; background: var(--ap-side); border: 1px solid var(--ap-hair);
}
.ap-ver-label { font-size: 12px; font-weight: 600; color: var(--ap-ink-2); overflow-wrap: anywhere; }
.ap-ver .ap-md { grid-column: 1 / -1; }
.ap-ver-copy { min-height: 44px; padding: 0 12px; font-size: 13px; }
.ap-ver-copy.is-done { color: var(--ap-ink); }
/* a version written as a code fence is still a message: the card's Copy is
   the only Copy, and the fence reads in the page's own hand */
.ap-ver .ap-md pre { background: var(--ap-card); }
.ap-ver .ap-md pre code { font-family: var(--sans); font-size: 14px; line-height: 1.6; }
.ap-ver .code-copy { display: none; }

/* ── what a finished run hands you: links to copy, one as a QR ─────────── */
.ap-hand {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px;
  padding: 12px; border-radius: 12px; background: var(--ap-side); border: 1px solid var(--ap-hair);
}
.ap-hand > .ap-meta { flex: 1 1 100%; }
.ap-links { list-style: none; padding: 0; display: grid; gap: 10px; flex: 1 1 14rem; min-width: 0; }
.ap-link { display: grid; gap: 4px; min-width: 0; }
.ap-link + .ap-link { padding-top: 10px; border-top: 1px solid var(--ap-hair); }
.ap-link-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ap-ink); }
.ap-link-label .ic { width: 14px; height: 14px; color: var(--ap-ink-2); }
.ap-link-url {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding: 4px 8px; border-radius: 8px; background: var(--ap-card); border: 1px solid var(--ap-hair);
  font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--ap-ink); overflow-wrap: anywhere; word-break: break-all;
}
.ap-link-msg { font-size: 12px; line-height: 1.45; color: var(--ap-ink-2); overflow-wrap: anywhere; }
.ap-link-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ap-link-actions .btn-outline, .ap-link-actions .btn-quiet { min-height: 44px; padding: 0 14px; font-size: 13px; }
.ap-link-actions .btn-quiet { padding: 0 10px; }
.ap-qr-btn[aria-pressed="true"] { background: var(--ap-card); color: var(--ap-ink); box-shadow: inset 0 0 0 1px var(--ap-field-edge); }
.ap-qr { flex: 0 0 auto; display: grid; gap: 6px; justify-items: center; width: 160px; margin: 0; }
.ap-qr-pic { width: 160px; height: 160px; border-radius: 10px; overflow: hidden; background: #FFFFFF; border: 1px solid var(--ap-hair); }
.ap-qr-pic svg { display: block; width: 100%; height: 100%; }
.ap-qr-cap { font-size: 12px; line-height: 1.4; color: var(--ap-ink-2); text-align: center; overflow-wrap: anywhere; }
.ap-cal-when { font-weight: 500; color: var(--ap-ink-2); }
.ap-cal-when::before { content: "·"; margin-right: 6px; color: var(--ap-muted); }
.ap-runs-head { flex-wrap: wrap; align-items: center; column-gap: 4px; }
.ap-runs-head h3 { margin-right: auto; }
.ap-csv { min-height: 44px; padding: 0 10px; font-size: 13px; }
.ap-csv .ic { width: 14px; height: 14px; }

/* ── laptop: a narrower rail ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root, .ap { --ap-rail-w: 380px; }
  .ap-catalog { padding: 24px 24px 40px; }
  .ap-cards { grid-template-columns: minmax(0, 1fr); }
}

/* ── phone: one column, no frame — the list, then the app you picked ──── */
@media (max-width: 860px) {
  :root, .ap { --ap-inset: 0px; }
  html, body { overflow-x: hidden; }
  body { background: var(--ap-frame); }
  .ap {
    display: block; height: auto; min-height: calc(100dvh - var(--bar-h, 52px));
    margin: 0; border-radius: 0; box-shadow: none; overflow-x: hidden; overflow-y: visible;
    max-width: 100vw;
  }
  .ap-error { margin: 16px 16px 0; }
  .ap-boot { padding: 24px 16px; }
  .ap-gate, .ap-state { grid-template-columns: minmax(0, 1fr); gap: 28px; align-content: start; padding: 28px 16px calc(32px + env(safe-area-inset-bottom)); }
  .ap-display { font-size: 2.5rem; line-height: 1.06; }
  .ap-lede { font-size: 15px; }
  .ap-door-card { padding: 18px; border-radius: 20px; }
  .ap-ghost { max-width: none; }

  .ap-catalog, .ap-run { overflow: visible; min-height: 0; }
  .ap-catalog { padding: 20px 16px 32px; }
  .ap-catalog > * { max-width: none; }
  .ap-head h1 { font-size: 30px; }
  .ap-groups { margin-top: 22px; gap: 24px; }
  .ap-group-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .ap-group-head p { text-align: left; }
  .ap-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ap-card { min-height: 84px; padding: 14px; column-gap: 12px; border-radius: 18px; }
  .ap-card:hover { transform: none; box-shadow: 0 1px 2px rgba(20, 20, 30, .03); }

  /* one view at a time: the list, or the app */
  .ap-run { border-left: 0; background: var(--ap-frame); padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
  .ap-shell[data-view="list"] .ap-run { display: none; }
  .ap-shell[data-view="run"] .ap-catalog { display: none; }
  .ap-back { display: inline-flex; }
  .ap-run-head h2 { font-size: 22px; }
  .ap-form { padding: 14px; border-radius: 18px; background: var(--ap-side); box-shadow: none; border-color: var(--ap-hair); }
  .ap-fld input, .ap-fld textarea { background: var(--ap-card); }
  .ap-ask { background: var(--ap-card); }
  .ap-ask-text::after { background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--ap-card)); }
  .ap-reply { background: var(--ap-side); border-color: var(--ap-hair); }
  .ap-file { background: var(--ap-card); }
  .ap-file .btn-outline { grid-column: 1 / -1; justify-self: stretch; }
  .ap-reply-actions .btn-outline { flex: 1 1 auto; }
  .ap-hand { background: var(--ap-card); }
  .ap-link-url { background: var(--ap-side); }
  .ap-link-actions .btn-outline { flex: 1 1 auto; }
  .ap-qr { margin: 0 auto; }
}

/* ── motion: 120–180ms, and none of it under reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .ap *, .ap *::before, .ap *::after { transition: none !important; animation: none !important; }
  .ap-card:hover, .btn-solid:active, .btn-outline:active { transform: none; }
  .ap-wait i { opacity: .6; }
}
@media (forced-colors: active) {
  .ap-card[aria-current="true"], .patch > *, .ap-slot, .ap-said, .ap-run-ic { border: 1px solid CanvasText; forced-color-adjust: none; }
}

/* ══ One rhythm (apps15) ═══════════════════════════════════════════════════
   Phrases keep their last word; "Show all" ends on the same edge as the
   blanks above it. */
.ap { text-wrap: pretty; }
.ap-card-title { text-wrap: balance; }
.ap-ask-toggle { margin-right: -12px; }

/* ══ One band, one pen (apps16) ════════════════════════════════════════════
   The arrow on a card floated between the title and the blurb; it sits on
   the top band with the tile and the title, centred on the tile. The kind
   glyph joins the 16px line family. Headings keep their last word. */
.ap h1, .ap h2, .ap h3 { text-wrap: balance; }
.ap-card-go { grid-row: 1; align-self: start; margin-top: 6px; }
.ap-card-kind .ic { width: 16px; height: 16px; }

/* ══ One row, one left edge (apps17) ═══════════════════════════════════════
   A control row is one group on the left with one 8px gap; nothing is pushed
   to the far side. "What gets sent" and its Show all sit together; a live
   reply's word, clock and Stop sit together; a group's title and its count,
   and Runs and its Desk link, sit together. The full-width Run and Sign in
   buttons centre word + arrow instead of spreading them across the pill. */
.ap-door-card .btn-solid, .ap-form-foot .btn-solid { justify-content: center; }
.ap-form-foot .btn-solid.is-running { justify-content: flex-start; }
.ap-ask-head { justify-content: flex-start; }
.ap-ask-toggle { margin: -8px 0 -8px -4px; }
.ap-reply-top { justify-content: flex-start; gap: 8px; }
.ap-group-head, .ap-runs-head { justify-content: flex-start; gap: 12px; }

/* Recovery is informational until the host reports a terminal outcome. */
.ap-recovery { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--ap-field-edge); border-radius: 12px; background: var(--ap-field); color: var(--ap-ink-2); }
.ap-recovery p { margin: 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.ap-recovery .ap-reply-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.ap-recovery button, .ap-recovery a { min-height: 44px; }
.ap-reply-state:focus-visible { outline: 2px solid var(--ap-ink); outline-offset: 4px; border-radius: 4px; }
/* Optional originals stay adjacent to the request preview. */
.ap-file-context { display: grid; gap: 10px; min-width: 0; }
.ap-file-context h3 { margin: 0; font-size: 14px; font-weight: 700; }
.ap-file-context > button { justify-self: start; min-height: 44px; }
#apAttachments { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.ap-attachment { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-width: 0; border-bottom: 1px solid var(--ap-field-edge); padding-block: 4px; }
.ap-attachment > span { overflow-wrap: anywhere; font-size: 14px; }
.ap-attachment small { color: var(--ap-muted); font-size: 12px; white-space: nowrap; }
.ap-attachment button { min-height: 44px; min-width: 44px; }
.ap-file-context p { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .ap-attachment { grid-template-columns: minmax(0, 1fr) auto; } .ap-attachment small { grid-column: 1; grid-row: 2; } .ap-attachment button { grid-column: 2; grid-row: 1 / 3; } }
