.ai-list-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 16px;
}

.ai-list-status {
    margin-bottom: 16px;
    color: #888;
    font-size: 1rem;
}

.ai-list-title {
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a237e;
}

/* Title header row layout */
.ai-list-header-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 16px;
}

/* Controls row (buttons + toggle) */
.ai-list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* Left-side button group */
.ai-list-buttons {
    display: flex;
    gap: 8px;
}

/* Right-side toggle label */
.ai-list-toggle label {
    font-size: 14px;
}

/* Checkbox spacing in toggle */
.ai-list-toggle input[type="checkbox"] {
    vertical-align: middle;
    margin-right: 4px;
}

#ai-list-table-wrapper {
    overflow-x: auto;
    margin-bottom: 28px;
}

.ai-list-table {
    width: 100%;
    border-collapse: collapse;
    background: #fafbfc;
    box-shadow: 0 1px 4px rgba(20,40,120,0.07);
    border-radius: 7px;
    overflow: hidden;
}

.ai-list-table th,
.ai-list-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e0e4ec;
    text-align: left;
    font-size: 1rem;
}

.ai-list-table th {
    background: #f3f5fa;
    color: #26325b;
    font-weight: 700;
}

.ai-list-table tr:last-child td {
    border-bottom: none;
}

.ai-list-table th:last-child,
.ai-list-table td:last-child {
    text-align: center;
}

/* Explicit action column width */
.ai-list-table th.action-col {
    width: 120px;
}

.ai-list-table td .ai-preview-link {
    color: #2d437b;
    text-decoration: underline;
    cursor: pointer;
}

/* Icon button (emoji-only) */
.icon-btn,
.ai-list-table .icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.1em;
    padding: 3px 7px;
    cursor: pointer;
    margin: 0 1px;
    outline: none;
    color: #37447a;
    transition: background 0.18s, color 0.18s;
    border-radius: 4px;
    vertical-align: middle;
    line-height: 1;
}

.icon-btn:hover, .icon-btn:focus {
    background: #f0f4ff;
    color: #1a237e;
}

/* Optional: style <a> for edit as button */
.ai-list-table .icon-btn.edit-btn {
    text-decoration: none;
    color: inherit;
}

/* Remove any old .button styles in actions column */
.ai-list-table td .button {
    display: none !important;
}

/* Custom tooltip on emoji icon buttons */
.icon-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: 50%;
    bottom: 110%;
    transform: translateX(-50%);
    background: #23272f;
    color: #fff;
    padding: 3px 11px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.88em;
    font-weight: 400;
    z-index: 22;
    pointer-events: none;
    transition: opacity 0.16s;
    box-shadow: 0 3px 10px rgba(24,30,60,0.14);
}

.icon-btn:hover .icon-tooltip,
.icon-btn:focus .icon-tooltip {
    visibility: visible;
    opacity: 1;
}

.icon-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -7px;
    border-width: 7px;
    border-style: solid;
    border-color: #23272f transparent transparent transparent;
}

/* For last row in table: always show tooltip above the button */
.ai-list-table tr:last-child .icon-tooltip {
    bottom: 110%;
}

/* Table preview area separation */
#ai-list-preview {
    border-top: 1.5px solid #e0e0e0;
    margin-top: 28px;
    padding-top: 22px;
}

/* Hide preview panel */
.ai-list-preview.hidden {
    display: none;
}

/* Resume/Edit button spacing in preview */
.resume-btn {
    margin-top: 10px;
    display: inline-block;
}

.ai-list-search-toggle {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ai-list-search input {
    padding: 4px 8px;
    height: 36px;
    font-size: 13px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-sizing: border-box;
}

button.button.ai-table-btn {
    padding: 6px 12px;
    height: 36px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    background: #f3f5fa;
    color: #1a237e;
    border: 1px solid #ccd0d4;
    cursor: pointer;
    box-shadow: 0 1px 0 #ccd0d4;
    line-height: 1.2;
    text-align: center;
    transition: background-color 0.15s ease;
}

button.button.ai-table-btn:hover,
button.button.ai-table-btn:focus {
    background-color: #e2e6f0;
    color: #000;
}

.ai-pagination {
    margin-top: 12px;
    text-align: center;
    font-size: 0; /* remove whitespace between inline-block elements */
}

.pagination-btn {
    background: #f1f1f1;
    border: 1px solid #ccd0d4;
    padding: 4px 8px;       /* reduced padding */
    margin: 0 2px;          /* tighter spacing between buttons */
    font-size: 10px;
    cursor: pointer;
    border-radius: 3px;
    vertical-align: middle;
}

.pagination-btn.current {
    background: #1a237e;
    color: #fff;
    font-weight: bold;
}

.pagination-ellipsis {
    display: inline-block;
    padding: 0 3px;
    color: #888;
    font-size: 10px;
    vertical-align: middle;
}

.pagination-jump {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    gap: 4px;
    vertical-align: middle;
}

#pagination-jump-input {
    width: 38px;
    padding: 2px 4px;
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
}


/* Responsive mobile styles */
@media (max-width: 600px) {
    .ai-list-table th, .ai-list-table td {
        font-size: 0.92em;
        padding: 9px 4px;
    }
    #ai-list-preview {
        margin-top: 16px;
        padding-top: 13px;
    }
    .icon-tooltip {
        font-size: 0.92em;
        max-width: 140px;
        white-space: normal;
        text-align: center;
    }
}
