:root {
    color-scheme: light;
    --background: #f3f6fa;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #dfe6ee;
    --text: #1f2937;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16803c;
    --danger: #c62828;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

.container {
    width: min(1500px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.detail-container {
    max-width: 1000px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    color: #172554;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.25;
}

.page-header p {
    margin: 7px 0 0;
    color: var(--muted);
}

.account-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.account-identity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-name {
    color: #334155;
    font-weight: 700;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 750;
}

.role-admin {
    background: #fee2e2;
    color: #991b1b;
}

.role-manager {
    background: #dbeafe;
    color: #1e40af;
}

.role-editor {
    background: #dcfce7;
    color: #166534;
}

.logout-form {
    margin: 0;
}

.btn-secondary {
    display: inline-block;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: var(--surface);
    color: #334155;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.4;
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.panel {
    margin-bottom: 24px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel h2 {
    margin: 0;
    font-size: 1.2rem;
}

.message {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.message-hidden {
    display: none;
}

.message-content {
    display: grid;
    gap: 2px;
}

.message-content strong {
    font-size: 0.92rem;
}

.message-content span,
.message-content li {
    font-weight: 500;
}

.message-close {
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: currentColor;
    font-size: 1.35rem;
    line-height: 1;
    opacity: 0.65;
}

.message-close:hover {
    opacity: 1;
}

.message-success {
    border-color: #86d39c;
    background: #ecfdf3;
    color: var(--success);
}

.message-error {
    border-color: #f0a8a8;
    background: #fff1f1;
    color: var(--danger);
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    min-height: 116px;
    padding: 20px;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stat-value {
    color: #172554;
    font-size: 2rem;
    font-weight: 750;
    line-height: 1.2;
}

.stat-label {
    margin-top: 6px;
    color: var(--muted);
}

.import-section {
    display: block;
}

.import-section p {
    margin: 4px 0 0;
    color: var(--muted);
}

.import-section-heading {
    margin-bottom: 18px;
}

.import-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.import-option {
    display: grid;
    align-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
}

.import-option h3 {
    margin: 0;
    color: #334155;
    font-size: 1rem;
}

.import-form {
    display: flex;
    min-width: 0;
    gap: 10px;
}

.import-form select,
.import-form input[type="file"] {
    min-width: 0;
    padding: 10px 12px;
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: var(--surface);
}

.import-form input[type="file"] {
    padding: 7px 9px;
    color: #475569;
}

.import-form input[type="file"]::file-selector-button {
    margin-right: 9px;
    padding: 4px 8px;
    border: 0;
    border-radius: 5px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 650;
}

.btn-primary,
.inline-form button {
    display: inline-block;
    padding: 9px 14px;
    border: 0;
    border-radius: 7px;
    background: var(--primary);
    color: white;
    font-weight: 650;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading span {
    color: var(--muted);
}

.section-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.create-topic-container {
    max-width: 1000px;
}

.password-container {
    max-width: 680px;
}

.password-panel {
    padding: 28px;
}

.password-intro {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.password-intro p {
    margin: 5px 0 0;
    color: var(--muted);
}

.password-form {
    display: grid;
    gap: 18px;
}

.password-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.create-topic-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.create-topic-intro p {
    margin: 5px 0 0;
    color: var(--muted);
}

.creation-status {
    padding: 5px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.create-topic-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-field {
    display: grid;
    min-width: 0;
    gap: 6px;
}

.form-field-wide,
.form-field-full {
    grid-column: 1 / -1;
}

.form-field label {
    color: #334155;
    font-size: 0.88rem;
    font-weight: 750;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
}

.form-field textarea {
    min-height: 96px;
    line-height: 1.5;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(37, 99, 235, 0.12);
}

.required-marker {
    color: var(--danger);
}

.create-topic-actions {
    display: flex;
    grid-column: 1 / -1;
    gap: 10px;
    margin-top: 4px;
}

.metadata-field {
    align-content: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-muted);
    color: #475569;
}

.metadata-label {
    font-size: 0.78rem;
    font-weight: 750;
    text-transform: uppercase;
}

.error-list {
    margin: 0;
    padding-left: 20px;
}

.search-filter-form {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) repeat(5, minmax(140px, 1fr)) auto;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    align-items: end;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
}

.filter-field {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.filter-field label {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 750;
}

.filter-field input,
.filter-field select {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
}

.filter-field input:focus,
.filter-field select:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(37, 99, 235, 0.12);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.bulk-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 9px;
    background: #fff7f7;
    color: #7f1d1d;
}

.bulk-action-bar .btn-danger:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.selection-column {
    width: 46px;
    min-width: 46px;
    text-align: center !important;
}

.selection-column input {
    width: 17px;
    height: 17px;
    accent-color: var(--danger);
}

.topics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.topics-table th,
.topics-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.topics-table th {
    background: var(--surface-muted);
    color: #475569;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.topics-table tbody tr:hover {
    background: #f8fbff;
}

.topics-table tbody tr:last-child td {
    border-bottom: 0;
}

.datetime-cell {
    min-width: 130px;
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    min-width: 36px;
    height: 36px;
    padding: 0 11px;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: var(--surface);
    color: #334155;
    font-size: 0.85rem;
    font-weight: 650;
    text-decoration: none;
}

a.pagination-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-current {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.pagination-disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.pagination-summary {
    color: var(--muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.topic-title {
    min-width: 260px;
    max-width: 480px;
    font-weight: 650;
}

.topic-title-link {
    color: #1d4ed8;
    font-weight: inherit;
    text-decoration: none;
}

.topic-title-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.priority {
    display: inline-block;
    min-width: 38px;
    padding: 3px 9px;
    border-radius: 999px;
    color: white;
    font-size: 0.78rem;
    font-weight: 750;
    text-align: center;
}

.priority-p1 {
    background: #dc2626;
}

.priority-p2 {
    background: #ea580c;
}

.priority-p3 {
    background: #2563eb;
}

.priority-default {
    background: #64748b;
}

.language-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}

.language-unknown {
    background: #e2e8f0;
    color: #475569;
}

.inline-form {
    display: flex;
    min-width: 185px;
    gap: 6px;
}

.inline-form input,
.inline-form select {
    width: 118px;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: var(--surface);
}

.inline-form button {
    padding: 7px 10px;
    background: #16a34a;
    font-size: 0.82rem;
}

.inline-form button:hover {
    background: #15803d;
}

.readonly-value {
    display: inline-block;
    min-width: 110px;
    color: #475569;
}

.status-select,
.status-badge {
    min-width: 116px;
    padding: 7px 9px;
    border: 1px solid;
    border-radius: 6px;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

.status-unassigned {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #475569;
}

.status-assigned {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #1e40af;
}

.status-in_progress {
    border-color: #fbbf24;
    background: #fef3c7;
    color: #92400e;
}

.status-completed {
    border-color: #86efac;
    background: #dcfce7;
    color: #166534;
}

.status-select:focus {
    outline: 3px solid rgba(37, 99, 235, 0.16);
    outline-offset: 1px;
}

.actions-column,
.actions {
    position: sticky;
    right: 0;
    width: 176px;
    min-width: 176px;
    max-width: 176px;
    border-left: 1px solid var(--border);
    background: var(--surface);
    box-shadow: -8px 0 12px rgba(15, 23, 42, 0.05);
}

.actions-column {
    z-index: 3;
    background: var(--surface-muted) !important;
}

.actions {
    z-index: 2;
}

.topics-table tbody tr:hover .actions {
    background: #f8fbff;
}

.action-buttons {
    display: grid;
    gap: 6px;
}

.action-buttons .btn-view,
.action-buttons .btn-edit,
.action-buttons .btn-export,
.action-buttons .btn-delete {
    width: 100%;
    margin: 0;
    text-align: center;
}

.btn-view,
.btn-edit,
.btn-export,
.btn-delete,
.back-button {
    display: inline-block;
    padding: 7px 12px;
    border: 0;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 650;
    line-height: 1.4;
    transition: background 0.2s ease;
}

.btn-view {
    background: #0284c7;
}

.btn-view:hover {
    background: #0369a1;
}

.btn-edit {
    background: #2563eb;
}

.btn-edit:hover {
    background: #1d4ed8;
}

.btn-export {
    background: #7c3aed;
}

.btn-export:hover {
    background: #6d28d9;
}

.btn-delete {
    background: var(--danger);
}

.btn-delete:hover {
    background: #b91c1c;
}

.delete-topic-form {
    margin: 0;
}

.back-button {
    background: #475569;
}

.back-button:hover {
    background: #334155;
}

.empty-state {
    padding: 48px 20px !important;
    color: var(--muted);
    text-align: center !important;
}

.detail-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.detail-heading h2 {
    font-size: 1.55rem;
    line-height: 1.35;
}

.detail-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.detail-title-row h2 {
    flex: 1;
    min-width: 0;
}

.detail-heading .priority {
    margin-top: 4px;
    flex: none;
}

.detail-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    border-bottom: 1px solid var(--border);
}

.detail-label,
.detail-content {
    padding: 14px 12px;
}

.detail-label {
    background: var(--surface-muted);
    color: #475569;
    font-weight: 700;
}

.detail-content {
    overflow-wrap: anywhere;
    white-space: normal;
}

.detail-code {
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.detail-value-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.detail-value-text {
    flex: 1;
    min-width: 0;
}

.copy-btn {
    flex: none;
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
}

.copy-btn:hover {
    border-color: #94a3b8;
    background: #eef2ff;
    color: #1d4ed8;
}

.copy-btn:disabled {
    opacity: 0.72;
    cursor: wait;
}

.copy-btn-success {
    border-color: #86efac;
    background: #ecfdf5;
    color: #047857;
}

.copy-url-btn {
    font-size: 0.82rem;
}

.copy-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    padding: 10px 14px;
    border: 1px solid #86efac;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.86rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.copy-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.error-panel {
    text-align: center;
}

.error-panel h2 {
    margin-bottom: 20px;
    color: var(--danger);
}

.modal-open {
    overflow: hidden;
}

.confirmation-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    padding: 20px;
    place-items: center;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
}

.confirmation-overlay[hidden] {
    display: none;
}

.confirmation-dialog {
    width: min(100%, 480px);
    padding: 28px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    text-align: center;
}

.confirmation-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 50%;
    background: #fee2e2;
    color: var(--danger);
    font-size: 1.5rem;
    font-weight: 800;
}

.confirmation-dialog h2 {
    margin: 0;
    color: #7f1d1d;
    font-size: 1.35rem;
}

.confirmation-dialog p {
    margin: 10px 0 22px;
    color: #475569;
}

.confirmation-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
}

.auth-card {
    width: min(100%, 440px);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-brand {
    margin-bottom: 24px;
}

.auth-kicker {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-brand h1 {
    margin: 6px 0 4px;
    color: #172554;
    font-size: 2rem;
}

.auth-brand p {
    margin: 0;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 9px;
}

.login-form label {
    margin-top: 4px;
    color: #334155;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
}

.login-form input:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(37, 99, 235, 0.12);
}

.login-form .btn-primary {
    margin-top: 10px;
}

.guest-link {
    display: block;
    margin-top: 18px;
    color: #475569;
    text-align: center;
}

.settings-container {
    max-width: 1120px;
}

.settings-alert:empty {
    display: none;
}

.settings-form {
    display: grid;
    gap: 0;
}

.settings-section {
    overflow: visible;
}

.settings-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.settings-section-heading p,
.settings-save-bar p,
.settings-empty-note {
    margin: 5px 0 0;
    color: var(--muted);
}

.maintenance-section {
    border-color: #fecaca;
}

.maintenance-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fff7f7;
}

.maintenance-action strong {
    color: #7f1d1d;
}

.maintenance-action p {
    margin: 4px 0 0;
    color: #64748b;
}

.maintenance-action .btn-danger {
    flex: none;
}

.maintenance-action .btn-danger:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-grid-language {
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 2fr);
}

.settings-narrow-field {
    max-width: 520px;
}

.settings-manager-list {
    display: grid;
    gap: 12px;
}

.settings-manager-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-muted);
}

.settings-empty-note {
    padding: 14px 0 2px;
}

.password-input-group {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.password-input-group input {
    min-width: 0;
    flex: 1;
}

.password-input-group .toggle-password {
    min-width: 68px;
    flex: none;
}

.btn-danger {
    padding: 10px 14px;
    border: 0;
    border-radius: 7px;
    background: var(--danger);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.btn-danger:hover {
    background: #b91c1c;
}

.settings-section textarea {
    min-height: 220px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
}

.settings-section small {
    color: var(--muted);
}

.settings-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.settings-save-bar p {
    margin: 0;
}

@media (max-width: 1100px) {
    .import-options {
        grid-template-columns: 1fr;
    }

    .topics-table {
        min-width: 1500px;
    }

    .search-filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .filter-search {
        grid-column: span 2;
    }

    .settings-grid-language {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        width: min(100% - 24px, 1500px);
        padding-top: 22px;
    }

    .actions-column,
    .actions {
        width: 148px;
        min-width: 148px;
        max-width: 148px;
    }

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

    .panel {
        padding: 18px;
    }

    .page-header {
        flex-direction: column;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-heading-actions {
        width: 100%;
        justify-content: space-between;
    }

    .account-bar {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .import-form {
        flex-direction: column;
    }

    .search-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-search,
    .filter-actions {
        grid-column: span 2;
    }

    .pagination-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-row {
        grid-template-columns: 1fr;
    }

    .detail-label {
        padding-bottom: 5px;
        background: transparent;
    }

    .detail-content {
        padding-top: 0;
    }

    .create-topic-intro {
        flex-direction: column;
    }

    .create-topic-form {
        grid-template-columns: 1fr;
    }

    .settings-section-heading,
    .settings-save-bar,
    .maintenance-action {
        align-items: stretch;
        flex-direction: column;
    }

    .maintenance-action .btn-danger {
        width: 100%;
    }

    .bulk-action-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .bulk-action-bar .btn-danger {
        width: 100%;
    }

    .settings-grid,
    .settings-manager-row {
        grid-template-columns: 1fr;
    }

    .settings-manager-row .btn-danger {
        justify-self: start;
    }

    .form-field-wide,
    .form-field-full,
    .create-topic-actions {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    .stats-panel {
        grid-template-columns: 1fr;
    }

    .search-filter-form {
        grid-template-columns: 1fr;
    }

    .filter-search,
    .filter-actions {
        grid-column: auto;
    }

    .filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-actions .btn-primary,
    .filter-actions .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .detail-heading {
        flex-direction: column;
    }

    .detail-title-row,
    .detail-value-row {
        flex-direction: column;
        align-items: stretch;
    }

    .copy-btn {
        align-self: flex-start;
    }

    .detail-actions {
        flex-wrap: wrap;
    }

    .section-heading-actions,
    .create-topic-actions,
    .password-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .confirmation-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .section-heading-actions .btn-primary,
    .create-topic-actions .btn-primary,
    .create-topic-actions .btn-secondary,
    .password-actions .btn-primary,
    .password-actions .btn-secondary {
        width: 100%;
        text-align: center;
    }
}
