/* Container */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
    height: calc(100vh - 60px); /* Full height minus header */
    display: flex;
    flex-direction: column;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-card.highlight {
    background: var(--primary-light);
    border-color: var(--primary-blue);
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}
.stat-card.highlight .stat-value { color: var(--primary-blue); }

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 4px;
}

/* Editor Area */
.editor-wrapper {
    flex: 1; /* Fills remaining space */
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}

.editor-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-body);
}

.editor-header .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.editor-actions {
    display: flex;
    gap: 12px;
}

.action-link {
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-blue);
    cursor: pointer;
}

.action-link.danger { color: #ef4444; }

textarea {
    flex: 1;
    width: 100%;
    border: none;
    resize: none;
    padding: 16px;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-main);
    background: var(--bg-surface);
    outline: none;
    line-height: 1.6;
}

/* Detailed List */
.details-list {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}
.detail-row:last-child { border-bottom: none; }
.detail-row span:last-child {
    color: var(--text-main);
    font-weight: 600;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Common Toast & Modal Styles */
.toast {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: white; padding: 10px 20px; border-radius: 30px;
    font-size: 0.9rem; z-index: 1000; animation: slideUp 0.3s;
}
@keyframes slideUp { from {opacity:0; transform:translate(-50%,20px);} to {opacity:1; transform:translate(-50%,0);} }
.hidden { display: none; }
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px);
}
.modal-content {
    background: var(--bg-surface); width: 100%; max-width: 400px;
    border-radius: var(--radius-lg); padding: 24px;
}
.modal-header { display: flex; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { color: var(--text-main); }
.modal-body p { color: var(--text-muted); margin-bottom: 8px; font-size: 0.9rem; }