:root{
  --canvas:#f3f1ec;
  --surface:#ffffff;
  --surface-2:#f8f7f3;
  --ink:#162019;
  --muted:#6d756f;
  --line:#e2e0da;
  --brand:#183d2f;
  --brand-2:#2f5b49;
  --accent:#c08b5a;
  --accent-soft:#f2e5d7;
  --sidebar:#10231b;
  --sidebar-2:#173126;
  --sidebar-text:#edf4ef;
  --sidebar-muted:#93a49b;
  --ok:#2f7652;
  --ok-soft:#e5f2ea;
  --danger:#9a3939;
  --danger-soft:#f7e6e3;
  --warning:#9b6a2f;
  --warning-soft:#f8eddd;
  --pucara:#e7c64a;
  --pucara-soft:#f7efc8;
  --pucara-ink:#63520a;
  --modulos:#e98232;
  --modulos-soft:#f8e0cf;
  --modulos-ink:#7a4218;
  --materiales:#4d87c7;
  --materiales-soft:#ddeaf7;
  --materiales-ink:#28557f;
  --shadow:0 14px 42px rgba(18,31,24,.08);
  --shadow-soft:0 8px 24px rgba(18,31,24,.05);
}
*{box-sizing:border-box}
html{background:var(--canvas)}
body{margin:0;background:var(--canvas);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input,textarea,select{font:inherit}
a{color:inherit}
.app-body{min-height:100vh}
.app-shell{display:grid;grid-template-columns:268px minmax(0,1fr);min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;padding:24px 18px 18px;background:linear-gradient(180deg,var(--sidebar),#0c1c16);color:var(--sidebar-text);display:flex;flex-direction:column;z-index:20}
.app-brand{display:flex;align-items:center;gap:12px;color:inherit;text-decoration:none;padding:4px 8px 26px}
.brand-mark{display:grid;place-items:center;width:46px;height:46px;border-radius:12px;background:#f3efe4;color:#10231b;font-size:15px;font-weight:900;letter-spacing:.04em}
.brand-copy{display:grid;line-height:1.05}
.brand-copy strong{font-size:18px;letter-spacing:-.02em}
.brand-copy small{margin-top:4px;color:var(--sidebar-muted);font-size:12px;letter-spacing:.08em;text-transform:uppercase}
.sidebar-group{margin-top:10px}
.sidebar-label{display:block;padding:0 10px 9px;color:#6f857a;font-size:10px;font-weight:850;letter-spacing:.15em}
.sidebar-nav{display:grid;gap:5px}
.nav-item{display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;align-items:center;min-height:58px;padding:9px 10px;border-radius:11px;text-decoration:none;color:#c9d5ce;transition:.18s ease}
.nav-item:hover{background:rgba(255,255,255,.055);color:#fff}
.nav-item.active{background:rgba(255,255,255,.095);color:#fff;box-shadow:inset 3px 0 0 var(--accent)}
.nav-item.disabled{opacity:.48;cursor:default}
.nav-glyph{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:rgba(255,255,255,.07);font-size:12px;font-weight:850}
.nav-item span:last-child{display:grid;min-width:0}
.nav-item strong{font-size:13px;font-weight:730;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-item small{margin-top:3px;color:#82958b;font-size:10px}
.sidebar-system{margin-top:auto;padding-top:20px}
.sidebar-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:14px;padding:14px 8px 0;border-top:1px solid rgba(255,255,255,.08)}
.environment-chip{display:flex;gap:7px;align-items:center;color:#a5b3ac;font-size:11px}
.environment-chip span{width:7px;height:7px;border-radius:50%;background:#58b47d;box-shadow:0 0 0 4px rgba(88,180,125,.1)}
.logout-button{border:0;background:none;color:#8fa097;cursor:pointer;font-weight:700;font-size:11px;padding:6px}
.logout-button:hover{color:#fff}

.workspace{min-width:0}
.workspace-bar{height:72px;padding:0 34px;border-bottom:1px solid var(--line);background:rgba(248,247,243,.9);backdrop-filter:blur(16px);display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:12}
.workspace-bar>div:first-child{display:grid}
.workspace-eyebrow{font-size:9px;font-weight:850;letter-spacing:.16em;color:#8a918c}
.workspace-bar strong{margin-top:3px;font-size:14px}
.workspace-meta{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:11px}
.meta-dot{width:7px;height:7px;border-radius:50%;background:var(--ok)}
.content-shell{max-width:1450px;margin:0 auto;padding:30px 34px 80px}
.mobile-menu{display:none}

.page-title-row{display:flex;justify-content:space-between;gap:28px;align-items:flex-start;margin:4px 0 24px}
.page-title-row.compact{align-items:center}
.page-title-row h1{margin:5px 0 8px;font-size:clamp(31px,4vw,45px);line-height:1.02;letter-spacing:-.035em}
.page-title-row p{max-width:760px;margin:0;color:var(--muted);font-size:15px;line-height:1.55}
.kicker{display:block;color:var(--brand-2);font-size:10px;font-weight:850;letter-spacing:.15em;text-transform:uppercase}
.kicker.light{color:#b9c7bf}
.back-link{display:inline-flex;margin-bottom:13px;color:var(--muted);font-size:12px;text-decoration:none;font-weight:720}
.back-link:hover{color:var(--ink)}

.primary-action,.secondary-action,.ghost-action,.secondary-link{display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:9px;text-decoration:none;cursor:pointer;font-weight:760;transition:.16s ease}
.primary-action{min-height:42px;padding:10px 16px;background:var(--brand);color:#fff;box-shadow:0 6px 16px rgba(24,61,47,.14)}
.primary-action:hover{background:#204b3a;transform:translateY(-1px)}
.primary-action:disabled{opacity:.42;cursor:not-allowed;transform:none}
.button-action{border:0}
.secondary-action,.secondary-link{min-height:40px;padding:9px 13px;background:#f6f5f1;border-color:#dcdad4;color:var(--ink)}
.secondary-action:hover,.secondary-link:hover{background:#efeee9}
.secondary-action.accent{background:var(--accent-soft);border-color:#e5c8a8;color:#714d29}
.secondary-action.full{width:100%}
.ghost-action{min-height:40px;padding:9px 13px;background:transparent;border-color:#d9d7d0;color:#56605a}
.button-reset{font:inherit}
.status-pill,.muted-badge,.preview-label,.candidate-badge,.activity-status{display:inline-flex;align-items:center;border-radius:999px;font-size:10px;font-weight:850;letter-spacing:.07em}
.status-pill{gap:7px;padding:7px 10px}
.status-pill i{width:6px;height:6px;border-radius:50%;background:currentColor}
.status-pill.success{color:var(--ok);background:var(--ok-soft)}
.status-pill.neutral{color:#5f6962;background:#ecece8}
.muted-badge{padding:6px 9px;background:#efefeb;color:#7a817c}
.preview-label{padding:6px 9px;background:#f0eee8;color:#777e79}

.feature-agent-card{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr);min-height:330px;border-radius:16px;overflow:hidden;background:linear-gradient(135deg,#173b2d,#10251c);box-shadow:var(--shadow);margin-bottom:18px}
.feature-agent-copy{padding:31px 34px;color:#fff;display:flex;flex-direction:column;align-items:flex-start}
.feature-topline{width:100%;display:flex;justify-content:space-between;align-items:center;margin-bottom:34px}
.feature-channel{font-size:11px;color:#a9b8b0}
.feature-agent-copy h2{margin:8px 0 10px;font-size:38px;letter-spacing:-.035em}
.feature-agent-copy p{max-width:620px;margin:0;color:#c7d2cc;line-height:1.55}
.capability-row{display:flex;gap:7px;margin-top:18px}
.capability-row span{padding:6px 9px;border:1px solid rgba(255,255,255,.12);border-radius:999px;color:#cbd8d1;font-size:10px;font-weight:750}
.feature-cta{display:inline-flex;gap:12px;align-items:center;margin-top:auto;padding-top:26px;color:#fff;text-decoration:none;font-weight:800}
.feature-cta span{color:var(--accent)}
.feature-agent-visual{min-height:330px;background:linear-gradient(135deg,#c78f58,#8a5f38);position:relative}
.feature-agent-visual:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(16,37,28,.35),transparent 45%)}
.feature-agent-visual img{width:100%;height:100%;object-fit:cover;display:block}
.visual-fallback{height:100%;min-height:330px;padding:36px;display:flex;flex-direction:column;justify-content:flex-end;color:#fff;background:radial-gradient(circle at 70% 25%,rgba(255,255,255,.16),transparent 35%),linear-gradient(145deg,#b47a47,#6f4930)}
.visual-fallback span{font-size:11px;letter-spacing:.18em}
.visual-fallback strong{font-size:42px;line-height:1}
.visual-fallback small{margin-top:9px;opacity:.8}

.stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0 18px}
.stat-card{padding:17px 19px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow-soft);display:grid}
.stat-card span{color:var(--muted);font-size:11px;font-weight:720}
.stat-card strong{margin:8px 0 2px;font-size:28px;line-height:1;letter-spacing:-.03em}
.stat-card small{color:#929994;font-size:10px}
.stat-card.danger strong{color:var(--danger)}
.dashboard-columns{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(340px,.55fr);gap:16px}
.section-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:21px;box-shadow:var(--shadow-soft)}
.section-header{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:17px}
.section-header h2{margin:4px 0 0;font-size:20px;letter-spacing:-.02em}
.section-header p{margin:5px 0 0;color:var(--muted);font-size:12px}
.section-header>a{color:var(--brand-2);font-size:11px;font-weight:780;text-decoration:none}
.activity-list{display:grid}
.activity-row{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:11px;align-items:center;padding:12px 0;border-top:1px solid #eceae5;text-decoration:none}
.activity-row:first-child{border-top:0}
.activity-icon,.unit-monogram{display:grid;place-items:center;border-radius:9px;background:#edf1ee;color:var(--brand);font-weight:850}
.activity-icon{width:36px;height:36px;font-size:12px}
.activity-copy{display:grid;min-width:0}
.activity-copy strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.activity-copy span{margin-top:3px;color:var(--muted);font-size:10px}
.activity-status{padding:6px 8px;background:#f1f1ed;color:#707772;white-space:nowrap}
.upcoming-list{display:grid;gap:8px}
.upcoming-row{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:10px;align-items:center;padding:13px 0;border-top:1px solid #eceae5}
.upcoming-row:first-child{border-top:0}
.unit-monogram{width:34px;height:34px;font-size:11px}
.upcoming-row>div{display:grid}
.upcoming-row strong{font-size:12px}
.upcoming-row small{margin-top:3px;color:var(--muted);font-size:9px}

.agent-command-card{display:grid;grid-template-columns:minmax(0,.88fr) minmax(500px,1.12fr);gap:16px;padding:18px 20px;border-radius:15px;background:linear-gradient(135deg,#173b2d,#10251c);color:#fff;margin-bottom:16px}
.command-copy h2{margin:10px 0 6px;font-size:22px}
.command-copy p{margin:0;color:#bdccc4;line-height:1.45;font-size:12px}
.command-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;align-items:stretch}
.command-action{min-height:84px;padding:12px 14px;border:1px solid rgba(255,255,255,.11);border-radius:10px;background:rgba(255,255,255,.055);color:#fff;text-decoration:none;display:flex;flex-direction:column;justify-content:center}
.command-action:hover{background:rgba(255,255,255,.09)}
.command-action.primary-command{background:#f1ede3;color:#172019}
.command-action strong{font-size:12px}
.command-action span{margin-top:4px;color:inherit;opacity:.67;font-size:9px;line-height:1.35}

.flow-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 16px}
.flow-item{display:flex;align-items:center;gap:10px;padding:11px 13px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.62);color:#7b837e}
.flow-item>span{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#e9e8e3;font-size:11px;font-weight:850}
.flow-item>div{display:grid}
.flow-item strong{font-size:11px}
.flow-item small{margin-top:2px;font-size:9px;color:#969c98}
.flow-item.current{border-color:#afc2b7;background:#fff;color:var(--ink);box-shadow:var(--shadow-soft)}
.flow-item.current>span{background:var(--brand);color:#fff}
.flow-item.done{color:var(--ok)}
.flow-item.done>span{background:var(--ok-soft)}
.compact-flow{max-width:720px}

.composer-layout{max-width:1100px}
.composer-card{padding:0;overflow:hidden}
.form-section{padding:23px 25px;border-top:1px solid #eceae5}
.form-section:first-child{border-top:0}
.form-section-head{margin-bottom:16px}
.form-section-head>div{display:flex;gap:11px;align-items:flex-start}
.form-step{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:#edf1ee;color:var(--brand);font-size:10px;font-weight:850}
.form-section-head h2{margin:0;font-size:18px}
.form-section-head p{margin:3px 0 0;color:var(--muted);font-size:11px}
.type-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.type-card{position:relative;display:grid;gap:7px;min-height:160px;padding:17px;border:1px solid #dedcd6;border-radius:11px;background:#fbfaf7;cursor:pointer;transition:.16s}
.type-card:hover{border-color:#bfc9c3;background:#fff}
.type-card:has(input:checked){border-color:var(--brand);box-shadow:inset 0 0 0 1px var(--brand);background:#f8fbf9}
.type-card input{position:absolute;opacity:0;pointer-events:none}
.type-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:#ecefecc9;color:var(--brand);font-size:14px}
.type-card strong{font-size:14px}
.type-card small{color:var(--muted);font-size:11px;line-height:1.45}
.type-check{margin-top:auto;color:#909791;font-size:9px;font-weight:800;letter-spacing:.05em}
.type-card:has(input:checked) .type-check{color:var(--ok)}
.field-label{display:grid;gap:8px;font-size:12px;font-weight:750}
textarea,select,input[type=text],input:not([type]),input[type=password],input[type=file]{width:100%;border:1px solid #d9d7d1;border-radius:9px;padding:11px 12px;background:#fff;color:var(--ink);font:inherit}
textarea{resize:vertical;line-height:1.5}
textarea:focus,select:focus,input:focus{outline:3px solid rgba(47,91,73,.1);border-color:#789486}
.composer-footer{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:18px 25px;background:#f7f6f2;border-top:1px solid #e6e4df}
.composer-note{display:grid}
.composer-note strong{font-size:11px}
.composer-note span{margin-top:3px;color:var(--muted);font-size:10px}
.generation-monitor{max-width:1100px;margin:14px 0 0;padding:18px 20px;border:1px solid #dfd8bd;border-radius:13px;background:#fffdf4;box-shadow:var(--shadow-soft)}
.generation-monitor[hidden]{display:none}
.generation-monitor-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.generation-monitor-head h2{margin:4px 0 0;font-size:18px}
.generation-monitor .activity-status{padding:6px 9px;background:#f3e8a8;color:#6f5a0a}
.generation-stage{display:flex;align-items:center;gap:12px;margin-top:16px;padding:13px 14px;border-radius:10px;background:#f7f4e8}
.generation-stage>div{display:grid;gap:3px}
.generation-stage strong{font-size:12px}
.generation-stage small{color:var(--muted);font-size:10px}
.generation-pulse{width:11px;height:11px;border-radius:50%;background:var(--pucara);box-shadow:0 0 0 0 rgba(239,196,47,.45);animation:generation-pulse 1.35s infinite}
@keyframes generation-pulse{0%{box-shadow:0 0 0 0 rgba(239,196,47,.45)}70%{box-shadow:0 0 0 9px rgba(239,196,47,0)}100%{box-shadow:0 0 0 0 rgba(239,196,47,0)}}
.compact-monitor{max-width:none;margin-top:12px;padding:14px 15px}
.compact-monitor .generation-monitor-head h2{font-size:15px}
.compact-monitor .generation-stage{margin-top:11px;padding:10px 12px}
.library-upload-monitor{grid-column:1/-1}
.upload-progress-track{height:8px;margin-top:12px;border-radius:999px;background:#e8e5d8;overflow:hidden}
.upload-progress-track span{display:block;width:0;height:100%;border-radius:inherit;background:var(--pucara);transition:width .18s ease}
.upload-progress-label{display:block;margin-top:5px;color:var(--muted);font-size:10px;font-weight:800;text-align:right}
.library-upload-monitor .activity-status{transition:.15s}


.review-workbench,.final-workbench{display:grid;grid-template-columns:minmax(0,.92fr) minmax(420px,1.08fr);gap:14px;align-items:start}
.copy-editor-card{min-height:520px}
.instagram-preview-card{position:sticky;top:88px}
.proposal-copy{padding:15px 0 17px;border-top:1px solid #eceae5;border-bottom:1px solid #eceae5}
.proposal-copy h3{margin:0 0 10px;font-size:24px;letter-spacing:-.02em}
.caption{white-space:pre-wrap;line-height:1.6}
.proposal-copy .caption{margin:0;color:#37433c;font-size:15px}
.meta-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:15px 0}
.meta-grid div{padding:10px 11px;border-radius:9px;background:#f7f6f2}
.meta-grid dt{color:#8a918c;font-size:9px;text-transform:uppercase;letter-spacing:.07em}
.meta-grid dd{margin:4px 0 0;font-size:11px;font-weight:800}
.reformulate-box{margin-top:15px;padding:14px;border-radius:10px;background:#f6f6f2}
.reformulate-box>div{display:grid;margin-bottom:10px}
.reformulate-box strong{font-size:11px}
.reformulate-box span{margin-top:3px;color:var(--muted);font-size:9px}
.inline-form{display:grid;grid-template-columns:1fr auto;gap:8px}
.instagram-card{max-width:440px;margin:0 auto;border:1px solid #dddcd8;border-radius:13px;overflow:hidden;background:#fff;box-shadow:0 12px 28px rgba(18,31,24,.08)}
.ig-head{height:54px;display:flex;align-items:center;gap:9px;padding:0 12px}
.avatar{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#c08b5a,#7b4d2b);color:#fff;font-size:11px;font-weight:900}
.ig-head>div{display:grid}
.ig-head strong{font-size:10px}
.ig-head small{margin-top:2px;color:#9a9f9c;font-size:8px}
.ig-more{margin-left:auto;color:#6d756f;font-weight:900}
.instagram-card img,.instagram-card video{display:block;width:100%;max-height:560px;aspect-ratio:4/5;object-fit:cover;background:#eee}
.ig-toolbar{display:flex;gap:13px;padding:11px 13px 2px;font-size:18px}
.ig-toolbar .save{margin-left:auto}
.ig-caption{padding:8px 13px 14px;font-size:10px;line-height:1.45}
.story-instagram-card{max-width:350px}
.story-instagram-card img,.story-instagram-card video{aspect-ratio:9/16;max-height:660px;object-fit:cover}
.story-instagram-card .preview-media-button{background:#111}
.story-reply-bar{display:grid;grid-template-columns:1fr auto auto;gap:9px;align-items:center;padding:10px 12px;background:#111;color:#fff}
.story-reply-bar span{padding:8px 12px;border:1px solid rgba(255,255,255,.55);border-radius:999px;font-size:10px;color:#f6f6f6}
.story-reply-bar b{font-size:17px;font-weight:500}
.reel-instagram-card{max-width:350px}
.reel-instagram-card video{aspect-ratio:9/16;max-height:660px;object-fit:cover;background:#111}
.reel-source-note{display:grid;gap:4px;padding:13px 14px;border:1px solid #ddd8c5;border-radius:10px;background:#fbf7e8}
.reel-source-note[hidden]{display:none}
.reel-source-note strong{font-size:12px}
.reel-source-note span{color:var(--muted);font-size:10px;line-height:1.4}
.empty-preview{min-height:420px;border:1px dashed #cfd2cd;border-radius:11px;background:#faf9f6;display:grid;place-content:center;text-align:center;padding:28px;color:var(--muted)}
.empty-preview-icon{font-size:28px;color:#aab1ad}
.empty-preview strong{margin-top:10px;color:var(--ink);font-size:12px}
.empty-preview p{max-width:300px;margin:6px auto 0;font-size:10px;line-height:1.45}

.media-panel{margin-top:14px}
.media-header{align-items:center}
.candidate-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.candidate-card{overflow:hidden;border:1px solid var(--line);border-radius:11px;background:#fff}
.candidate-card.selected{border-color:#74917f;box-shadow:0 0 0 2px rgba(47,91,73,.1)}
.candidate-media{position:relative}
.candidate-media img,.candidate-media video{display:block;width:100%;aspect-ratio:4/5;object-fit:cover;background:#eee}
.candidate-badge{position:absolute;top:8px;left:8px;padding:5px 7px;background:rgba(18,31,24,.86);color:#fff}
.candidate-badge.recommended{background:#234f3d}
.candidate-badge.selected-label{background:#7b572f}
.candidate-copy{padding:10px}
.music-recommendation-head{display:grid;gap:4px;min-width:0;margin-bottom:6px}
.music-track-name{display:block;min-width:0;overflow-wrap:anywhere;word-break:break-word;line-height:1.28}
.music-confidence{display:block;line-height:1.3}
.candidate-copy p{min-height:34px;margin:0 0 9px;color:var(--muted);font-size:9px;line-height:1.45}
.selected-confirmation{padding:9px;text-align:center;border-radius:8px;background:var(--ok-soft);color:var(--ok);font-size:10px;font-weight:800}
.media-tools{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:14px;padding-top:14px;border-top:1px solid #eceae5}
.upload-row{display:flex;gap:8px;align-items:center;flex:1}
.upload-row input[type=file]{max-width:420px;padding:8px}
.media-empty-row{display:flex;justify-content:space-between;padding:16px;border:1px dashed #d4d2cc;border-radius:10px;color:var(--muted);font-size:11px}
.media-empty-row a{color:var(--brand);font-weight:800;text-decoration:none}

.action-dock{position:sticky;bottom:12px;z-index:10;display:flex;justify-content:space-between;gap:20px;align-items:center;margin-top:14px;padding:12px 14px;border:1px solid #d7d5cf;border-radius:12px;background:rgba(250,249,246,.94);backdrop-filter:blur(16px);box-shadow:0 14px 32px rgba(18,31,24,.12)}
.action-dock>div:first-child{display:grid}
.action-dock strong{font-size:11px}
.action-dock span{margin-top:2px;color:var(--muted);font-size:9px}
.dock-actions{display:flex;gap:8px;align-items:center}
.dock-actions form{margin:0}

.final-preview-card{background:#f9f8f4}
.final-dock{width:min(720px,52vw);margin-left:auto}
.final-instagram{max-width:520px}
.final-preview-card .feed-instagram-card .final-preview-media-button{
  display:block;
  width:100%;
  background:#eee;
}
.final-preview-card .feed-instagram-card .final-preview-media-button img{
  width:100%;
  height:auto;
  max-height:none;
  aspect-ratio:4/5;
  object-fit:contain;
  background:#eee;
}
.final-preview-card .final-instagram.story-instagram-card{
  width:min(100%,390px);
  max-width:390px;
}
.final-preview-card .story-instagram-card .final-preview-media-button{
  display:grid;
  place-items:center;
  width:100%;
  background:#111;
}
.final-preview-card .story-instagram-card .final-preview-media-button img{
  width:auto;
  height:auto;
  max-width:100%;
  max-height:calc(100vh - 260px);
  aspect-ratio:auto;
  object-fit:contain;
  margin:0 auto;
  background:#111;
}
.final-preview-card .story-instagram-card video{
  width:auto;
  height:auto;
  max-width:100%;
  max-height:calc(100vh - 260px);
  aspect-ratio:auto;
  object-fit:contain;
  margin:0 auto;
  background:#111;
}
.final-preview-card .final-preview-zoom-hint{
  opacity:1;
  transform:none;
}
.approval-summary{position:sticky;top:88px}
.approval-summary h2{margin:6px 0 10px;font-size:23px}
.compact-caption{font-size:13px;color:#46514b}
.publication-mode{display:grid;gap:4px;margin:18px 0;padding:13px 14px;border-radius:10px}
.publication-mode span{font-size:9px;font-weight:850;letter-spacing:.08em}
.publication-mode strong{font-size:12px}
.publication-mode small{font-size:9px}
.publication-mode.safe{background:var(--warning-soft);color:#77522d}
.publication-mode.real{background:var(--ok-soft);color:var(--ok)}
.summary-list{display:grid;margin:0}
.summary-list div{display:grid;grid-template-columns:100px 1fr;gap:10px;padding:10px 0;border-top:1px solid #eceae5}
.summary-list dt{color:var(--muted);font-size:10px}
.summary-list dd{margin:0;font-size:11px;font-weight:760}
.attempt{display:grid;gap:3px;margin-top:12px;padding:11px;border-radius:9px;border:1px solid var(--line);font-size:10px}
.attempt.success{border-color:#b9d8c5;background:#f5fbf7}
.attempt.failed{border-color:#e4bbbb;background:#fdf7f6}
.attempt small{color:var(--muted)}

.notice{padding:11px 13px;border-radius:9px;margin-bottom:13px;font-size:11px}
.notice.success{background:var(--ok-soft);color:#285b40;border:1px solid #c9e1d2}
.notice.error{background:var(--danger-soft);color:var(--danger);border:1px solid #edc9c5}
.notice.warning{background:var(--warning-soft);color:#77522d;border:1px solid #e7cfad}
.empty-state{padding:24px;text-align:center;color:var(--muted)}
.empty-state strong{color:var(--ink)}
.empty-state p{margin:5px 0 0;font-size:11px}
.compact-empty{padding:18px}

/* Compatibility for phase-2 screens */
.agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.agent-card,.panel,.history-card,.library-card{background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-soft)}
.agent-card{padding:20px;min-height:170px}
.agent-card h2{font-size:17px}
.badge{font-size:9px;font-weight:850;letter-spacing:.08em;color:var(--muted)}
.badge.ok{color:var(--ok)}
.page-head{display:flex;justify-content:space-between;gap:22px;align-items:flex-start;margin:4px 0 20px}
.page-head h1{margin:5px 0 8px;font-size:36px;letter-spacing:-.03em}
.page-head p{margin:0;color:var(--muted)}
.panel{padding:20px}
.library-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}
.library-card{overflow:hidden}
.library-card img,.library-card video{display:block;width:100%;aspect-ratio:4/5;object-fit:cover;background:#eee}
.library-card>div{padding:10px}
.library-card small{display:block;color:var(--muted);margin-top:3px}
.history-list{display:grid;gap:8px}
.history-card{display:flex;justify-content:space-between;gap:16px;padding:16px;text-decoration:none}
.history-card p{margin:5px 0 0;color:var(--muted);font-size:11px}
.status{padding:6px 9px;border-radius:999px;background:#ededE9;font-size:9px;font-weight:850;letter-spacing:.06em}
.status.approved{background:var(--ok-soft);color:var(--ok)}
.detail-grid{display:grid;grid-template-columns:minmax(0,.9fr) minmax(380px,1.1fr);gap:14px}
.final-media,.detail-grid video{display:block;width:100%;max-height:680px;object-fit:contain;background:#eee}
details{margin-top:18px}
pre{white-space:pre-wrap;background:#f6f5f2;padding:10px;border-radius:8px;font-size:10px}
.muted{color:var(--muted)}

.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 15%,#e7dfd2,transparent 33%),var(--canvas)}
.login-panel{width:min(420px,100%);background:#fff;border:1px solid var(--line);border-radius:14px;padding:28px;box-shadow:var(--shadow)}
.login-panel h1{margin:7px 0 8px;font-size:28px}
.login-panel p{color:var(--muted)}
.login-panel .composer{display:grid;gap:14px}
.login-panel label{display:grid;gap:6px;font-size:11px;font-weight:760}
.login-panel .primary{min-height:42px;border:0;border-radius:9px;background:var(--brand);color:#fff;font-weight:800;cursor:pointer}

@media(max-width:1180px){
  .dashboard-columns,.agent-command-card{grid-template-columns:1fr}
  .command-actions{grid-template-columns:repeat(3,1fr)}
  .feature-agent-card{grid-template-columns:1fr minmax(300px,.7fr)}
  .review-workbench,.final-workbench{grid-template-columns:1fr}
  .instagram-preview-card,.approval-summary{position:static}
}
@media(max-width:980px){
  .app-shell{display:block}
  .sidebar{position:fixed;left:0;top:0;width:268px;transform:translateX(-102%);transition:transform .2s ease;box-shadow:18px 0 40px rgba(0,0,0,.22)}
  body.sidebar-open .sidebar{transform:translateX(0)}
  .mobile-menu{display:grid;position:fixed;right:16px;top:14px;z-index:30;width:40px;height:40px;padding:10px;border:1px solid #dedbd4;border-radius:10px;background:#fff;box-shadow:var(--shadow-soft)}
  .mobile-menu span{height:2px;background:#233129;margin:auto;width:18px}
  .workspace-bar{padding:0 66px 0 18px}
  .content-shell{padding:24px 18px 70px}
  .stat-grid{grid-template-columns:repeat(2,1fr)}
  .feature-agent-card{grid-template-columns:1fr}
  .feature-agent-visual{min-height:240px}
  .type-grid{grid-template-columns:1fr}
  .candidate-grid,.library-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:680px){
  .page-title-row,.page-title-row.compact,.section-header,.media-tools,.action-dock,.composer-footer{align-items:stretch;flex-direction:column}
  .page-title-row{display:flex}
  .page-title-row h1{font-size:32px}
  .stat-grid{grid-template-columns:1fr 1fr}
  .command-actions{grid-template-columns:1fr}
  .flow-strip{grid-template-columns:1fr}
  .candidate-grid,.library-grid,.agent-grid{grid-template-columns:1fr}
  .meta-grid{grid-template-columns:1fr}
  .inline-form{grid-template-columns:1fr}
  .upload-row{flex-direction:column;align-items:stretch}
  .upload-row input[type=file]{max-width:none}
  .dock-actions{display:grid;grid-template-columns:1fr;width:100%}
  .dock-actions>*{width:100%}
  .primary-action,.ghost-action{width:100%}
  .activity-row{grid-template-columns:34px minmax(0,1fr)}
  .activity-status{grid-column:2;justify-self:start}
  .workspace-meta{display:none}
}
/* V2.1 home correction: operational density, no landing hero */
.app-shell{grid-template-columns:232px minmax(0,1fr)}
.sidebar{padding:20px 14px 16px}
.app-brand{padding:2px 8px 20px}
.brand-mark{width:40px;height:40px;border-radius:10px;font-size:14px}
.brand-copy strong{font-size:16px}
.nav-item{grid-template-columns:30px minmax(0,1fr);min-height:52px;padding:8px}
.nav-glyph{width:27px;height:27px}
.nav-item strong{font-size:12px}
.nav-item small{font-size:9px}
.workspace-bar{height:64px;padding:0 26px}
.content-shell{padding:24px 26px 64px}

.home-title{margin-bottom:16px;align-items:center}
.home-title h1{font-size:34px;margin:4px 0 5px}
.home-title p{font-size:13px}
.home-grid{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(390px,.92fr);gap:14px;align-items:stretch}
.pucara-module-card{padding:20px;display:flex;flex-direction:column;min-height:260px}
.module-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.module-identity{display:flex;gap:12px;align-items:center;min-width:0}
.unit-monogram.large{width:42px;height:42px;border-radius:11px;background:var(--brand);color:#fff;font-size:14px;flex:0 0 auto}
.module-title-line{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.module-title-line h2{margin:0;font-size:22px;letter-spacing:-.025em}
.module-identity p{margin:4px 0 0;color:var(--muted);font-size:10px}
.module-thumb{width:112px;height:72px;border-radius:10px;object-fit:cover;border:1px solid var(--line)}
.module-description{margin-top:20px;padding-top:16px;border-top:1px solid #eceae5}
.module-description strong{font-size:12px}
.module-description p{max-width:650px;margin:5px 0 0;color:var(--muted);font-size:11px;line-height:1.5}
.module-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-top:18px}
.module-actions .primary-action,.module-actions .secondary-link{min-height:36px;padding:8px 12px;font-size:10px}
.module-capabilities{display:flex;gap:6px;margin-top:auto;padding-top:18px}
.module-capabilities span{padding:5px 8px;border-radius:999px;background:#f1f2ee;color:#66706a;font-size:9px;font-weight:750}
.activity-card{min-height:260px;padding:20px}
.activity-card .section-header{margin-bottom:7px}
.activity-card .activity-row{padding:10px 0}
.operational-summary,.units-section{margin-top:18px}
.summary-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:9px}
.summary-heading h2{margin:3px 0 0;font-size:17px;letter-spacing:-.015em}
.summary-heading>span{color:var(--muted);font-size:9px}
.compact-stats{margin:0}
.compact-stats .stat-card{padding:13px 15px;min-height:88px;box-shadow:none}
.compact-stats .stat-card strong{font-size:23px;margin:6px 0 1px}
.unit-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.unit-card{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:11px;align-items:center;padding:13px 14px;border:1px solid var(--line);border-radius:11px;background:var(--surface)}
.unit-card>div{display:grid}
.unit-card strong{font-size:11px}
.unit-card small{margin-top:3px;color:var(--muted);font-size:9px}
.unit-card.planned{opacity:.78}

@media(max-width:1180px){
  .home-grid{grid-template-columns:1fr}
  .activity-card{min-height:auto}
}
@media(max-width:980px){
  .app-shell{display:block}
}
@media(max-width:680px){
  .unit-row{grid-template-columns:1fr}
  .module-actions{display:grid;grid-template-columns:1fr 1fr}
  .module-actions .primary-action{grid-column:1/-1}
  .module-thumb{display:none}
}

/* General panel = three first-class MWG units */
.all-units-section{margin-top:6px}
.unit-dashboard-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.unit-dashboard-card{display:flex;flex-direction:column;min-height:300px;padding:20px;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:var(--shadow-soft)}
.unit-dashboard-card.active-unit{border-color:#b9c9c0;box-shadow:0 12px 28px rgba(18,31,24,.07)}
.unit-dashboard-card.planned-unit{background:#f8f7f3}
.unit-dashboard-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}
.unit-dashboard-identity{display:flex;gap:11px;align-items:flex-start;min-width:0}
.unit-dashboard-identity>div{min-width:0}
.unit-kind{display:block;margin-bottom:5px;color:#8a918c;font-size:8px;font-weight:850;letter-spacing:.12em}
.unit-dashboard-identity h2{margin:0;font-size:19px;line-height:1.08;letter-spacing:-.02em}
.unit-dashboard-identity p{margin:5px 0 0;color:var(--muted);font-size:9px}
.unit-dashboard-body{padding:22px 0 18px}
.unit-dashboard-body p{margin:0;color:#505a54;font-size:11px;line-height:1.55}
.unit-feature-list{display:flex;gap:6px;flex-wrap:wrap;margin-top:16px}
.unit-feature-list span{padding:5px 8px;border-radius:999px;background:#edf1ee;color:var(--brand);font-size:9px;font-weight:760}
.unit-format-stats{display:flex;gap:16px;align-items:flex-start;margin-top:16px}
.unit-format-stat{display:grid;justify-items:center;gap:6px;min-width:54px}
.unit-format-stat span{padding:5px 9px;border-radius:999px;background:var(--pucara-soft);color:var(--pucara-ink);font-size:9px;font-weight:760;line-height:1}
.unit-format-stat strong{color:#111;font-size:22px;line-height:1;font-weight:850;letter-spacing:-.03em}
.unit-feature-list.muted-features span{background:#ecece8;color:#8a908c}
.unit-dashboard-footer{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-top:auto;padding-top:16px;border-top:1px solid #eceae5}
.unit-dashboard-footer .primary-action,.unit-dashboard-footer .secondary-link{min-height:36px;padding:8px 11px;font-size:10px}
.planned-message{color:#8d948f;font-size:9px;font-weight:700}
.general-status-card{display:flex;justify-content:space-between;gap:30px;align-items:center;margin-top:18px;padding:18px 20px;border:1px solid var(--line);border-radius:13px;background:#fff}
.general-status-card h2{margin:4px 0 4px;font-size:17px}
.general-status-card p{max-width:700px;margin:0;color:var(--muted);font-size:10px;line-height:1.5}
.general-status-metrics{display:grid;grid-template-columns:repeat(3,90px);gap:8px}
.general-status-metrics div{display:grid;padding:10px 12px;border-left:1px solid #eceae5}
.general-status-metrics strong{font-size:21px;line-height:1}
.general-status-metrics span{margin-top:4px;color:var(--muted);font-size:8px}
@media(max-width:1180px){
  .unit-dashboard-grid{grid-template-columns:1fr}
  .unit-dashboard-card{min-height:auto}
}
@media(max-width:760px){
  .general-status-card{align-items:stretch;flex-direction:column}
  .general-status-metrics{grid-template-columns:repeat(3,1fr)}
}

/* Remove duplicated global header; each screen owns its title */
.content-shell{padding-top:28px}
@media(max-width:980px){
  .content-shell{padding:70px 18px 70px}
}

/* OpenAI monetary usage in system rail */
.openai-cost-card{
  margin:10px 4px 0;
  padding:12px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:11px;
  background:rgba(255,255,255,.045);
  color:var(--sidebar-text);
}
.openai-cost-head,.openai-cost-today{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.openai-cost-head>span{
  font-size:10px;
  font-weight:850;
  letter-spacing:.06em;
}
.openai-cost-head small{
  color:#81968b;
  font-size:8px;
}
.openai-cost-main{display:grid;margin-top:10px}
.openai-cost-main strong{font-size:19px;line-height:1;letter-spacing:-.02em}
.openai-cost-main span{margin-top:4px;color:#82958b;font-size:8px}
.openai-cost-today{
  margin-top:10px;
  padding-top:9px;
  border-top:1px solid rgba(255,255,255,.07);
  color:#96a79e;
  font-size:9px;
}
.openai-cost-today strong{color:#d8e1dc;font-size:10px}
.openai-cost-card.available .openai-cost-head small{color:#67bb88}
.openai-cost-card.unconfigured .openai-cost-head small,
.openai-cost-card.unavailable .openai-cost-head small{color:#c7a16e}

/* Unit identity colors: color only, layout remains unchanged */
.nav-item[data-unit-nav="pucara"] .nav-glyph{background:rgba(231,198,74,.16);color:var(--pucara)}
.nav-item[data-unit-nav="modulos"] .nav-glyph{background:rgba(233,130,50,.16);color:var(--modulos)}
.nav-item[data-unit-nav="materiales"] .nav-glyph{background:rgba(77,135,199,.16);color:var(--materiales)}
.nav-item[data-unit-nav="pucara"].active{box-shadow:inset 3px 0 0 var(--pucara)}

.unit-dashboard-card[data-unit="pucara"]{box-shadow:inset 0 3px 0 var(--pucara),var(--shadow-soft)}
.unit-dashboard-card[data-unit="modulos"]{box-shadow:inset 0 3px 0 var(--modulos),var(--shadow-soft)}
.unit-dashboard-card[data-unit="materiales"]{box-shadow:inset 0 3px 0 var(--materiales),var(--shadow-soft)}

.unit-dashboard-card[data-unit="pucara"] .unit-monogram.large{background:var(--pucara);color:#3d3308}
.unit-dashboard-card[data-unit="modulos"] .unit-monogram.large{background:var(--modulos);color:#fff}
.unit-dashboard-card[data-unit="materiales"] .unit-monogram.large{background:var(--materiales);color:#fff}

.unit-dashboard-card[data-unit="pucara"] .unit-feature-list span{background:var(--pucara-soft);color:var(--pucara-ink)}
.unit-dashboard-card[data-unit="modulos"] .unit-feature-list span{background:var(--modulos-soft);color:var(--modulos-ink)}
.unit-dashboard-card[data-unit="materiales"] .unit-feature-list span{background:var(--materiales-soft);color:var(--materiales-ink)}

.unit-dashboard-card[data-unit="modulos"] .muted-badge{background:var(--modulos-soft);color:var(--modulos-ink)}
.unit-dashboard-card[data-unit="materiales"] .muted-badge{background:var(--materiales-soft);color:var(--materiales-ink)}

.unit-dashboard-card[data-unit="pucara"] .primary-action{
  background:var(--pucara);
  color:#302807;
  box-shadow:0 6px 16px rgba(167,133,27,.16)
}
.unit-dashboard-card[data-unit="pucara"] .primary-action:hover{background:#d9b83f}

/* Pucará agent theme: identity color only */
.agent-theme-pucara .kicker{color:var(--pucara-ink)}
.agent-theme-pucara .flow-item.current{border-color:#d8c365}
.agent-theme-pucara .flow-item.current>span{background:var(--pucara);color:#3d3308}
.agent-theme-pucara .form-step{background:var(--pucara-soft);color:var(--pucara-ink)}
.agent-theme-pucara .type-card:has(input:checked){
  border-color:var(--pucara);
  box-shadow:inset 0 0 0 1px var(--pucara);
  background:#fffdf4
}
.agent-theme-pucara .type-card:has(input:checked) .type-check{color:var(--pucara-ink)}
.agent-theme-pucara .type-card:has(input:checked) .type-icon{background:var(--pucara-soft);color:var(--pucara-ink)}
.agent-theme-pucara .primary-action{
  background:var(--pucara);
  color:#302807;
  box-shadow:0 6px 16px rgba(167,133,27,.16)
}
.agent-theme-pucara .primary-action:hover{background:#d9b83f}

/* Pucará dashboard: module identity background, no layout changes */
.agent-theme-pucara .agent-command-card{
  background:var(--pucara);
  color:#302807;
}
.agent-theme-pucara .command-copy p{color:#5f5217}
.agent-theme-pucara .command-action{
  border-color:rgba(48,40,7,.15);
  background:rgba(255,255,255,.22);
  color:#302807;
}
.agent-theme-pucara .command-action:hover{background:rgba(255,255,255,.32)}
.agent-theme-pucara .command-action.primary-command{
  background:#fffaf0;
  color:#302807;
}

.library-card form{margin-top:8px}
.library-remove-form{margin-bottom:0}
.danger-action{color:var(--danger);border-color:#e8c7c3;background:var(--danger-soft)}
.danger-action:hover{background:#f1d8d4}
.ghost-action.full{width:100%}
.library-dock{margin-top:18px}


/* V2.1 review + metrics UX corrections */
.app-brand{cursor:default;user-select:none}
.command-actions{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:1fr}
.command-action{min-height:108px}

.preview-media-button{
  position:relative;
  display:block;
  width:100%;
  padding:0;
  border:0;
  background:#eee;
  cursor:zoom-in;
  text-align:inherit;
}
.preview-media-button img{display:block;width:100%}
.preview-zoom-hint{
  position:absolute;
  right:10px;
  bottom:10px;
  padding:7px 9px;
  border-radius:999px;
  background:rgba(15,23,18,.82);
  color:#fff;
  font-size:9px;
  font-weight:800;
  letter-spacing:.02em;
  opacity:0;
  transform:translateY(3px);
  transition:.16s ease;
  pointer-events:none;
}
.preview-media-button:hover .preview-zoom-hint,
.preview-media-button:focus-visible .preview-zoom-hint{opacity:1;transform:none}
.preview-media-button:focus-visible{outline:3px solid rgba(231,198,74,.65);outline-offset:2px}
.preview-actions{max-width:440px;margin:12px auto 0}
.preview-actions form{margin:0}
.preview-flyer-action{width:100%;min-height:44px;font-size:12px}
.preview-lightbox[hidden]{display:none!important}
.preview-lightbox{
  position:fixed;
  inset:0;
  z-index:100;
  display:grid;
  place-items:center;
  padding:28px;
}
.preview-lightbox-backdrop{
  position:absolute;
  inset:0;
  border:0;
  background:rgba(7,12,9,.88);
  cursor:zoom-out;
}
.preview-lightbox-panel{
  position:relative;
  z-index:1;
  display:grid;
  place-items:center;
  width:min(1120px,94vw);
  height:min(900px,92vh);
}
.preview-lightbox-panel img{
  display:block;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  border-radius:10px;
  box-shadow:0 28px 80px rgba(0,0,0,.4);
}
.preview-lightbox-close{
  position:absolute;
  top:-8px;
  right:-8px;
  z-index:2;
  width:42px;
  height:42px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:50%;
  background:rgba(18,31,24,.9);
  color:#fff;
  font-size:24px;
  line-height:1;
  cursor:pointer;
}
body.preview-open{overflow:hidden}

.metrics-page{display:grid;gap:16px}
.metrics-title-row{margin-bottom:0}
.metrics-summary-card,.metrics-detail-card{box-shadow:none}
.metrics-summary-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.metrics-summary-head h2{margin:4px 0 0;font-size:22px}
.metrics-period-form{display:flex;align-items:center;gap:8px}
.metrics-period-form select{
  min-height:40px;
  padding:8px 34px 8px 12px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
}
.metrics-stat-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.metrics-stat{
  display:grid;
  min-height:112px;
  padding:16px 18px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fbfaf7;
}
.metrics-stat span{color:var(--muted);font-size:10px;font-weight:760}
.metrics-stat strong{margin:8px 0 4px;font-size:30px;line-height:1;letter-spacing:-.03em}
.metrics-stat small{color:#929994;font-size:9px}
.metrics-detail-card .section-header{margin-bottom:10px}
.metrics-table-wrap{
  width:100%;
  overflow-x:auto;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
}
.metrics-table{
  width:100%;
  min-width:1030px;
  border-collapse:collapse;
  table-layout:fixed;
}
.metrics-col-publication{width:34%}
.metrics-col-date{width:9%}
.metrics-col-number{width:auto}
.metrics-table th{
  padding:11px 10px;
  border-bottom:1px solid var(--line);
  background:#f7f6f2;
  color:#66706a;
  font-size:9px;
  font-weight:850;
  letter-spacing:.02em;
  text-align:right;
  white-space:nowrap;
}
.metrics-table th:first-child,
.metrics-table th:nth-child(2){text-align:left}
.metrics-table td{
  padding:13px 10px;
  border-top:1px solid #efede8;
  color:#29332d;
  font-size:10px;
  text-align:right;
  vertical-align:middle;
}
.metrics-table tbody tr:first-child td{border-top:0}
.metrics-table td:first-child,
.metrics-table td:nth-child(2){text-align:left}
.metrics-table tbody tr:hover{background:#fcfbf7}
.metrics-publication-cell{display:grid;gap:4px;min-width:0}
.metrics-publication-cell a,
.metrics-publication-cell>span{
  color:var(--ink);
  font-size:11px;
  font-weight:720;
  line-height:1.35;
  text-decoration:none;
}
.metrics-publication-cell a:hover{text-decoration:underline}
.metrics-publication-cell small{color:#929994;font-size:8px;text-transform:uppercase;letter-spacing:.05em}
.metrics-date{white-space:nowrap;color:#69716c}
.metrics-empty{min-height:220px}

@media(max-width:1180px){
  .command-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .metrics-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:680px){
  .command-actions{grid-template-columns:1fr}
  .metrics-summary-head{align-items:stretch;flex-direction:column}
  .metrics-period-form{display:grid;grid-template-columns:1fr auto}
  .metrics-stat-grid{grid-template-columns:1fr 1fr}
  .preview-lightbox{padding:14px}
}


/* Keep enlarged preview fully inside the visible browser viewport */
.preview-lightbox{padding:20px}
.preview-lightbox-panel{
  width:auto;
  height:auto;
  max-width:calc(100vw - 56px);
  max-height:calc(100vh - 56px);
  min-width:0;
  min-height:0;
  overflow:visible;
}
.preview-lightbox-panel img{
  width:auto;
  height:auto;
  max-width:calc(100vw - 56px);
  max-height:calc(100vh - 56px);
  object-fit:contain;
}
.preview-lightbox-close{top:8px;right:8px}
@media(max-width:680px){
  .preview-lightbox{padding:10px}
  .preview-lightbox-panel,
  .preview-lightbox-panel img{
    max-width:calc(100vw - 20px);
    max-height:calc(100vh - 20px);
  }
}


/* System status: editable commercial destination */
.system-config-card{margin-top:16px}
.system-crm-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px 14px;
  align-items:end;
}
.system-crm-form .field-label{grid-column:1}
.system-crm-form .primary-action{grid-column:2;grid-row:1;min-height:44px}
.system-crm-help{
  grid-column:1/-1;
  display:flex;
  flex-wrap:wrap;
  gap:6px 18px;
  color:var(--muted);
  font-size:10px;
}
.system-crm-test{
  display:inline-flex;
  align-items:center;
  min-height:38px;
  text-decoration:none;
  white-space:nowrap;
}
@media(max-width:760px){
  .system-crm-form{grid-template-columns:1fr}
  .system-crm-form .field-label,
  .system-crm-form .primary-action,
  .system-crm-help{grid-column:1}
  .system-crm-form .primary-action{grid-row:auto;width:100%}
}


.conversion-destination{
  display:grid;
  grid-template-columns:auto auto 1fr;
  gap:8px 10px;
  align-items:center;
  margin:12px 0;
  padding:10px 12px;
  border:1px solid #e4e0d5;
  border-radius:9px;
  background:#faf8f1;
}
.conversion-destination span{color:var(--muted);font-size:9px;font-weight:760;text-transform:uppercase;letter-spacing:.05em}
.conversion-destination strong{font-size:10px}
.conversion-destination a{justify-self:end;color:var(--brand);font-size:10px;font-weight:800;text-decoration:none}
.conversion-destination a:hover{text-decoration:underline}
@media(max-width:680px){
  .conversion-destination{grid-template-columns:1fr}
  .conversion-destination a{justify-self:start}
}


/* System status: CRM destination per agent */
.crm-agent-settings{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.crm-agent-setting{
  display:grid;
  gap:14px;
  padding:16px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fbfaf7;
}
.crm-agent-setting>header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.crm-agent-setting h3{
  margin:4px 0 0;
  font-size:16px;
  line-height:1.2;
}
.crm-agent-setting .system-crm-form{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}
.crm-agent-setting .system-crm-form .field-label,
.crm-agent-setting .system-crm-form .primary-action{
  grid-column:1;
  grid-row:auto;
}
.crm-agent-setting .system-crm-form .primary-action{width:100%}
.crm-agent-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:38px;
}
.crm-agent-actions>span{
  color:var(--muted);
  font-size:9px;
  line-height:1.35;
}
.crm-agent-actions .system-crm-test{flex:0 0 auto}
@media(max-width:1100px){
  .crm-agent-settings{grid-template-columns:1fr}
}


/* Recent work actions + managerial publication history */
.activity-row-actions{
  grid-template-columns:26px 38px minmax(0,1fr) auto auto;
}
.activity-select-slot{
  display:grid;
  place-items:center;
  min-width:20px;
}
.activity-select-slot input{
  width:15px;
  height:15px;
  margin:0;
  accent-color:var(--pucara);
  cursor:pointer;
}
.recent-bulk-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 8px;
  padding:9px 10px;
  border:1px solid #ece9df;
  border-radius:10px;
  background:#faf9f6;
}
.recent-bulk-toolbar>div{
  display:flex;
  align-items:center;
  gap:10px;
}
.recent-bulk-toolbar span{
  color:var(--muted);
  font-size:9px;
  font-weight:760;
}
.recent-bulk-toolbar form{margin:0}
.recent-bulk-toolbar button:disabled{
  opacity:.45;
  cursor:not-allowed;
}
.activity-actions{
  display:flex;
  gap:7px;
  align-items:center;
  justify-content:flex-end;
}
.row-action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:var(--ink);
  font-size:9px;
  font-weight:820;
  text-decoration:none;
  white-space:nowrap;
}
.row-action:hover{background:#f7f6f2}
.primary-row-action{
  border-color:#d7c050;
  background:#f8e27a;
  color:#2d290d;
}
.primary-row-action:hover{background:#f3d95f}

.history-manager-card{padding:20px}
.history-manager-list{display:grid}
.history-manager-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:18px;
  align-items:center;
  padding:16px 0;
  border-top:1px solid #eceae5;
}
.history-manager-row:first-child{border-top:0}
.history-manager-main{
  display:flex;
  gap:12px;
  align-items:center;
  min-width:0;
}
.history-manager-icon{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  border-radius:10px;
  background:#edf1ee;
  color:var(--brand);
  font-size:12px;
  font-weight:850;
  flex:0 0 auto;
}
.history-manager-copy{
  display:grid;
  min-width:0;
}
.history-manager-copy strong{
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.history-manager-copy span{
  margin-top:3px;
  color:var(--muted);
  font-size:10px;
}
.history-manager-copy small{
  margin-top:5px;
  color:#46514b;
  font-size:10px;
}
.history-manager-meta{
  display:grid;
  gap:5px;
  justify-items:end;
  min-width:160px;
}
.history-manager-meta>span:last-child{
  color:var(--muted);
  font-size:9px;
}
.history-status{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:5px 8px;
  border-radius:999px;
  background:#efefeb;
  color:#626a65;
  font-size:8px;
  font-weight:850;
  letter-spacing:.04em;
  white-space:nowrap;
}
.history-manager-actions{
  display:flex;
  gap:7px;
  justify-content:flex-end;
}
.history-detail-grid{align-items:start}
.history-media-card{min-width:0}
.history-detail-card>h2{margin:6px 0 12px}
.history-summary-list{margin-top:18px}
.history-version-block,.history-attempt-block{
  margin-top:20px;
  padding-top:18px;
  border-top:1px solid #eceae5;
}
.compact-history-header{margin-bottom:8px}
.compact-history-header h3{margin:3px 0 0;font-size:15px}
.history-version-list{display:grid}
.history-version-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding:10px 0;
  border-top:1px solid #efede8;
  color:var(--ink);
  text-decoration:none;
}
.history-version-row:first-child{border-top:0}
.history-version-row.current{
  margin:0 -8px;
  padding:10px 8px;
  border-radius:8px;
  background:#faf6df;
}
.history-version-row>div{display:grid;min-width:0}
.history-version-row strong{font-size:10px}
.history-version-row span:not(.history-status){
  margin-top:3px;
  color:var(--muted);
  font-size:9px;
}
.technical-details summary{
  cursor:pointer;
  color:var(--muted);
  font-size:10px;
  font-weight:760;
}

@media(max-width:980px){
  .activity-row-actions{
    grid-template-columns:36px minmax(0,1fr) auto;
  }
  .activity-actions{
    grid-column:2/-1;
    justify-content:flex-start;
  }
  .history-manager-row{
    grid-template-columns:minmax(0,1fr) auto;
  }
  .history-manager-actions{
    grid-column:1/-1;
    justify-content:flex-start;
    padding-left:50px;
  }
}
@media(max-width:680px){
  .activity-row-actions{
    grid-template-columns:34px minmax(0,1fr);
  }
  .activity-row-actions .activity-status{
    grid-column:2;
    justify-self:start;
  }
  .activity-actions{
    grid-column:2;
    flex-wrap:wrap;
  }
  .history-manager-row{
    grid-template-columns:1fr;
    gap:10px;
  }
  .history-manager-meta{
    justify-items:start;
    padding-left:50px;
  }
  .history-manager-actions{
    padding-left:50px;
    flex-wrap:wrap;
  }
}


/* Destructive proposal actions */
.activity-actions form{margin:0}
.danger-row-action{
  border-color:#e3c3bf;
  background:#fff8f7;
  color:#9c4037;
  cursor:pointer;
}
.danger-row-action:hover{background:#fbeceb}
.danger-action{
  border-color:#dfbdb9;
  color:#99463e;
}
.danger-action:hover{background:#fbeceb}


/* Visible deployed build identity */
.build-badge{
  display:grid;
  grid-template-columns:auto auto;
  gap:3px 8px;
  align-items:center;
  justify-items:end;
  min-width:138px;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:10px;
  background:rgba(255,255,255,.72);
  color:var(--muted);
  box-shadow:var(--shadow-soft);
}
.build-badge span{
  grid-column:1/-1;
  font-size:8px;
  font-weight:850;
  letter-spacing:.12em;
}
.build-badge strong{
  color:var(--ink);
  font-size:11px;
}
.build-badge code{
  padding:2px 5px;
  border-radius:5px;
  background:#efeee9;
  color:#6d756f;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:9px;
}
@media(max-width:680px){
  .home-title{align-items:stretch;flex-direction:column}
  .build-badge{justify-items:start;width:max-content}
}


/* Global deployed version — deliberately quiet, always visible */
.global-build-badge{
  position:fixed;
  top:18px;
  right:28px;
  z-index:30;
  display:flex;
  align-items:center;
  gap:6px;
  padding:0;
  border:0;
  background:transparent;
  color:#8a918c;
  box-shadow:none;
  font-size:10px;
  line-height:1;
}
.global-build-badge strong{
  color:#59615c;
  font-size:10px;
  font-weight:800;
}
.global-build-badge span{
  color:#a5aaa7;
  font-size:10px;
}
.global-build-badge code{
  padding:0;
  border:0;
  background:transparent;
  color:#969c98;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:9px;
}
@media(max-width:980px){
  .global-build-badge{top:16px;right:16px}
}


/* Operational CTA contract */
.operational-cta{
  display:grid;
  gap:9px;
  margin:16px 0 12px;
  padding:14px 15px;
  border:1px solid #ddd9c6;
  border-radius:10px;
  background:#fffdf5;
}
.operational-cta-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.operational-cta-head span{
  color:#8a7a2b;
  font-size:8px;
  font-weight:900;
  letter-spacing:.1em;
}
.operational-cta-head strong{
  color:#302807;
  font-size:11px;
}
.operational-cta p{
  margin:0;
  color:var(--ink);
  font-size:13px;
  font-weight:760;
  line-height:1.45;
}
.operational-cta-meta{
  display:grid;
  gap:3px;
  color:var(--muted);
  font-size:9px;
  line-height:1.45;
}
.compact-operational-cta{
  margin:14px 0;
  padding:12px 13px;
}

.flyer-progress-button{display:flex;align-items:center;justify-content:center;gap:9px;min-height:42px}
.flyer-progress-dot{display:none;width:9px;height:9px;border-radius:50%;background:currentColor}
.flyer-progress-button.is-processing{cursor:wait;opacity:.92}
.flyer-progress-button.is-processing .flyer-progress-dot{display:inline-block;animation:flyer-progress-pulse 1.1s ease-in-out infinite}
@keyframes flyer-progress-pulse{0%,100%{transform:scale(.8);opacity:.45}50%{transform:scale(1.25);opacity:1}}


/* Compact CTA state control */
.cta-setting-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  min-height:72px;
  padding:13px 15px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fbfaf7;
}
.cta-setting-copy{
  display:grid;
  gap:3px;
  min-width:0;
}
.cta-setting-copy strong{font-size:12px}
.cta-setting-copy span{
  color:var(--ink);
  font-size:11px;
  font-weight:760;
}
.cta-setting-copy small{
  color:var(--muted);
  font-size:9px;
  line-height:1.4;
}
.toggle-switch{
  position:relative;
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  cursor:pointer;
}
.toggle-switch input{
  position:absolute;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}
.toggle-track{
  display:flex;
  align-items:center;
  width:46px;
  height:26px;
  padding:3px;
  border-radius:999px;
  background:#c9ceca;
  transition:.18s ease;
  box-shadow:inset 0 0 0 1px rgba(22,32,25,.08);
}
.toggle-thumb{
  display:block;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 4px rgba(0,0,0,.18);
  transition:.18s ease;
}
.toggle-switch input:checked + .toggle-track{
  background:var(--pucara);
}
.toggle-switch input:checked + .toggle-track .toggle-thumb{
  transform:translateX(20px);
}
.toggle-switch input:focus-visible + .toggle-track{
  outline:3px solid rgba(231,198,74,.42);
  outline-offset:3px;
}
.toggle-switch input:disabled + .toggle-track{
  opacity:.48;
  cursor:not-allowed;
}
.review-cta-setting{margin:14px 0}
@media(max-width:680px){
  .cta-setting-row{align-items:flex-start}
  .toggle-switch{margin-top:3px}
}

@media(max-width:980px){
  .final-dock{width:100%;margin-left:0}
}

/* Final publication CTA: keep the primary action visually dominant while publishing. */
.final-dock .dock-actions form[data-publish-form]{width:252px;min-width:252px;flex:0 0 252px}
.final-dock .final-publish-button{
  box-sizing:border-box;
  width:252px;
  min-width:252px;
  min-height:52px;
  padding:14px 18px;
  border-radius:11px;
  background:var(--pucara);
  color:var(--pucara-ink);
  box-shadow:0 8px 20px rgba(99,82,10,.18);
  font-size:16px;
  font-weight:850;
  line-height:1;
  white-space:nowrap;
}
.final-dock .final-publish-button [data-publish-text]{
  margin-top:0;
  color:inherit;
  font-size:16px;
  font-weight:850;
  line-height:1;
}
.final-dock .final-publish-button:hover{background:#efd45e}
.final-dock .final-publish-button.is-processing,
.final-dock .final-publish-button.is-processing:disabled{
  opacity:1;
  cursor:wait;
  background:var(--pucara);
  color:var(--pucara-ink);
  transform:none;
}
.final-dock .publish-status-copy strong{font-size:12px}
.final-dock .publish-status-copy span{font-size:10px;line-height:1.4}



/* Compact campaign controls: keep market and giveaway within one desktop viewport. */
.campaign-settings-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  border-top:1px solid #eceae5;
}
.campaign-settings-grid .compact-settings-section{
  border-top:0;
  padding:18px 20px;
  min-width:0;
}
.campaign-settings-grid .compact-settings-section + .compact-settings-section{
  border-left:1px solid #eceae5;
}
.campaign-settings-grid .form-section-head{margin-bottom:12px}
.campaign-settings-grid .field-label{gap:6px}
.campaign-settings-grid .field-label + .field-label{margin-top:10px}
.campaign-settings-grid .cta-setting-row{
  min-height:64px;
  margin-top:10px;
  padding:10px 12px;
}
.campaign-settings-grid .giveaway-panel{
  margin-top:10px;
  padding:12px;
  gap:10px;
}
.campaign-settings-grid .giveaway-actions{padding:10px 12px;gap:6px}
.campaign-settings-grid textarea{min-height:0}
@media(max-width:980px){
  .campaign-settings-grid{grid-template-columns:1fr}
  .campaign-settings-grid .compact-settings-section + .compact-settings-section{
    border-left:0;
    border-top:1px solid #eceae5;
  }
}

/* Optional giveaway stage: isolated campaign configuration. */
.giveaway-panel{display:grid;gap:14px;margin-top:14px;padding:16px;border:1px solid #e1d9b8;border-radius:12px;background:#fffdf4}
.giveaway-panel[hidden]{display:none}
.giveaway-actions{display:grid;gap:8px;padding:12px 14px;border:1px solid #e7e2d1;border-radius:10px;background:#fff}
.giveaway-actions>strong{font-size:11px}
.giveaway-actions label{display:flex;gap:8px;align-items:center;font-size:11px;font-weight:700;color:var(--ink)}
.giveaway-actions input[type=checkbox]{width:16px;height:16px;accent-color:var(--pucara)}
.giveaway-actions small,.giveaway-panel .field-label small{color:var(--muted);font-size:9px;line-height:1.45}
.giveaway-contract-note{display:grid;gap:4px;margin:0}
.giveaway-contract-note strong{font-size:10px}
.giveaway-contract-note span{font-size:9px;line-height:1.45}

.giveaway-review-card{display:grid;gap:5px;margin:12px 0;padding:12px 14px;border:1px solid #e1d9b8;border-radius:10px;background:#fffdf4}
.giveaway-review-card>strong{font-size:13px}
.giveaway-review-card>small,.giveaway-review-card>p{margin:0;color:var(--muted);font-size:9px;line-height:1.45}


/* Publication mode selector and giveaway dates */
.campaign-mode-section{border-top:1px solid #eceae5;padding:20px}
.publication-mode-selector{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.publication-mode-option{position:relative;display:block;cursor:pointer}
.publication-mode-option input{position:absolute;opacity:0;pointer-events:none}
.publication-mode-option>span{
  display:grid;
  gap:4px;
  min-height:72px;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fbfaf7;
}
.publication-mode-option strong{font-size:12px}
.publication-mode-option small{color:var(--muted);font-size:9px;line-height:1.4}
.publication-mode-option input:checked+span{
  border-color:#d8be3f;
  background:#fff8cf;
  box-shadow:0 0 0 2px rgba(231,198,74,.18);
}
.mode-settings-panel>[hidden]{display:none}
.compact-mode-head{margin-bottom:2px!important}
.giveaway-date-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.giveaway-fixed-condition{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid #e7e2d1;
  border-radius:10px;
  background:#fff;
  font-size:10px;
}
.giveaway-fixed-condition strong{font-size:10px}
.giveaway-fixed-condition span{font-weight:800}
[data-draw-weekday].is-weekend{color:#8a6c00;font-weight:850}
@media(max-width:680px){
  .publication-mode-selector,.giveaway-date-grid{grid-template-columns:1fr}
}


/* Review context hierarchy */
.review-context-header{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:10px 18px;
  margin:0 0 8px;
}
.review-publication-type{
  font-size:24px;
  line-height:1;
  letter-spacing:-.02em;
  color:var(--brand);
}
.review-context-header span{
  font-size:13px;
  font-weight:780;
  color:var(--muted);
}
@media(max-width:680px){
  .review-context-header{display:grid;gap:5px}
  .review-publication-type{font-size:21px}
}


/* Pucara Bolillero: isolated visual layer. The server decides the draw. */
.agent-command-card .command-actions{grid-template-columns:repeat(5,minmax(0,1fr))}
.giveaway-fixed-keyword{display:grid;gap:5px;padding:13px 14px;border:1px solid #dedbd0;border-radius:10px;background:#faf8f0;margin-bottom:13px}
.giveaway-fixed-keyword>span{font-size:11px;font-weight:750;color:var(--muted)}
.giveaway-fixed-keyword>strong{font-size:24px;letter-spacing:.08em;color:var(--brand)}
.giveaway-fixed-keyword>small{font-size:10px;line-height:1.45;color:var(--muted)}
.bolillero-campaign-card{overflow:hidden}
.bolillero-date-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.bolillero-date-grid>div{display:grid;gap:5px;padding:14px;border:1px solid var(--line);border-radius:10px;background:#faf9f6}
.bolillero-date-grid span{font-size:10px;color:var(--muted);font-weight:760}
.bolillero-date-grid strong{font-size:20px;letter-spacing:-.02em}
.bolillero-date-grid small{font-size:9px;color:var(--muted);line-height:1.35}
.bolillero-winner-card{display:grid;justify-items:start;gap:8px;background:linear-gradient(135deg,#f7f3df,#fff)}
.bolillero-winner-card h2{margin:0;font-size:30px}
.bolillero-winner-card p{margin:0 0 8px}
.bolillero-winner-card>small{color:var(--muted)}
.bolillero-stage{display:grid;grid-template-columns:minmax(280px,.85fr) minmax(300px,1.15fr);gap:26px;align-items:center;min-height:330px}
.bolillero-drum{position:relative;width:280px;height:280px;margin:auto;border:10px solid #26372f;border-radius:50%;background:radial-gradient(circle at 40% 30%,#fff,#f0eee7 62%,#d7d4ca);overflow:hidden;box-shadow:inset 0 0 0 6px rgba(255,255,255,.8),0 14px 30px rgba(20,40,30,.14)}
.bolillero-axis{position:absolute;left:50%;top:50%;width:38px;height:38px;border-radius:50%;background:#26372f;transform:translate(-50%,-50%);box-shadow:0 0 0 8px rgba(38,55,47,.14)}
.bolillero-ball{position:absolute;display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#f3ca3d;border:2px solid rgba(70,55,10,.18);font-size:11px;font-weight:900;box-shadow:0 5px 10px rgba(40,32,10,.12)}
.bolillero-drum.is-spinning{animation:bolillero-drum 2.25s cubic-bezier(.2,.7,.25,1)}
.bolillero-drum.is-spinning .bolillero-ball{animation:bolillero-ball 1.05s ease-in-out infinite alternate}
.bolillero-drum.is-spinning .bolillero-ball:nth-child(2n){animation-delay:-.27s}
.bolillero-drum.is-spinning .bolillero-ball:nth-child(3n){animation-delay:-.49s}
@keyframes bolillero-drum{0%{transform:rotate(0)}65%{transform:rotate(760deg)}100%{transform:rotate(1080deg)}}
@keyframes bolillero-ball{0%{transform:translate(-14px,20px) rotate(-90deg)}100%{transform:translate(18px,-16px) rotate(120deg)}}
.bolillero-result{display:grid;gap:10px}
.bolillero-result[hidden]{display:none}
.bolillero-result>span{font-size:10px;font-weight:850;letter-spacing:.12em;color:var(--muted);text-transform:uppercase}
.bolillero-result>strong{display:flex;align-items:center;gap:11px;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:14px}
.bolillero-result b{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--brand);color:#fff}
.bolillero-replay{margin-top:4px}
.bolillero-finalists{display:grid;gap:8px}
.bolillero-finalist{display:grid;grid-template-columns:34px minmax(0,1fr) minmax(0,.8fr);gap:12px;align-items:center;padding:12px;border:1px solid var(--line);border-radius:10px}
.bolillero-finalist>span{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#efeee8;font-weight:850}
.bolillero-finalist>div{display:grid}
.bolillero-finalist small{color:var(--muted);font-size:9px}
.bolillero-finalist.winner{border-color:#acd0b9;background:#f4faf6}
.bolillero-finalist.rejected{opacity:.72;background:#faf7f6}
.bolillero-auto-checks{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:16px}
.bolillero-auto-checks>div{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;padding:11px;border-radius:9px;background:var(--ok-soft);color:var(--ok);font-size:11px}
.bolillero-auto-checks small{font-size:8px;font-weight:800}
.bolillero-auto-checks>div.rigid-rule{background:#f5f2e7;color:#6b5c22}
.bolillero-identity-readonly{display:grid;gap:4px;padding:12px 13px;border:1px solid #cfd9d3;border-radius:10px;background:#f6faf7}
.bolillero-identity-readonly strong{font-size:12px}
.bolillero-identity-readonly small{color:var(--muted);font-size:9px;line-height:1.4}
.bolillero-identity-readonly.missing{border-color:#e3d4ad;background:#fbf7ea;color:#765b1f}
.bolillero-check-form{display:grid;gap:10px}
.bolillero-check-row{display:grid;grid-template-columns:minmax(220px,1fr) auto auto;gap:10px;align-items:center;margin:0;padding:12px 13px;border:1px solid var(--line);border-radius:10px}
.bolillero-check-row legend{float:left;width:auto;padding:0;font-size:11px;font-weight:760}
.bolillero-check-row label{font-size:10px;font-weight:750}
.bolillero-check-form>.primary-action{justify-self:start;margin-top:4px}
.bolillero-history{margin-top:16px}
@media (max-width:1000px){
  .agent-command-card .command-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bolillero-date-grid,.bolillero-auto-checks{grid-template-columns:1fr}
  .bolillero-stage{grid-template-columns:1fr}
  .bolillero-check-row{grid-template-columns:1fr 1fr}
  .bolillero-check-row legend{grid-column:1/-1}
}
@media (prefers-reduced-motion:reduce){
  .bolillero-drum.is-spinning:not(.force-motion),
  .bolillero-drum.is-spinning:not(.force-motion) .bolillero-ball{animation:none}
}


/* CRM activity readability */
.crm-cta-block{
  margin-top:14px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fbfaf7;
}
.crm-cta-block + .crm-cta-block{margin-top:14px}
.crm-cta-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:14px;
}
.crm-cta-head h3{
  margin:4px 0 0;
  font-size:24px;
  line-height:1;
  letter-spacing:-.025em;
}
.crm-cta-summary{
  display:grid;
  grid-template-columns:repeat(2,minmax(110px,1fr));
  gap:8px;
}
.crm-cta-summary>div{
  display:grid;
  gap:3px;
  min-width:110px;
  padding:10px 13px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}
.crm-cta-summary strong{
  font-size:24px;
  line-height:1;
  letter-spacing:-.03em;
}
.crm-cta-summary span{
  color:var(--muted);
  font-size:10px;
  font-weight:760;
}
.crm-cta-table .metrics-table th{
  padding:13px 12px;
  font-size:10px;
}
.crm-cta-table .metrics-table td{
  padding:15px 12px;
  font-size:12px;
}
.crm-cta-table .metrics-table td strong{font-size:12px}
.metrics-detail-card>.muted{
  margin:16px 0 0;
  padding:12px 14px;
  border-radius:9px;
  background:#f4f3ee;
  font-size:11px;
  line-height:1.45;
}

/* Home primary unit action */
.unit-dashboard-footer .unit-open-action{
  width:100%;
  min-height:48px;
  padding:12px 18px;
  justify-content:space-between;
  font-size:12px;
  border-radius:10px;
}
.unit-dashboard-footer .unit-open-action span{
  font-size:16px;
  line-height:1;
}

@media (max-width:760px){
  .crm-cta-head{align-items:flex-start;flex-direction:column}
  .crm-cta-summary{width:100%}
}


/* Library bulk management */
.library-bulk-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:14px 0 12px;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fbfaf7;
}
.library-bulk-toolbar>div:first-child{display:grid;gap:3px}
.library-bulk-toolbar>div:first-child strong{font-size:12px}
.library-bulk-toolbar>div:first-child span{color:var(--muted);font-size:10px}
.library-bulk-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.library-bulk-actions form{margin:0}
.library-card-manageable{position:relative}
.library-select-control{
  position:absolute;
  z-index:3;
  top:9px;
  left:9px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 8px;
  border-radius:999px;
  background:rgba(16,35,27,.9);
  color:#fff;
  font-size:9px;
  font-weight:800;
  cursor:pointer;
  backdrop-filter:blur(8px);
}
.library-select-control input{margin:0}
.library-select-control:has(input:checked){
  background:var(--pucara);
  color:#302807;
}
@media (max-width:760px){
  .library-bulk-toolbar{align-items:stretch;flex-direction:column}
  .library-bulk-actions{display:grid;grid-template-columns:1fr}
  .library-bulk-actions>*,
  .library-bulk-actions button{width:100%}
}
