/* Compliance sweep. Colors and type come from theme.css. Geometry is local. */
:root { --ease: cubic-bezier(.2,.7,.2,1); }

.btn-dark-primary, .btn-dark-secondary { border-radius: 8px; padding: 6px 12px; font-size: 14px; font-weight: 500; cursor: pointer; }
.btn-dark-primary { background: var(--accent); color: var(--accent-text); }
.btn-dark-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }

.btn-light, .btn-dark { border-radius: 8px; padding: 6px 12px; font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid var(--color-button-secondary-border); background: var(--color-bg-white); color: var(--color-button-secondary-text); }
.btn-light:hover { background: var(--color-gray-0-5); }
.btn-dark { background: var(--color-cta); color: var(--color-bg-white); border-color: transparent; }
.btn-dark:hover { background: var(--color-carbon-black-4); }
.btn-light.wide, .btn-dark.wide { width: 100%; }
.icon-btn { width: 24px; height: 24px; border-radius: 6px; color: var(--color-text-muted); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--color-gray-0-5); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 9999px; font-size: 12px; line-height: 12px; font-weight: 500; white-space: nowrap; }
.chip-sm { height: 20px; padding: 0 6px; gap: 4px; font-size: 10px; line-height: 10px; }
.chip-light { background: var(--color-gray-0-5); color: var(--color-text-muted); }
.chip-info { background: var(--color-blue-0-5); color: var(--color-blue-8); }
.chip-success { background: var(--color-green-0-5); color: var(--color-green-8); }
.chip-warning { background: var(--color-orange-0-5); color: var(--color-orange-8); }

.row { display: grid; grid-template-columns: 1.8fr 1.2fr 1fr 1.2fr .7fr 150px; align-items: center; padding: 0 24px; height: 48px; border-top: 1px solid var(--color-border-divider); font-size: 14px; }
.row-head { height: 36px; background: var(--color-bg-light); }
.row > span { min-width: 0; padding-right: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row > span.who { overflow: visible; }
.row .who { display: flex; align-items: center; gap: 8px; overflow: visible; }
.row .who > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.slot { flex: none; }
.slot .chip { animation: chipIn .45s var(--ease) both; }
@keyframes chipIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.row .actions { display: flex; justify-content: flex-end; gap: 8px; padding-right: 0; overflow: visible; }
.row .actions .btn-light { height: 28px; padding: 2px 10px; }
.more { width: 32px; height: 32px; border: 1px solid var(--color-button-secondary-border); border-radius: 8px; background: var(--color-bg-white); color: var(--color-text-muted); cursor: pointer; display: grid; place-items: center; }
.more:hover, .more.open { background: var(--color-gray-0-5); }
.avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar.lg { width: 32px; height: 32px; }

.ico-svg { display: inline-flex; width: 16px; height: 16px; flex: none; }
.ico-svg svg { width: 100%; height: 100%; }
.menu .item .lead { display: inline-flex; align-items: center; gap: 8px; }

.menu { position: absolute; z-index: 30; min-width: 220px; padding: 4px; border-radius: 12px; background: var(--color-bg-white); border: 1px solid var(--color-border-divider); box-shadow: var(--shadow-xs); color: var(--color-text-primary); opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none; transition: opacity .15s, transform .15s var(--ease); font-size: 14px; }
.menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.menu .item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--color-text-primary); font: inherit; text-align: left; cursor: pointer; }
.menu .item:hover, .menu .item.hover { background: var(--color-nav-item-hover); }

.scrim { position: absolute; inset: 0; z-index: 40; background: color-mix(in srgb, var(--color-carbon-black-6) 25%, transparent); opacity: 0; pointer-events: none; transition: opacity .25s; }
.panel { position: absolute; z-index: 50; right: 16px; bottom: 16px; width: min(576px, calc(100% - 32px)); overflow: hidden; border-radius: 12px; background: var(--color-bg-white); color: var(--color-text-primary); box-shadow: var(--shadow-default); transform: translateY(calc(100% + 32px)); transition: transform .3s var(--ease); }
.panel-inner { display: flex; flex-direction: column; }
.float-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--color-border-divider); }
#stage[data-state="sweeping"] .scrim,
#stage[data-state="exceptions"] .scrim,
#stage[data-state="draft"] .scrim,
#stage[data-state="question"] .scrim { opacity: 1; pointer-events: auto; }
#stage[data-state="sweeping"] .panel,
#stage[data-state="exceptions"] .panel,
#stage[data-state="draft"] .panel,
#stage[data-state="question"] .panel { transform: none; }
#intro, #steps, #sources, #stage[data-state="question"] .float-footer { display: none; }
#stage[data-state="sweeping"] #intro,
#stage[data-state="exceptions"] #intro { display: block; }
#stage[data-state="sweeping"] #steps,
#stage[data-state="exceptions"] #steps,
#stage[data-state="sweeping"] #sources { display: flex; }
.flip { display: inline-flex; transform: scaleX(-1); }

.step { display: none; gap: 8px; }
.step.show { display: flex; animation: rise .35s var(--ease); }
.step .ico { width: 16px; height: 16px; margin-top: 2px; display: flex; align-items: center; justify-content: center; flex: none; }
.step[data-status="pending"] .ico, .step[data-status="pending"] .label { color: var(--color-text-muted); }
.step[data-status="done"] .ico { color: var(--color-green-6); }
.step .label { font-size: 14px; line-height: 20px; }
.step .detail { font-size: 12px; line-height: 18px; color: var(--color-text-muted); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.person { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--color-border-divider); border-radius: 12px; }
.person .copy { min-width: 0; flex: 1; }
.person strong { display: block; font-size: 14px; line-height: 20px; font-weight: 500; }
.person p { font-size: 12px; line-height: 18px; color: var(--color-text-muted); }

.msg { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--color-border-divider); border-radius: 12px; }
.msg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.msg .label { font-size: 12px; line-height: 18px; font-weight: 500; color: var(--color-text-muted); }
.msg .meta { font-size: 12px; line-height: 18px; color: var(--color-text-muted); }
.msg p { font-size: 14px; line-height: 20px; }
#msgInput { width: 100%; min-height: 72px; border: 1px solid var(--color-field-border-focus); border-radius: 8px; padding: 8px; font-size: 14px; line-height: 20px; outline: none; }

.ascii { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; line-height: 1; width: 16px; text-align: center; color: var(--color-text-primary); }
.ascii.mute { color: var(--color-text-muted); }
.step[data-status="running"] .label, .step[data-status="running"] .detail {
  color: transparent; -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(100deg, var(--color-gray-8) 35%, var(--color-gray-3) 50%, var(--color-gray-8) 65%);
  background-size: 250% 100%; background-position: 150% 0; animation: textShimmer 1.7s linear infinite;
}
@keyframes textShimmer { to { background-position: -50% 0; } }

.toast { box-shadow: var(--shadow-default); position: absolute; z-index: 60; left: 24px; bottom: 24px; display: flex; align-items: center; gap: 16px; padding: 8px 16px; border-radius: 12px; background: var(--color-bg-black); color: var(--color-gray-0-5); font-size: 14px; transform: translateY(24px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); }
.toast.show { transform: none; opacity: 1; pointer-events: auto; }
#stage[data-state="done"] .toast { left: 50%; transform: translate(-50%, 24px); }
#stage[data-state="done"] .toast.show { transform: translate(-50%, 0); }
.toast button { font-weight: 500; color: var(--color-gray-0-5); cursor: pointer; }
.cursor { position: absolute; z-index: 90; width: 16px; height: 16px; border-radius: 50% 50% 50% 0; background: var(--color-text-primary); border: 2px solid var(--color-bg-white); transform: translate(-3px,-3px) rotate(-45deg); opacity: 0; transition: left .7s var(--ease), top .7s var(--ease), opacity .2s, scale .15s; pointer-events: none; }
.cursor.on { opacity: 1; }
.cursor.click { scale: .8; }

body.preview { margin: 0; }
body.preview main { padding: 0 !important; gap: 0 !important; }
body.preview header { display: none; }
body.preview .canvas, body.preview .window { width: 800px; margin: 0; }
body.preview #stage { width: 800px; height: 500px !important; }
body.preview .panel, body.preview .scrim, body.preview .step.show, body.preview .slot .chip { animation: none; transition: none; }
body.preview .step .detail { display: none; }

body.record main { padding: 0 !important; gap: 0 !important; }
body.record header { display: none; }
body.record #stage { height: 720px !important; }
body.record .window { width: 1280px; height: 720px; overflow: hidden; border-radius: 0; box-shadow: none; }
