* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 18px 14px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

h1 { margin: 0; font-size: 28px; }
h2 { font-size: 20px; }

header p { margin: 4px 0 0; color: #6b7280; }

.card {
    background: white;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hidden { display: none !important; }

.status {
    padding: 7px 12px;
    border-radius: 999px;
    background: #e5e7eb;
    font-weight: 600;
    font-size: 12px;
}

.input-row { display: flex; gap: 10px; margin-top: 8px; }

input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
}

button {
    border: none;
    border-radius: 7px;
    padding: 10px 14px;
    background: #111827;
    color: white;
    cursor: pointer;
    font-weight: 600;
}

button:hover { opacity: 0.9; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.readiness-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.readiness-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.taskmaster-action { display: inline-flex; align-items: center; gap: 5px; }

.info-icon {
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #111827;
    font-size: 12px;
    font-weight: 800;
}

.info-popover {
    margin-top: 10px;
    padding: 11px 13px;
    border-left: 4px solid #111827;
    border-radius: 7px;
    background: #f3f4f6;
    line-height: 1.45;
    font-size: 13px;
}

.info-popover p { margin: 5px 0 0; color: #4b5563; }

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.section-heading h2,
.taskmaster-header h2 { margin: 0; }

.section-subtitle { margin: 4px 0 0; color: #6b7280; font-size: 13px; }

/* The explanatory card is redundant in the judge flow; the i-button and Agent Activity carry the explanation. */
#taskmaster-card { display: none !important; }

.taskmaster-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 9px 11px;
    border-radius: 7px;
    background: #f3f4f6;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.taskmaster-flow span:nth-child(even) { color: #9ca3af; }

.activity-step {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.activity-step:last-child { border-bottom: none; }

.activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    font-weight: bold;
    font-size: 13px;
    background: #e5e7eb;
}

.activity-content { flex: 1; min-width: 0; }

.activity-title {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
}

.activity-status {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    font-weight: 700;
}

.activity-detail { margin-top: 3px; color: #6b7280; line-height: 1.35; font-size: 12px; }

.activity-completed .activity-icon { background: #dcfce7; color: #166534; }
.activity-autonomous .activity-icon { background: #fef3c7; color: #92400e; }
.activity-warning .activity-icon { background: #fee2e2; color: #991b1b; }
.activity-pending .activity-icon { background: #e0e7ff; color: #3730a3; }
.activity-completed .activity-status { color: #166534; }
.activity-autonomous .activity-status { color: #92400e; }
.activity-warning .activity-status { color: #991b1b; }
.activity-pending .activity-status { color: #3730a3; }

.issue {
    border-left: 4px solid #dc2626;
    padding: 9px 12px;
    margin: 7px 0;
    background: #fef2f2;
    font-size: 13px;
}

.issue p { margin: 6px 0 0; }

.approval-box {
    background: #f3f4f6;
    padding: 10px 12px;
    margin: 9px 0;
    border-radius: 7px;
    display: grid;
    gap: 4px;
}

#escalation-timer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

#escalation-countdown {
    font-size: 24px;
    font-weight: 800;
    color: #9a3412;
    min-width: 52px;
}

#notification-log { margin-top: 4px; }
#results { padding-top: 14px; padding-bottom: 14px; }

code {
    display: block;
    margin-top: 4px;
    font-weight: bold;
    overflow-wrap: anywhere;
    font-size: 12px;
}

.technology-footer {
    text-align: center;
    padding: 7px 0 2px;
    color: #6b7280;
    font-size: 11px;
    letter-spacing: 0.02em;
}

.technology-footer span { font-weight: 600; color: #4b5563; }

@media (max-width: 700px) {
    .container { padding: 16px 12px 10px; }
    .readiness-header { flex-direction: column; align-items: flex-start; }
    .readiness-summary { justify-content: flex-start; }
    .activity-title { flex-direction: column; align-items: flex-start; gap: 4px; }
    .input-row { flex-direction: column; }
}
