* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #d9e2ec;
    --border-soft: #e6edf4;
    --text: #172033;
    --muted: #667085;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --warn: #b45309;
    --warn-soft: #fff7ed;
    --success: #047857;
    --success-soft: #ecfdf3;
    --shadow: 0 10px 24px rgb(15 23 42 / 8%);
    --shadow-strong: 0 22px 72px rgb(15 23 42 / 24%);
}

:root[data-theme="green"] {
    --bg: #f2f8f5;
    --surface: #ffffff;
    --surface-soft: #f6fbf8;
    --border: #cfe1d6;
    --border-soft: #e1ece5;
    --text: #10251b;
    --muted: #5d7468;
    --primary: #0f766e;
    --primary-hover: #0b5f59;
    --primary-soft: #ecfdf5;
    --warn: #a16207;
    --warn-soft: #fefce8;
}

:root[data-theme="dark"] {
    --bg: #111827;
    --surface: #1f2937;
    --surface-soft: #253244;
    --border: #374151;
    --border-soft: #303b4c;
    --text: #e5e7eb;
    --muted: #a7b0bf;
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --primary-soft: #172554;
    --danger: #f87171;
    --danger-soft: #3f1f24;
    --warn: #fbbf24;
    --warn-soft: #3b2f17;
    --success: #34d399;
    --success-soft: #12382b;
    --shadow: 0 18px 44px rgb(0 0 0 / 35%);
    --shadow-strong: 0 28px 80px rgb(0 0 0 / 48%);
}

:root[data-theme="rose"] {
    --bg: #fbf7f7;
    --surface: #ffffff;
    --surface-soft: #fff8f7;
    --border: #ead7d3;
    --border-soft: #f0e2df;
    --text: #2d1f21;
    --muted: #806a6d;
    --primary: #be123c;
    --primary-hover: #9f1239;
    --primary-soft: #fff1f2;
    --warn: #b45309;
    --warn-soft: #fff7ed;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.page {
    width: min(1360px, calc(100% - 24px));
    margin: 20px auto;
}

.admin-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 18px 14px;
    box-shadow: var(--shadow);
    z-index: 60;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 6px 8px 14px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 12px;
}

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand strong {
    font-size: 18px;
}

.sidebar-brand span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.sidebar-nav {
    display: grid;
    gap: 5px;
}

.sidebar-nav a,
.sidebar-footer a {
    display: block;
    border-radius: 7px;
    padding: 10px 11px;
    color: var(--text);
    font-size: 14px;
}

.inline-logout-form {
    margin: 0;
}

.inline-logout-form button {
    width: 100%;
}

.sidebar-footer .inline-logout-form button {
    display: block;
    border: 0;
    border-radius: 7px;
    padding: 10px 11px;
    min-height: 0;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    text-align: left;
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.sidebar-footer .inline-logout-form button:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-soft);
    padding-top: 12px;
    display: grid;
    gap: 4px;
}

.page-with-sidebar {
    width: auto;
    max-width: none;
    margin: 0 0 0 248px;
    padding: 20px 20px 28px;
}

.sidebar-toggle {
    display: none;
    min-width: 40px;
    width: 40px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
}

.sidebar-backdrop {
    display: none;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: 0;
}

.topbar-title h1 {
    margin: 0;
}

.topbar p,
.muted {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.topbar nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar nav a,
.topbar nav .inline-logout-form button,
.button-link,
button {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    padding: 9px 13px;
    font-size: 14px;
    cursor: pointer;
    min-height: 40px;
    white-space: nowrap;
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.topbar nav a {
    background: var(--surface);
    color: var(--primary);
}

.topbar nav a:hover,
.topbar nav .inline-logout-form button:hover,
.button-link:hover,
button:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
    filter: none;
}

button:disabled,
button:disabled:hover {
    cursor: not-allowed;
    opacity: .65;
    background: var(--muted);
    border-color: var(--muted);
    color: #fff;
}

.site-notice {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin: -4px 0 18px;
    min-width: 0;
}

.notice-marquee {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.notice-label {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    padding: 0 12px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.notice-window {
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

.notice-track {
    display: inline-flex;
    align-items: center;
    gap: 26px;
    min-width: max-content;
    padding: 9px 16px;
    animation: notice-scroll 38s linear infinite;
}

.notice-track:hover {
    animation-play-state: paused;
}

.notice-track-static {
    animation: none;
    width: 100%;
}

.notice-track-static a {
    min-width: 0;
}

.notice-track a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    white-space: nowrap;
}

.notice-track strong {
    color: var(--primary);
    font-size: 14px;
}

.notice-track span {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
    font-size: 13px;
}

.notice-contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
    max-width: 360px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--text);
    overflow-wrap: anywhere;
}

.notice-contact span {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.notice-contact strong {
    min-width: 0;
    font-size: 14px;
    overflow-wrap: anywhere;
}

@keyframes notice-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .notice-track {
        animation: none;
    }
}

.theme-select {
    width: 100px;
    height: 40px;
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 0 8px;
    border-radius: 6px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    min-width: 0;
    max-width: 100%;
}

.auth-panel {
    max-width: 420px;
    margin: 40px auto;
}

h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.grid {
    display: grid;
    gap: 14px;
}

.grid > *,
.stats > *,
.detail-grid > *,
.operation-grid > * {
    min-width: 0;
    max-width: 100%;
}

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

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

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

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

.admin-dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-note {
    margin: -4px 0 14px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    box-shadow: var(--shadow);
}

.stat span,
.kv span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.stat strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.stat.warn strong {
    color: var(--warn);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.badge.success {
    background: var(--success-soft);
    color: var(--success);
}

.badge.danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger);
}

.badge.offline {
    background: var(--surface-soft);
    color: var(--muted);
    border-color: var(--border);
}

.badge.warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.kv {
    margin: 10px 0;
}

.kv strong,
.kv code {
    display: block;
    margin-top: 4px;
    word-break: break-all;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.form {
    display: grid;
    gap: 10px;
}

.form.inline {
    grid-template-columns: repeat(3, minmax(170px, 1fr)) auto;
    align-items: end;
}

.form.inline.compact {
    grid-template-columns: minmax(220px, 1fr) auto;
    width: min(460px, 100%);
}

.form.inline.compact.account-filter-form {
    grid-template-columns: minmax(220px, 1fr) minmax(120px, max-content) minmax(88px, max-content) auto;
    width: min(760px, 100%);
}

.form.inline.compact.card-filter-form {
    grid-template-columns: minmax(150px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) auto;
    width: min(760px, 100%);
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
}

.form.account-form {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    align-items: end;
}

.settings-form {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    align-items: end;
}

.settings-form button {
    grid-column: 1 / -1;
    justify-self: start;
}

.maintenance-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
    gap: 10px;
    align-items: center;
}

.maintenance-actions form {
    margin: 0;
}

.maintenance-actions button {
    width: 100%;
}

.stepper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
}

.step {
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 8px 10px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.step.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

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

.choice-card {
    display: grid;
    gap: 6px;
    min-height: 112px;
    text-align: left;
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    white-space: normal;
}

.choice-card strong,
.choice-card span {
    display: block;
}

.choice-card span {
    color: var(--muted);
    font-size: 13px;
}

.choice-card.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.choice-card:hover {
    color: var(--text);
    background: var(--primary-soft);
}

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

.article-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 14px;
    background: var(--surface);
    min-width: 0;
}

.article-card > div {
    min-width: 0;
}

.article-card h3 {
    margin: 0 0 6px;
    font-size: 17px;
}

.article-card p {
    margin: 8px 0 0;
    overflow-wrap: anywhere;
}

.article-detail .article-content {
    border-top: 1px solid var(--border-soft);
    padding-top: 14px;
    line-height: 1.8;
    overflow-wrap: anywhere;
    white-space: normal;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 18px 0 10px;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre,
.article-content table,
.article-content figure {
    margin: 12px 0;
}

.article-content img,
.article-content video,
.article-content iframe {
    display: block;
    max-width: 100%;
}

.article-content img,
.article-content video {
    height: auto;
    border-radius: 8px;
}

.article-content iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 8px;
    background: var(--surface-soft);
}

.article-content .article-media {
    max-width: 100%;
}

.article-content pre {
    overflow: auto;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 10px;
}

.article-content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
    color: var(--muted);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
}

.article-content th,
.article-content td {
    border: 1px solid var(--border-soft);
    padding: 8px;
    text-align: left;
}

label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 11px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
}

input,
select {
    height: 40px;
}

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

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    accent-color: var(--primary);
}

.inline-edit {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 120px minmax(140px, 220px) auto;
    gap: 8px;
    align-items: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 18px;
}

.operation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.operation-grid > form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 126px;
}

.operation-grid > form > label,
.operation-grid > form > .muted {
    min-height: 64px;
    margin: 0;
}

.operation-grid > form > .muted {
    display: flex;
    align-items: center;
}

.operation-grid > form > button {
    width: 100%;
    margin-top: auto;
}

.operation-grid > .danger-form {
    background: var(--danger-soft);
}

.alert {
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.alert.success {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid var(--border);
}

.alert.error {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid var(--border);
}

.alert.warn {
    background: var(--warn-soft);
    color: var(--warn);
    border: 1px solid var(--border);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
}

.panel > .table-wrap,
.grid > .panel > .table-wrap {
    min-inline-size: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1040px;
}

.compact-table {
    min-width: 760px;
}

.account-table {
    min-width: 1080px;
    table-layout: fixed;
}

.account-table th:first-child,
.account-table td:first-child {
    width: 40%;
}

.account-table th:nth-child(2),
.account-table td:nth-child(2) {
    width: 17%;
}

.account-table th:nth-child(3),
.account-table td:nth-child(3) {
    width: 16%;
}

.account-table th:nth-child(4),
.account-table td:nth-child(4) {
    width: 15%;
}

.account-table th:nth-child(5),
.account-table td:nth-child(5) {
    width: 180px;
}

.grid.two .compact-table {
    min-width: min(640px, 100%);
}

.table-wide {
    min-width: 1280px;
}

.table-xwide {
    min-width: 1680px;
}

th,
td {
    border-bottom: 1px solid var(--border-soft);
    padding: 9px 8px;
    text-align: left;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: normal;
    word-break: keep-all;
    white-space: nowrap;
    min-width: 0;
}

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

tbody tr:hover {
    background: var(--surface-soft);
}

.message-cell {
    min-width: 260px;
    max-width: 360px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.select-col {
    width: 36px;
    min-width: 36px;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
}

.select-col input[type="checkbox"] {
    display: block;
    margin: 0 auto;
}

th {
    color: var(--muted);
    background: var(--surface-soft);
    font-weight: 600;
}

.table-sort-link {
    color: inherit;
    text-decoration: none;
}

.table-sort-link.active {
    color: var(--primary);
}

small {
    color: var(--muted);
}

code {
    background: var(--surface-soft);
    border-radius: 5px;
    padding: 2px 5px;
    display: inline-block;
    max-width: 260px;
    white-space: normal;
    word-break: break-all;
}

.row-warn {
    background: var(--warn-soft);
}

.account-cell,
.status-cell,
.task-cell,
.expires-cell {
    overflow-wrap: normal;
    word-break: keep-all;
}

.account-primary {
    max-width: 100%;
    color: var(--text);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: center;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.account-meta code {
    max-width: 180px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-location span {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-cell small,
.task-cell small,
.expires-cell small {
    display: block;
    margin-top: 5px;
}

.status-cell small:empty {
    display: none;
}

.expires-cell {
    white-space: nowrap;
}

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

td.actions {
    display: table-cell;
    min-width: 200px;
    white-space: nowrap;
}

td.actions > * {
    margin: 0 4px 5px 0;
    vertical-align: top;
}

.actions form {
    display: inline-flex;
    margin: 0;
}

.account-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(54px, 1fr));
    gap: 6px;
    width: 132px;
}

.account-action-grid > *,
.account-action-grid form,
.table-wrap .account-action-grid button,
.table-wrap .account-action-grid .button-link {
    width: 100%;
    margin: 0;
}

.compact-table small,
.compact-table code {
    white-space: nowrap;
    word-break: normal;
}

.compact-table code {
    max-width: none;
}

.small-btn,
button.small-btn {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
}

.table-wrap button,
.table-wrap .button-link,
td.actions button,
td.actions .button-link,
.bulk-bar button,
.dialog-actions button,
.detail-dialog button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
    line-height: 1.2;
    border-radius: 5px;
    min-width: 54px;
    width: auto;
}

button.danger,
.danger {
    background: var(--danger);
    border-color: var(--danger);
}

.danger-form {
    border: 1px solid var(--border);
    background: var(--danger-soft);
    border-radius: 8px;
    padding: 12px;
}

.bulk-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.bulk-bar select {
    max-width: 180px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}

dialog.detail-dialog {
    width: min(900px, calc(100% - 24px));
    max-height: min(82vh, 760px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-strong);
    position: fixed;
    top: 50%;
    left: 50%;
    inset: 50% auto auto 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    margin: 0;
    z-index: 1000;
}

dialog.detail-dialog::backdrop {
    background: rgb(15 23 42 / 45%);
}

.detail-dialog h3,
.detail-dialog h4 {
    margin: 0 0 10px;
}

.detail-dialog pre {
    max-height: 260px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 10px;
}

.dialog-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-dialog .form > button[type="submit"] {
    width: 100%;
    justify-self: stretch;
}

.detail-dialog .dialog-actions form {
    display: inline-flex;
    margin: 0;
}

dialog.detail-dialog form[method="dialog"] {
    margin: 0;
    display: inline-flex;
}

.log-list {
    display: grid;
    gap: 8px;
    max-height: 620px;
    overflow: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.log-item {
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 9px;
    background: var(--surface);
    font-size: 12px;
    line-height: 1.45;
    min-width: 0;
    max-width: 100%;
}

.log-item strong,
.log-item span {
    display: block;
    font-size: 12px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.log-item span {
    color: var(--text);
    margin-top: 4px;
    word-break: break-word;
}

.secret-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.renew-form {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto;
    gap: 6px;
    min-width: 230px;
}

.renew-form input {
    height: 36px;
}

.renew-form button {
    padding: 7px 10px;
    min-height: 36px;
}

.empty {
    color: var(--muted);
    text-align: center;
}

@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-104%);
        transition: transform .18s ease;
        width: min(82vw, 280px);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        border: 0;
        background: rgb(15 23 42 / 42%);
        z-index: 50;
        padding: 0;
        min-height: 0;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .page-with-sidebar {
        width: min(100% - 16px, 100%);
        margin: 12px auto;
        padding: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .topbar {
        display: block;
    }

    .admin-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .admin-topbar .topbar-title {
        flex: 1;
        min-width: 0;
    }

    .topbar nav {
        margin-top: 12px;
        justify-content: flex-start;
    }

    .admin-topbar nav {
        margin-top: 0;
    }

    .site-notice {
        display: grid;
        gap: 8px;
        margin: -2px 0 12px;
    }

    .notice-marquee {
        min-height: 42px;
    }

    .notice-track {
        gap: 18px;
        padding: 8px 12px;
        animation-duration: 28s;
    }

    .notice-track span {
        max-width: 240px;
    }

    .notice-contact {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .section-head {
        display: block;
    }

    .grid.two,
    .stats,
    .stats.two-cols,
    .form.inline,
    .form.inline.compact,
    .inline-edit,
    .operation-grid,
    .renew-form,
    .settings-form,
    .choice-grid {
        grid-template-columns: 1fr;
    }

    .form.inline.compact.account-filter-form {
        grid-template-columns: 1fr;
        width: 100%;
        margin-top: 12px;
    }

    .account-filter-form button {
        width: 100%;
    }

    .settings-form button {
        justify-self: stretch;
    }

    .article-card {
        display: grid;
    }

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

    .bulk-bar,
    .actions,
    .pagination {
        align-items: stretch;
        justify-content: flex-start;
    }

    .page {
        width: min(100% - 16px, 100%);
        margin: 12px auto;
    }

    .panel {
        padding: 12px;
    }

    th,
    td {
        padding: 8px 7px;
        font-size: 12px;
    }

    table {
        min-width: 1040px;
    }

    .compact-table,
    .grid.two .compact-table {
        min-width: 920px;
    }

    .account-table,
    .compact-table.account-table {
        min-width: 1080px;
    }

    .log-item,
    .log-item strong,
    .log-item span {
        font-size: 11px;
    }
}

@media (max-width: 760px) {
    .page .stats.dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .page .admin-dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .admin-dashboard-stats .stat {
        min-width: 0;
        padding: 12px 10px;
    }
}
