/**
 * Automated Worx — Workforce command center.
 *
 * An operations surface, not an admin template: dense, calm, and legible at a glance.
 * The palette is the AW brand — deep navy ground, cyan for live/primary, violet for
 * compute, amber for "needs you", red only for genuine failure.
 */

:root {
  --aw-bg:        #05070f;
  --aw-bg-2:      #0a0f1e;
  --aw-panel:     #0d1424;
  --aw-panel-2:   #111a2e;
  --aw-line:      rgba(14, 242, 255, 0.14);
  --aw-line-soft: rgba(148, 163, 184, 0.12);
  --aw-cyan:      #0EF2FF;
  --aw-blue:      #3b82f6;
  --aw-violet:    #8b5cf6;
  --aw-amber:     #f59e0b;
  --aw-green:     #22c55e;
  --aw-red:       #ef4444;
  --aw-text:      #e8edf7;
  --aw-muted:     #94a3b8;
  --aw-dim:       #64748b;
  --aw-radius:    14px;
}

* { box-sizing: border-box; }

body.aw-wf {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(14, 242, 255, 0.09), transparent 60%),
    radial-gradient(900px 520px at 92% 4%, rgba(139, 92, 246, 0.09), transparent 60%),
    var(--aw-bg);
  color: var(--aw-text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.aw-shell { max-width: 1440px; margin: 0 auto; padding: 92px 28px 80px; }

/* ── Page header ─────────────────────────────────────────────────────────── */
.aw-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.aw-eyebrow { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--aw-cyan); font-weight: 700; margin: 0 0 8px; }
.aw-title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; margin: 0; letter-spacing: -.02em; }
.aw-sub { color: var(--aw-muted); margin: 8px 0 0; font-size: .95rem; }
.aw-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.aw-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--aw-line);
  background: rgba(255, 255, 255, .03); color: var(--aw-text);
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
  text-decoration: none;
}
.aw-btn:hover:not(:disabled) { border-color: var(--aw-cyan); background: rgba(14, 242, 255, .07); transform: translateY(-1px); }
.aw-btn:disabled { opacity: .45; cursor: not-allowed; }
.aw-btn.primary {
  background: linear-gradient(135deg, var(--aw-cyan), #00b8d4);
  color: #04121a; border-color: transparent;
  box-shadow: 0 6px 22px rgba(14, 242, 255, .26);
}
.aw-btn.primary:hover:not(:disabled) { box-shadow: 0 10px 30px rgba(14, 242, 255, .38); }
.aw-btn.ghost { background: transparent; }
.aw-btn.danger { border-color: rgba(239, 68, 68, .45); color: #fca5a5; }
.aw-btn.danger:hover:not(:disabled) { background: rgba(239, 68, 68, .12); border-color: var(--aw-red); }
.aw-btn.sm { padding: 6px 12px; font-size: .8rem; }

/* ── KPI strip ───────────────────────────────────────────────────────────── */
.aw-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; margin-bottom: 30px; }
.aw-kpi {
  background: linear-gradient(160deg, var(--aw-panel-2), var(--aw-panel));
  border: 1px solid var(--aw-line-soft); border-radius: var(--aw-radius);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.aw-kpi::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--aw-cyan), transparent); opacity: .5; }
.aw-kpi .k-label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--aw-dim); font-weight: 700; }
.aw-kpi .k-value { font-size: 1.85rem; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.aw-kpi.attention .k-value { color: var(--aw-amber); }
.aw-kpi.attention::after { background: linear-gradient(90deg, var(--aw-amber), transparent); }
.aw-kpi.live .k-value { color: var(--aw-cyan); }

/* ── Employee grid ───────────────────────────────────────────────────────── */
.aw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }

.aw-card {
  background: linear-gradient(160deg, var(--aw-panel-2), var(--aw-panel));
  border: 1px solid var(--aw-line-soft); border-radius: var(--aw-radius);
  padding: 20px; cursor: pointer; position: relative;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  display: flex; flex-direction: column; gap: 14px;
}
.aw-card:hover { border-color: var(--aw-line); transform: translateY(-3px); box-shadow: 0 14px 38px rgba(0, 0, 0, .45); }
.aw-card:focus-visible { outline: 2px solid var(--aw-cyan); outline-offset: 2px; }

.aw-card-top { display: flex; align-items: center; gap: 13px; }
.aw-avatar {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 46px;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem;
  background: linear-gradient(135deg, rgba(14, 242, 255, .18), rgba(139, 92, 246, .18));
  border: 1px solid var(--aw-line); color: var(--aw-cyan);
}
.aw-card-id { min-width: 0; }
.aw-card-name { font-weight: 650; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-card-role { color: var(--aw-muted); font-size: .82rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.aw-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.aw-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.aw-pill.working { color: var(--aw-cyan); background: rgba(14, 242, 255, .12); }
.aw-pill.working::before { animation: awPulse 1.4s ease-in-out infinite; }
.aw-pill.idle    { color: var(--aw-muted); background: rgba(148, 163, 184, .12); }
.aw-pill.paused  { color: var(--aw-amber); background: rgba(245, 158, 11, .12); }
.aw-pill.draft   { color: var(--aw-violet); background: rgba(139, 92, 246, .14); }
.aw-pill.error   { color: var(--aw-red); background: rgba(239, 68, 68, .12); }
@keyframes awPulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.aw-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: .74rem; color: var(--aw-dim); }
.aw-chip { padding: 3px 9px; border-radius: 7px; background: rgba(255, 255, 255, .04); border: 1px solid var(--aw-line-soft); }

.aw-activity {
  font-size: .84rem; color: var(--aw-muted); line-height: 1.5;
  border-left: 2px solid var(--aw-line); padding-left: 11px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.5em;
}

.aw-bar { height: 4px; border-radius: 3px; background: rgba(148, 163, 184, .16); overflow: hidden; }
.aw-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--aw-cyan), var(--aw-blue)); border-radius: 3px; }
.aw-bar.warn > i { background: linear-gradient(90deg, var(--aw-amber), #f97316); }
.aw-bar.over > i { background: linear-gradient(90deg, var(--aw-red), #dc2626); }
.aw-bar-row { display: flex; justify-content: space-between; font-size: .72rem; color: var(--aw-dim); margin-bottom: 5px; }

/* ── Panels & tables ─────────────────────────────────────────────────────── */
.aw-panel {
  background: linear-gradient(160deg, var(--aw-panel-2), var(--aw-panel));
  border: 1px solid var(--aw-line-soft); border-radius: var(--aw-radius);
  padding: 22px; margin-bottom: 20px;
}
.aw-panel h2 { font-size: 1.05rem; margin: 0 0 4px; font-weight: 650; }
.aw-panel .p-sub { color: var(--aw-dim); font-size: .82rem; margin: 0 0 16px; }
.aw-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }

.aw-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.aw-table th {
  text-align: left; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--aw-dim); font-weight: 700; padding: 0 12px 10px; border-bottom: 1px solid var(--aw-line-soft);
}
.aw-table td { padding: 12px; border-bottom: 1px solid rgba(148, 163, 184, .07); vertical-align: top; }
.aw-table tr:last-child td { border-bottom: none; }
.aw-table tr:hover td { background: rgba(255, 255, 255, .02); }
.aw-scroll { overflow-x: auto; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.aw-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--aw-line-soft); margin-bottom: 22px; overflow-x: auto; }
.aw-tab {
  padding: 11px 16px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--aw-muted); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.aw-tab:hover { color: var(--aw-text); }
.aw-tab.active { color: var(--aw-cyan); border-bottom-color: var(--aw-cyan); }
.aw-tab .count { font-size: .72rem; opacity: .7; margin-left: 5px; }

/* ── Timeline ────────────────────────────────────────────────────────────── */
.aw-timeline { position: relative; padding-left: 26px; }
.aw-timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--aw-line-soft); }
.aw-step { position: relative; padding: 9px 0; }
.aw-step::before {
  content: ''; position: absolute; left: -23px; top: 15px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--aw-panel); border: 2px solid var(--aw-dim);
}
.aw-step[data-t="wake"]::before     { border-color: var(--aw-cyan); }
.aw-step[data-t="tool"]::before     { border-color: var(--aw-violet); }
.aw-step[data-t="think"]::before    { border-color: var(--aw-blue); }
.aw-step[data-t="approval"]::before { border-color: var(--aw-amber); }
.aw-step[data-t="error"]::before    { border-color: var(--aw-red); }
.aw-step .s-label { font-weight: 600; font-size: .88rem; }
.aw-step .s-detail { color: var(--aw-muted); font-size: .82rem; margin-top: 3px; word-break: break-word; line-height: 1.5; }
.aw-step .s-meta { color: var(--aw-dim); font-size: .72rem; margin-top: 3px; }

/* ── Chat ────────────────────────────────────────────────────────────────── */
.aw-chat {
  max-height: 460px; overflow-y: auto; padding: 4px 2px 8px;
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px;
}
.aw-msg { max-width: 84%; }
.aw-msg .m-body {
  padding: 11px 15px; border-radius: 14px; font-size: .9rem; line-height: 1.55;
  border: 1px solid var(--aw-line-soft); background: rgba(255, 255, 255, .04);
  overflow-wrap: anywhere;
}
.aw-msg .m-meta { font-size: .7rem; color: var(--aw-dim); margin-top: 5px; padding: 0 4px; }
.aw-msg.me { align-self: flex-end; }
.aw-msg.me .m-body {
  background: linear-gradient(135deg, rgba(14, 242, 255, .16), rgba(59, 130, 246, .14));
  border-color: var(--aw-line); border-bottom-right-radius: 5px;
}
.aw-msg.me .m-meta { text-align: right; }
.aw-msg.them .m-body { border-bottom-left-radius: 5px; }

.aw-typing { display: inline-flex; gap: 4px; align-items: center; height: 1.2em; }
.aw-typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--aw-cyan);
  animation: awType 1.2s ease-in-out infinite;
}
.aw-typing i:nth-child(2) { animation-delay: .18s; }
.aw-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes awType { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.aw-chat-input { border-top: 1px solid var(--aw-line-soft); padding-top: 16px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.aw-field { margin-bottom: 16px; }
.aw-field label { display: block; font-size: .78rem; font-weight: 600; color: var(--aw-muted); margin-bottom: 7px; }
.aw-field .hint { font-size: .74rem; color: var(--aw-dim); margin-top: 6px; line-height: 1.5; }
.aw-input, .aw-select, .aw-textarea {
  width: 100%; padding: 11px 13px; border-radius: 9px;
  border: 1px solid var(--aw-line-soft); background: rgba(5, 7, 15, .6);
  color: var(--aw-text); font: inherit; font-size: .9rem;
}
.aw-input:focus, .aw-select:focus, .aw-textarea:focus {
  outline: none; border-color: var(--aw-cyan); box-shadow: 0 0 0 3px rgba(14, 242, 255, .1);
}
.aw-textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.aw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.aw-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--aw-line-soft); cursor: pointer; }
.aw-check:hover { border-color: var(--aw-line); }
.aw-check input { margin-top: 3px; accent-color: var(--aw-cyan); }
.aw-check .c-name { font-size: .85rem; font-weight: 600; }
.aw-check .c-desc { font-size: .74rem; color: var(--aw-dim); margin-top: 2px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.aw-modal { position: fixed; inset: 0; background: rgba(3, 5, 12, .8); backdrop-filter: blur(6px); z-index: 900; display: none; overflow-y: auto; padding: 40px 20px; }
.aw-modal.open { display: block; }
.aw-modal-box {
  max-width: 660px; margin: 0 auto;
  background: linear-gradient(160deg, var(--aw-panel-2), var(--aw-panel));
  border: 1px solid var(--aw-line); border-radius: 18px; padding: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.aw-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.aw-modal-head h3 { margin: 0; font-size: 1.2rem; }
.aw-x { background: none; border: none; color: var(--aw-dim); font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0 4px; }
.aw-x:hover { color: var(--aw-text); }
.aw-steps { display: flex; gap: 6px; margin: 18px 0 22px; }
.aw-steps i { flex: 1; height: 3px; border-radius: 2px; background: rgba(148, 163, 184, .18); }
.aw-steps i.done { background: var(--aw-cyan); }
.aw-modal-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

/* ── States ──────────────────────────────────────────────────────────────── */
.aw-empty { text-align: center; padding: 54px 20px; color: var(--aw-muted); }
.aw-empty .e-icon { font-size: 2.4rem; opacity: .5; margin-bottom: 12px; }
.aw-empty h3 { color: var(--aw-text); margin: 0 0 8px; font-size: 1.05rem; }
.aw-empty p { margin: 0 auto 20px; max-width: 420px; font-size: .88rem; line-height: 1.6; }

.aw-error {
  border: 1px solid rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .08);
  color: #fca5a5; padding: 14px 16px; border-radius: 10px; font-size: .87rem; margin-bottom: 18px;
}

.aw-skel { background: linear-gradient(90deg, rgba(148,163,184,.07), rgba(148,163,184,.16), rgba(148,163,184,.07)); background-size: 200% 100%; animation: awShimmer 1.3s infinite; border-radius: 8px; }
@keyframes awShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.aw-skel-card { height: 168px; border-radius: var(--aw-radius); }

.aw-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(24px);
  background: var(--aw-panel-2); border: 1px solid var(--aw-line); color: var(--aw-text);
  padding: 13px 22px; border-radius: 11px; font-size: .88rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 1200;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5); max-width: min(560px, calc(100vw - 40px));
}
.aw-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.aw-toast.err { border-color: rgba(239, 68, 68, .5); color: #fca5a5; }

.aw-note { font-size: .8rem; color: var(--aw-dim); line-height: 1.6; }
.aw-mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .82rem; }
.aw-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .72rem; font-weight: 600; background: rgba(255,255,255,.05); border: 1px solid var(--aw-line-soft); }
.aw-tag.ok    { color: var(--aw-green); border-color: rgba(34,197,94,.3); }
.aw-tag.warn  { color: var(--aw-amber); border-color: rgba(245,158,11,.3); }
.aw-tag.bad   { color: var(--aw-red);   border-color: rgba(239,68,68,.3); }
.aw-tag.info  { color: var(--aw-cyan);  border-color: var(--aw-line); }

@media (max-width: 720px) {
  .aw-shell { padding: 80px max(16px, env(safe-area-inset-right)) calc(60px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .aw-row { grid-template-columns: 1fr; }
  .aw-grid { grid-template-columns: 1fr; }
  .aw-head { flex-direction: column; align-items: stretch; }
}

/* ── Delegate (js/delegate.js) ───────────────────────────────────────────── */
.aw-delegate {
  background: linear-gradient(160deg, var(--aw-panel-2), var(--aw-panel));
  border: 1px solid var(--aw-line); border-radius: var(--aw-radius);
  padding: 22px; margin-bottom: 20px;
  box-shadow: 0 0 0 1px rgba(19, 232, 255, .04), 0 18px 40px -24px rgba(19, 232, 255, .25);
}
.aw-delegate h2 { font-size: 1.1rem; margin: 0 0 4px; font-weight: 650; }
.aw-delegate .p-sub { color: var(--aw-dim); font-size: .84rem; margin: 0 0 14px; }
.dg-form { display: grid; gap: 10px; }
.dg-who { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--aw-muted); }
.dg-who .aw-select { flex: 1; max-width: 420px; }
.dg-text { min-height: 84px; font-size: .95rem; }
.dg-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dg-chip { cursor: pointer; font: inherit; font-size: .76rem; background: rgba(19, 232, 255, .05); color: var(--aw-muted); border: 1px solid var(--aw-line-soft); }
.dg-chip:hover, .dg-chip:focus-visible { color: var(--aw-text); border-color: var(--aw-cyan); outline: none; }
.dg-live { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--aw-line-soft); }
.dg-live-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .9rem; }
.aw-avatar.sm { width: 28px; height: 28px; font-size: .72rem; }
.dg-working { display: flex; align-items: center; gap: 8px; margin: 6px 0 0 26px; }
.dg-result { margin-top: 10px; padding: 14px 16px; border-radius: 10px; background: rgba(255, 255, 255, .025); border: 1px solid var(--aw-line-soft); }
.dg-result p { margin: 8px 0 0; line-height: 1.55; font-size: .9rem; }
.dg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.dg-approvals { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dg-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dg-attach { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; overflow: hidden; }
.dg-attach input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.dg-attach:focus-within { outline: 2px solid var(--aw-cyan); outline-offset: 2px; }
.dg-files { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-file-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 40px; padding: 6px 6px 6px 12px;
  border-radius: 10px; border: 1px solid var(--aw-line-soft); background: rgba(19, 232, 255, .05); overflow: hidden; font-size: .82rem; }
.dg-file-chip[data-state=err] { border-color: rgba(255, 99, 99, .45); background: rgba(255, 99, 99, .06); }
.dg-file-name { color: var(--aw-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.dg-file-meta { color: var(--aw-dim); white-space: nowrap; font-size: .76rem; }
.dg-file-chip[data-state=err] { flex-wrap: wrap; }
.dg-file-chip[data-state=err] .dg-file-meta { color: #ff9b9b; white-space: normal; order: 3; flex: 1 0 100%; padding: 0 0 4px; }
.dg-file-chip[data-state=err] .dg-file-name { flex: 1 1 auto; }
.dg-file-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--aw-cyan); transition: width .2s; }
.dg-file-x { flex-shrink: 0; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--aw-muted); font-size: 1.15rem; line-height: 1; cursor: pointer; }
.dg-file-x:hover, .dg-file-x:focus-visible { color: var(--aw-text); background: rgba(255, 255, 255, .06); outline: none; }
.hire-ai { display: grid; gap: 8px; padding: 14px; margin-bottom: 16px; border-radius: 10px; border: 1px dashed var(--aw-line); background: rgba(19, 232, 255, .03); }
.hire-ai .row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
@media (max-width: 720px) {
  .dg-row { flex-direction: column-reverse; align-items: stretch; }
  .dg-row .aw-btn { width: 100%; justify-content: center; text-align: center; }
  .dg-acts { width: 100%; }
  .dg-acts .dg-attach { width: auto; flex: 0 0 auto; padding-left: 14px; padding-right: 14px; }
  .dg-acts .dg-go { flex: 1 1 auto; }
  .dg-file-chip { width: 100%; }
  .dg-file-name { max-width: none; flex: 1 1 auto; }
  .dg-who { flex-direction: column; align-items: stretch; }
  .dg-who .aw-select { max-width: none; }
}

/* template/capability rows: name above its description (they ran together) */
.aw-check .c-name { display: block; }
.aw-check .c-desc { display: block; margin-top: 2px; }

/* ── Phones & small tablets: comfortable tap targets, no iOS input zoom, readable type ── */
@media (max-width: 768px) {
  .aw-input, .aw-select, .aw-textarea { font-size: 16px; min-height: 44px; }
  .aw-textarea { min-height: 92px; }
  .aw-btn { min-height: 44px; justify-content: center; }
  .aw-btn.sm { min-height: 40px; }
  .aw-head-actions .aw-btn { flex: 1 1 auto; }
  button.aw-chip, .dg-chip, .tr-chip, .ic-chip { min-height: 40px; display: inline-flex; align-items: center; }
  .aw-eyebrow, .aw-kpi .k-label, .aw-pill, .aw-tag, .aw-table th { font-size: .75rem; }
  .aw-chip { font-size: .78rem; }
  .aw-table td { overflow-wrap: break-word; }   /* "anywhere" broke words between letters on phones (2026-10-04) */
  .aw-scroll { -webkit-overflow-scrolling: touch; }
  .aw-note a, a.aw-note { display: inline-block; padding: 10px 0; }
  .aw-bar-row span, body .c-desc, body .hint { font-size: .8rem; }
}

.aw-kpi-link, a.aw-stat { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.aw-kpi-link:hover, a.aw-stat:hover { border-color: rgba(14,242,255,.5); transform: translateY(-1px); }
.aw-kpi-link:focus-visible, a.aw-stat:focus-visible { outline: 2px solid #0ef2ff; outline-offset: 2px; }

/* ── Phones & small tablets, pass 2: 44px tap targets for the filter pills, tabs and small buttons used on many pages ──
   `body` in front so these beat each page's own inline <style> (which loads after this file). */
@media (max-width: 768px) {
  body .aw-tab, body .ld-tab, body .em-filters button, body .mm-tabs button,
  body button.aw-chip, body .dg-chip, body .tr-chip, body .ic-chip { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  body .aw-btn.sm { min-height: 44px; }
  body .lf-talk { min-width: 44px; min-height: 44px; }
  body .aw-note a, body a.aw-note { min-height: 44px; display: inline-flex; align-items: center; padding: 0; }
  body .rp-bar a.back { min-height: 44px; display: inline-flex; align-items: center; }
  body .aw-tabs { gap: 4px; }
  /* A grid column of "1fr" can never shrink below its widest child; every page grid may shrink and its text wraps */
  .aw-grid > *, .aw-row > * { min-width: 0; }
  .aw-shell pre, .aw-shell code { max-width: 100%; }
  .aw-shell pre { overflow-x: auto; }
}

/* ── Phones: every .aw-table row becomes a card (Dexter 2026-10-04: "mobile view looks terrible").
   Wide tables squeezed the title column to a few letters per line. On a phone the first cell (the title) takes the
   full width and the rest (status, cost, source, attempts, actions) flow beneath it in one wrapping line.
   `body` in front so it beats each page's own inline <style>. */
@media (max-width: 640px) {
  body .aw-table thead { display: none; }
  body .aw-table, body .aw-table tbody { display: block; width: 100%; }
  body .aw-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
                      padding: 12px 2px; border-bottom: 1px solid rgba(148, 163, 184, .1); }
  body .aw-table tr:last-child { border-bottom: none; }
  body .aw-table td { display: block; padding: 0; border: 0; overflow-wrap: break-word; word-break: normal; min-width: 0; }
  body .aw-table td:first-child { flex: 1 1 100%; }
  body .aw-table td:empty { display: none; }
  body .aw-table tr:hover td { background: none; }
  body .aw-scroll { overflow-x: visible; }
}
