:root {
    color-scheme: light;
    --progress-fill-green: linear-gradient(135deg, #2fb344, #62d26f);
    --bg: #f3efe6;
    --bg-start: #fbf8f2;
    --bg-glow-a: rgba(182, 77, 40, 0.17);
    --bg-glow-b: rgba(47, 108, 78, 0.12);
    --surface: rgba(255, 251, 244, 0.9);
    --surface-strong: #fffaf2;
    --surface-soft: rgba(255, 252, 247, 0.8);
    --ink: #1e1a15;
    --muted: #6d6255;
    --line: rgba(75, 54, 28, 0.12);
    --field-border: rgba(75, 54, 28, 0.18);
    --accent-soft: rgba(182, 77, 40, 0.12);
    --accent: #b64d28;
    --accent-dark: #8a3418;
    --danger: #b42318;
    --ok: #2d6a4f;
    --button-dark: #3b332a;
    --log-bg: #15110d;
    --log-ink: #f6efe4;
    --barcode-bg: #ffffff;
    --shadow: 0 24px 60px rgba(87, 62, 22, 0.12);
    --radius: 24px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101512;
    --bg-start: #171d18;
    --bg-glow-a: rgba(47, 179, 68, 0.13);
    --bg-glow-b: rgba(230, 126, 74, 0.08);
    --surface: rgba(24, 31, 27, 0.92);
    --surface-strong: #202821;
    --surface-soft: rgba(28, 36, 31, 0.82);
    --ink: #f2f5ee;
    --muted: #aab6aa;
    --line: rgba(218, 230, 214, 0.13);
    --field-border: rgba(218, 230, 214, 0.18);
    --accent-soft: rgba(76, 201, 104, 0.14);
    --accent: #62d26f;
    --accent-dark: #a4eba9;
    --danger: #ff8b7f;
    --ok: #7dff9b;
    --button-dark: #3b463d;
    --log-bg: #080c0a;
    --log-ink: #eaf8ef;
    --barcode-bg: #ffffff;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, var(--bg-glow-a), transparent 28%),
        radial-gradient(circle at top right, var(--bg-glow-b), transparent 22%),
        linear-gradient(180deg, var(--bg-start) 0%, var(--bg) 100%);
    min-height: 100vh;
}

code {
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    background: var(--accent-soft);
}

.shell {
    width: min(1220px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.hero,
.layout {
    display: grid;
    gap: 1.5rem;
}

.hero {
    grid-template-columns: 1.6fr 1fr;
    margin-bottom: 1.5rem;
}

.layout {
    grid-template-columns: 1.15fr 0.85fr;
    margin-bottom: 1.5rem;
}

.hero-copy,
.hero-card,
.panel,
.result-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.hero-copy,
.hero-card,
.panel {
    padding: 1.75rem;
}

.eyebrow {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

h1,
h2,
h3,
h4 {
    margin-top: 0;
    font-weight: 800;
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    line-height: 1;
    margin-bottom: 1rem;
}

ul {
    padding-left: 1.2rem;
}

.analyzer-form {
    display: grid;
    gap: 1rem;
}

.analyzer-form label {
    display: grid;
    gap: 0.45rem;
    font-weight: 700;
}

.analyzer-form input[type="file"],
.analyzer-form input[type="text"],
.analyzer-form input[type="password"],
.analyzer-form input[type="email"],
.analyzer-form input[type="number"],
.analyzer-form select {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--field-border);
    border-radius: 16px;
    background: var(--surface-strong);
    color: var(--ink);
}

.analyzer-form button {
    width: fit-content;
    padding: 0.9rem 1.2rem;
    border: 0;
    border-radius: 999px;
    background: var(--progress-fill-green);
    color: white;
    font-weight: 800;
    box-shadow: 0 18px 28px rgba(182, 77, 40, 0.24);
    cursor: pointer;
}

.button-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.9rem 1.2rem;
    border-radius: 999px;
    background: var(--progress-fill-green);
    color: white;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 18px 28px rgba(182, 77, 40, 0.24);
}

.member-admin-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    margin: 1rem 0;
    background: var(--surface-soft);
}

.google-login-button {
    background: #ffffff;
    color: #1f1f1f;
    border: 1px solid var(--field-border);
    box-shadow: var(--shadow);
}

.google-login-button.is-disabled {
    opacity: 0.55;
}

.login-action-row {
    align-items: center;
}

.button-link-dark {
    background: var(--button-dark);
    box-shadow: none;
}

.form-row,
.action-row {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.form-row label {
    flex: 1 1 220px;
}

.checks {
    align-items: center;
}

.check {
    display: inline-flex !important;
    align-items: center;
    gap: 0.55rem;
}

.check input {
    width: auto;
}

.action-row button {
    flex: 0 0 auto;
}

.lookup-card {
    margin-bottom: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--field-border);
    border-radius: 18px;
    background: var(--accent-soft);
}

.lookup-card h3 {
    margin-top: 0;
}

.lookup-result-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

.lookup-result-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.8rem;
}

.lookup-result-item {
    padding: 0.85rem;
    border: 1px solid var(--field-border);
    border-radius: 16px;
    background: var(--surface-soft);
}

.lookup-use-btn {
    margin-top: 0.75rem;
}

.status.error {
    color: var(--danger);
    font-weight: 700;
}

.muted.error {
    color: var(--danger);
    font-weight: 800;
}

.summary,
.muted {
    color: var(--muted);
}

.result-card {
    margin-top: 1.2rem;
    padding: 1.4rem;
    background: var(--surface);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0 0;
}

.result-grid div {
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: var(--accent-soft);
}

.result-grid dt {
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.result-grid dd {
    margin: 0;
    font-weight: 700;
}

.matched {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.9rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
}

th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.warning-panel {
    border-color: rgba(182, 77, 40, 0.22);
}

.agent-ok {
    color: var(--ok);
    font-weight: 800;
}

.compact-table table th,
.compact-table table td {
    font-size: 0.88rem;
}

.serial-log {
    min-height: 220px;
    max-height: 360px;
    overflow: auto;
    padding: 1rem;
    border-radius: 12px;
    background: var(--log-bg);
    color: var(--log-ink);
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.serial-log-large {
    min-height: 62vh;
    max-height: 72vh;
}

.log-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.log-toolbar h2,
.log-toolbar p {
    margin-bottom: 0;
}

.log-toolbar button {
    width: fit-content;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--button-dark);
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.serial-log-toolbar {
    align-items: center;
}

.webserial-hero {
    grid-template-columns: 1.25fr 0.75fr;
}

.flash-progress-card {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--field-border);
    border-radius: 18px;
    background: var(--accent-soft);
}

.flash-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
    font-weight: 800;
}

.flash-progress-track {
    width: 100%;
    height: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.flash-progress-fill {
    display: block;
    min-width: 0;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--progress-fill-green);
    transition: width 0.18s linear;
    position: relative;
    overflow: hidden;
}

.flash-progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: translateX(-100%);
    animation: flash-progress-shine 1.25s linear infinite;
}

@keyframes flash-progress-shine {
    100% {
        transform: translateX(100%);
    }
}

.flash-result-ok {
    border-color: rgba(45, 106, 79, 0.22);
}

.flash-result-error {
    border-color: rgba(180, 35, 24, 0.28);
}

.analyzer-form button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

body.critical-operation-active button:not(.theme-toggle),
body.critical-operation-active input,
body.critical-operation-active select,
body.critical-operation-active textarea,
body.critical-operation-active a[href]:not(.theme-toggle),
body.critical-operation-active [role="button"]:not(.theme-toggle) {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.35);
}

body.critical-operation-active .theme-toggle {
    opacity: 1 !important;
    cursor: pointer !important;
    filter: none !important;
}

@media (max-width: 960px) {
    .hero,
    .layout,
    .result-grid,
    .live-grid {
        grid-template-columns: 1fr;
    }
}


.live-data-card {
    display: grid;
    gap: 1rem;
}

.live-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.live-summary-grid div {
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--accent-soft);
}

.live-summary-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.live-summary-grid strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.35rem;
}

.live-data-wrap {
    max-height: 520px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.live-data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-strong);
}

.live-data-table td:nth-child(1) {
    width: 52px;
    color: var(--muted);
    font-weight: 800;
}

.live-data-table td:nth-child(3) {
    width: 150px;
    font-weight: 800;
}

.live-data-table td:nth-child(4) {
    width: 90px;
    color: var(--muted);
}

@media (max-width: 960px) {
    .live-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

















.live-data-card {
    border: 1px solid rgba(75, 54, 28, 0.16);
}

.live-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.live-summary-grid div {
    min-height: 96px;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(45, 106, 79, 0.22);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(14, 20, 18, 0.96), rgba(31, 38, 34, 0.96));
    color: #eaf8ef;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.live-summary-grid span {
    display: block;
    color: #9bc7aa;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.live-summary-grid strong {
    display: block;
    margin-top: 0.45rem;
    font-family: Consolas, "Courier New", monospace;
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    line-height: 1;
    letter-spacing: 0;
    color: #7dff9b;
    text-shadow: 0 0 18px rgba(125, 255, 155, 0.34);
    white-space: nowrap;
}

.live-data-table td:nth-child(3) {
    font-family: Consolas, "Courier New", monospace;
    font-weight: 800;
    color: var(--ok);
}

.live-data-wrap {
    border-radius: 12px;
    background: var(--surface-soft);
}

@media (max-width: 960px) {
    .live-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


.digital-live-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.digital-live-grid div:first-child {
    grid-column: span 2;
}

@media (max-width: 960px) {
    .digital-live-grid,
    .live-summary-grid.digital-live-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .digital-live-grid div:first-child {
        grid-column: span 2;
    }
}


.live-page-layout {
    grid-template-columns: minmax(0, 1fr);
}

.live-page-panel {
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
}

.live-page-info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.live-data-card-main {
    margin-top: 1.25rem;
}

@media (max-width: 960px) {
    .live-page-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


.live-tabs {
    display: flex;
    gap: 0;
    margin-bottom: -1px;
}

.live-tab {
    padding: 0.35rem 0.7rem;
    border: 1px solid #9fa7b0;
    background: #eceff3;
    font-size: 0.88rem;
    color: #1e1a15;
}

.live-tab.active {
    background: #f8fafc;
    border-bottom-color: #f8fafc;
}

.live-meter-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    padding: 0.85rem;
    border: 1px solid #a8b6c7;
    background: #eef2f7;
}

.live-meter-box {
    min-width: 0;
    margin: 0;
    padding: 0.78rem 0.8rem 0.68rem;
    border: 1px solid #a8a8a8;
    background: #f2f2f2;
}

.live-meter-wide {
    grid-column: span 1;
}

.live-meter-box legend {
    padding: 0 0.45rem;
    color: #6aa0e8;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.live-meter-box strong {
    display: grid;
    place-items: center;
    min-height: 66px;
    width: 100%;
    border: 3px solid #2d3340;
    background: #080c13;
    color: #72ff8f;
    font-family: Consolas, "Courier New", monospace;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    line-height: 1;
    letter-spacing: 0;
    text-shadow: 0 0 14px rgba(114, 255, 143, 0.42);
    box-shadow: inset 0 0 0 1px #aeb6c0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 960px) {
    .live-meter-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .live-meter-board {
        grid-template-columns: 1fr;
    }
}


.security-page-layout {
    grid-template-columns: minmax(0, 1fr);
}

.security-page-panel {
    width: min(980px, 100%);
    margin: 0 auto;
}

.security-form {
    margin-top: 1rem;
}

.security-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.security-password-field,
.security-file-field {
    grid-column: span 2;
}

.security-download {
    margin: 1rem 0;
}

.smartkey-layout {
    grid-template-columns: minmax(0, 1fr);
}

.smartkey-panel {
    width: min(980px, 100%);
    margin: 0 auto;
}

.smartkey-panel dd {
    margin: 0;
    font-weight: 800;
}

.smartkey-rom-panel {
    margin-top: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-soft);
}

.smartkey-rom-panel h3 {
    margin-bottom: 0.85rem;
}

.smartkey-log-panel {
    margin-top: 1.25rem;
}

.smartkey-serial-log {
    display: block;
    width: 100%;
    min-height: 260px;
    max-height: 420px;
    resize: vertical;
    border: 1px solid var(--field-border);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.smartkey-log-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.smartkey-log-actions button {
    width: auto;
    min-width: 92px;
}

.smartkey-barcode-card {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--barcode-bg);
}

.smartkey-barcode-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
    color: #1e1a15;
}

.smartkey-barcode-head span {
    font-family: Consolas, "Courier New", monospace;
    font-weight: 800;
}

.smartkey-barcode-svg {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
    margin: 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .live-tab {
    border-color: #41504a;
    background: #202821;
    color: var(--ink);
}

html[data-theme="dark"] .live-tab.active {
    background: #2b342d;
    border-bottom-color: #2b342d;
}

html[data-theme="dark"] .live-meter-board {
    border-color: #405047;
    background: #151c18;
}

html[data-theme="dark"] .live-meter-box {
    border-color: #45534c;
    background: #202821;
}

.theme-toggle,
.language-toggle,
.logout-float {
    position: fixed;
    right: 1rem;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.68rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.theme-toggle {
    bottom: 1rem;
}

.language-toggle {
    bottom: 4.6rem;
}

.logout-float {
    top: 1rem;
    text-decoration: none;
}

.member-badge.logout-float {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.42rem;
    max-width: min(430px, calc(100vw - 2rem));
    min-width: 190px;
    min-height: 70px;
    padding: 0.95rem 1.1rem;
    border-radius: 20px;
    cursor: default;
}

.member-badge-main {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.02rem;
    font-weight: 900;
}

.member-badge-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.member-badge-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.member-badge-logout,
.member-badge-admin,
.member-badge-activate {
    color: var(--accent-dark);
    font-size: 0.86rem;
    font-weight: 900;
    text-decoration: none;
}

.member-badge-admin {
    color: var(--ok);
}

.member-badge-activate {
    color: var(--progress-fill-green);
}

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

.security-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.security-table th,
.security-table td {
    border-bottom: 1px solid var(--line);
    padding: 0.72rem 0.55rem;
    text-align: left;
    vertical-align: top;
}

.security-table th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.security-table form {
    margin: 0;
}

.security-table button {
    border: 0;
    border-radius: 999px;
    padding: 0.5rem 0.8rem;
    background: var(--progress-fill-green);
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.security-link {
    color: var(--accent-dark);
    font-weight: 800;
    text-decoration: none;
}

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

.security-risk-high,
.security-table tr.security-risk-high td {
    color: var(--danger);
    font-weight: 900;
}

.security-risk-warn,
.security-table tr.security-risk-warn td {
    color: #c77700;
    font-weight: 800;
}

.security-table tr.security-risk-high {
    background: rgba(180, 35, 24, 0.10);
}

.security-table tr.security-risk-warn {
    background: rgba(199, 119, 0, 0.08);
}

.security-user-group {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    margin: 1rem 0;
    background: var(--surface-soft);
}

.security-user-suspect {
    border-color: rgba(180, 35, 24, 0.35);
    background: rgba(180, 35, 24, 0.08);
}

.security-user-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.7rem;
}

.security-user-head h4 {
    margin: 0;
}

.payment-card {
    border-color: rgba(47, 191, 83, 0.35);
}

.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.payment-summary-grid > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.9rem;
    background: var(--surface-soft);
}

.payment-summary-grid strong {
    display: block;
    color: var(--accent-dark);
    font-size: 1.45rem;
    line-height: 1;
}

.payment-summary-grid span {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.payment-permission-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 1rem 0;
}

.payment-chip {
    border-radius: 999px;
    padding: 0.45rem 0.72rem;
    font-size: 0.86rem;
    font-weight: 800;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.payment-chip-ok {
    color: var(--ok);
    border-color: rgba(47, 191, 83, 0.35);
}

.payment-chip-lock {
    color: var(--danger);
    border-color: rgba(180, 35, 24, 0.35);
}

.payment-status-approved {
    color: var(--ok);
    font-weight: 900;
}

.payment-status-rejected {
    color: var(--danger);
    font-weight: 900;
}

.payment-status-pending {
    color: #c77700;
    font-weight: 900;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.library-upload-form {
    margin-top: 3rem;
}

.security-table button.library-review-toggle {
    background: transparent;
    color: var(--text);
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    text-align: left;
}

.security-table button.library-review-toggle .muted {
    color: #fff;
}

.security-table button.library-review-toggle:not(:disabled) {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.security-table button.library-review-toggle:disabled {
    opacity: 1;
}

.library-review-panel {
    display: grid;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--accent-soft);
}

.library-review-panel h4,
.library-review-item p {
    margin: 0;
}

.library-review-item {
    display: grid;
    gap: 0.28rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.library-review-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.theme-toggle-icon,
.language-toggle-icon {
    width: 1.1rem;
    text-align: center;
    font-size: 1rem;
    line-height: 1;
}

.language-toggle-icon {
    width: auto;
    min-width: 3.2rem;
}

.theme-toggle:focus-visible,
.language-toggle:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .theme-toggle,
    .language-toggle,
    .logout-float {
        right: 0.75rem;
        padding: 0.65rem 0.78rem;
    }

    .theme-toggle {
        bottom: 0.75rem;
    }

    .language-toggle {
        bottom: 4.2rem;
    }

    .logout-float {
        top: 0.75rem;
    }
}

@media (max-width: 720px) {
    .security-grid {
        grid-template-columns: 1fr;
    }

    .security-password-field,
    .security-file-field {
        grid-column: span 1;
    }
}
