/* AiB Platform — actions: buttons, text links, the toolbar row and the
   row-level controls (search pill, tool buttons, kebab). Loaded by every
   surface after tokens.css and base.css. */

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--dur-base), transform var(--dur-base);
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: translateY(1px); }
.btn--ghost {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
}
.btn--ghost:hover { opacity: 1; border-color: var(--ink); }
.btn--danger { background: none; border: 0; color: var(--danger); padding-inline: 6px; }
.btn--danger:hover { opacity: 0.7; }
/* full-width form button (auth screens) */
.btn--block { width: 100%; }
/* compact row button (inline ✕ removers) */
.btn--sm { padding-block: 4px; }

/* Disabled: dimmed and inert-looking, hover and press do nothing. A busy
   button is usually disabled too (the runtime sets both) — it keeps full
   ink so the spinner reads as work, not as a dead control. */
.btn:is(:disabled, [aria-disabled="true"]) { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn--ghost:is(:disabled, [aria-disabled="true"]):hover { border-color: var(--hairline-strong); }
/* Busy: an inline spinner ahead of the label — the label stays, the width
   barely moves, and nothing pretends to know how far along it is. */
.btn[aria-busy="true"],
.btn[aria-busy="true"]:hover { opacity: 1; cursor: progress; transform: none; }
.btn[aria-busy="true"]::before {
  content: '';
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 1.1em;
  height: 1.1em;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin var(--dur-spin) linear infinite;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--grey);
  transition: color var(--dur-base);
}
.text-link:hover { color: var(--ink); }
/* a text link flowing inside prose or a row, not as a flex block */
.text-link--inline { display: inline; }
button.text-link { background: none; border: 0; padding: 0; cursor: pointer; }
.arw { display: inline-block; transition: transform var(--dur-slow) var(--ease-out); }
a:hover > .arw, .text-link:hover .arw { transform: translateX(4px); }

/* ---------- toolbar (search / filter / sort) ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: min(300px, 100%);
  padding: 9px 14px;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  color: var(--grey-dark);
}
.search input {
  flex: 1;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13.5px;
}
.search input:focus { outline: none; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--grey);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.tool-btn:hover { color: var(--ink); background: var(--ink-wash); }

/* row-actions kebab — tables, member rows and sender rows all share it */
.kebab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--grey);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.kebab:hover { color: var(--ink); background: var(--paper); }

/* ---------- copy button ---------- */
/* A small ghost pill beside the value it copies. The runtime wires
   [data-copy] / [data-copy-target], toggles .is-copied and announces the
   copy through the toast region; the label swap is CSS (two spans). */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--dur-fast);
}
.copy-btn:hover { border-color: var(--ink); }
.copy-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.copy-btn:disabled:hover { border-color: var(--hairline-strong); }
.copy-btn-done { display: none; }
.copy-btn.is-copied { border-color: var(--ink); }
.copy-btn.is-copied::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.copy-btn.is-copied .copy-btn-idle { display: none; }
.copy-btn.is-copied .copy-btn-done { display: inline; }

/* ---------- touch: grow small controls toward the 44px thumb target,
   and keep the search field at 16px so iOS never auto-zooms on focus ---------- */
@media (pointer: coarse) {
  .kebab { width: 40px; height: 40px; }
  .tool-btn { min-height: 44px; }
  .copy-btn { min-height: 40px; }
  .search input { font-size: 16px; }
}
