body {
    padding: 24px;
    display: none;
}

.container {
    max-width: 880px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    color: var(--transcend-blue);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.back-link:hover {
    text-decoration: underline;
}

.page-title {
    margin-bottom: 20px;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 720px;
}

.tool-brief {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 24px;
}

.tool-brief > div {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    min-width: 0;
}

.brief-label {
    display: block;
    color: var(--transcend-blue);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.7px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.tool-brief strong {
    display: block;
    font-size: 0.82rem;
    line-height: 1.35;
}

.security-note {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--transcend-blue);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0 0 24px;
    padding: 14px 16px;
}

.security-note strong {
    color: var(--text-primary);
}

.status-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-badge.enabled {
    background: #dcfce7;
    color: var(--metric-green);
    border: 1px solid var(--metric-green);
}

.status-badge.awaiting {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.status-badge.in-progress {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.progress {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.progress h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0 0 14px 0;
}

.progress ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.progress li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.95rem;
}

.progress li .icon {
    font-size: 1.1rem;
    width: 1.4rem;
    text-align: center;
}

.progress li.done {
    color: var(--metric-green);
}

.progress li.pending {
    color: var(--text-primary);
}

.section {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    overflow: hidden;
}

.section.locked {
    opacity: 0.6;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    background: #fafbfc;
    border-bottom: 1px solid transparent;
    user-select: none;
}

.section.expanded .section-header {
    border-bottom-color: var(--border-color);
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header .chevron {
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.section.expanded .section-header .chevron {
    transform: rotate(90deg);
}

.section-body {
    padding: 20px 24px;
    display: none;
}

.section.expanded .section-body {
    display: block;
}

.section-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.section-status {
    font-size: 0.8rem;
    font-weight: 500;
}

.section-status.done {
    color: var(--metric-green);
}

.section-status.pending {
    color: #92400e;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    margin-top: 14px;
}

input[type="text"],
input[type="password"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--transcend-blue);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.15);
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    margin: 0;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.field-row {
    display: flex;
    gap: 12px;
}

.field-row > div {
    flex: 1;
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.state-copy {
    margin: 20px 0;
    color: var(--text-secondary);
}

.timezone-other {
    margin-top: 8px;
}

.dry-run-sent {
    margin-top: 12px;
}

.dry-run-approve-block {
    margin-top: 24px;
}

.btn-primary {
    background: var(--transcend-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 16px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--transcend-blue-dark, #1e4278);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--transcend-blue);
    border: 1px solid var(--transcend-blue);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    margin-right: 10px;
}

.btn-secondary:hover:not(:disabled) {
    background: #f0f5fc;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    max-width: 360px;
}

#toast.show {
    opacity: 1;
    transform: translateY(0);
}

#toast.success {
    background: var(--metric-green);
}

#toast.error {
    background: var(--danger-red, #dc2626);
}

.banner {
    background: #ecfdf5;
    border: 1px solid var(--metric-green);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
    color: #065f46;
}

.banner h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #065f46;
}

.banner p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.allowlist-deny {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
}

.allowlist-deny h2 {
    margin-top: 0;
}

.debug-footer {
    margin-top: 32px;
    padding: 16px 24px;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.debug-footer dt {
    font-weight: 600;
    display: inline;
}

.debug-footer dd {
    display: inline;
    margin-left: 6px;
    margin-right: 14px;
}

.debug-footer dl {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.loading-state,
.auth-required,
.access-denied {
    text-align: center;
    padding: 60px 20px;
}

.hidden {
    display: none !important;
}

.field-error {
    color: var(--danger-red, #dc2626);
    font-size: 0.85rem;
    margin-top: 6px;
}

.section-error {
    background: #fee2e2;
    border: 1px solid #dc2626;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 12px;
}

.footer-note {
    margin-top: 8px;
}

@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .page-title h1 {
        font-size: 1.7rem;
    }

    .tool-brief {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .field-row {
        flex-direction: column;
    }

    #toast {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

@media (max-width: 520px) {
    .tool-brief {
        grid-template-columns: 1fr;
    }

    .section-header {
        align-items: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }

    .section-header h2 {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .section-body,
    .progress,
    .banner,
    .debug-footer {
        padding: 16px;
    }
}
