/* Sistem sesizări 544 — negru / alb / gri; accent albastru pe borduri */

:root {
    --s544-bg: #0a0a0a;
    --s544-bg-2: #111111;
    --s544-panel: #141414;
    --s544-line: #2e2e2e;
    --s544-accent: #3b82f6;
    --s544-accent-hot: #60a5fa;
    --s544-orange: #3b82f6; /* compat: fost portocaliu → albastru */
    --s544-orange-hot: #60a5fa;
    --s544-orange-soft: rgba(59, 130, 246, 0.1);
    --s544-text: #ffffff;
    --s544-muted: #9a9a9a;
    --s544-danger: #ff4d4d;
    --s544-success: #3ddc84;
    --s544-warning: #ffb020;
    --s544-font: "Libre Baskerville", "Times New Roman", Times, serif;
    --s544-display: "Libre Baskerville", "Times New Roman", Times, serif;
    --s544-max: 1120px;
    --s544-radius: 14px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.s544-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--s544-font);
    background: var(--s544-bg);
    color: var(--s544-text);
    line-height: 1.55;
    overflow-x: hidden;
}

a {
    color: #ffffff;
}

a:hover {
    color: #d0d0d0;
}

/* —— Brand shell —— */

.s544-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.s544-brandbar {
    border-bottom: 1px solid var(--s544-line);
    background:
        linear-gradient(180deg, #141414 0%, #0a0a0a 100%);
    padding: 22px 20px 18px;
    text-align: center;
    border-radius: 0 0 var(--s544-radius) var(--s544-radius);
}

.s544-brand {
    margin: 0;
    font-family: var(--s544-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 2.75rem);
    letter-spacing: 0.06em;
    text-transform: none;
    font-variant: small-caps;
    color: #fff;
    line-height: 1.1;
}

.s544-brand span {
    color: #ffffff;
}

.s544-tagline {
    margin: 10px 0 0;
    color: var(--s544-muted);
    font-size: 0.95rem;
}

.s544-main {
    flex: 1;
    width: min(var(--s544-max), calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.s544-footer {
    border-top: 1px solid var(--s544-line);
    padding: 18px 20px;
    text-align: center;
    color: var(--s544-muted);
    font-size: 0.85rem;
}

.s544-footer a {
    text-decoration: none;
    font-weight: 600;
}

/* —— Login —— */

.s544-login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    background: var(--s544-bg);
}

.s544-login-card {
    width: min(420px, 100%);
    background: var(--s544-panel);
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
    padding: 32px 28px 28px;
}


.s544-login-card h2 {
    margin: 18px 0 8px;
    font-family: var(--s544-display);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: none;
    font-variant: small-caps;
    color: #fff;
}

.s544-login-card .s544-hint {
    margin-bottom: 18px;
}

/* —— Page chrome —— */

.s544-wrap {
    width: min(var(--s544-max), calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

.s544-card {
    background: var(--s544-panel);
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
    padding: 24px;
}

.s544-topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--s544-line);
}

.s544-topbar h1,
.s544-page-title {
    margin: 0;
    font-family: var(--s544-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    letter-spacing: 0.05em;
    text-transform: none;
    font-variant: small-caps;
    color: #fff;
    line-height: 1.15;
}

.s544-topbar h1 em,
.s544-page-title em {
    font-style: normal;
    color: #ffffff;
}

.s544-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.s544-link-back {
    display: inline-block;
    margin-bottom: 16px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.s544-link-back:hover {
    color: #c8c8c8;
}

.s544-label {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
    font-family: var(--s544-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    text-transform: none;
    font-variant: small-caps;
    color: #ffffff;
}

.s544-hint {
    color: var(--s544-muted);
    font-size: 0.92rem;
    margin: 6px 0 0;
}

body.s544-body input[type="text"],
body.s544-body input[type="password"],
body.s544-body input[type="file"],
body.s544-body input[type="email"],
body.s544-body textarea,
body.s544-body select,
.s544-input,
.s544-textarea,
.s544-select {
    width: 100%;
    max-width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--s544-orange);
    border-radius: var(--s544-radius);
    background: #0d0d0d;
    color: var(--s544-text);
    font: inherit;
    font-size: 16px; /* previne zoom iOS */
}

body.s544-body textarea,
.s544-textarea {
    min-height: 140px;
    resize: vertical;
}

.s544-textarea-lg {
    min-height: 480px;
}

.s544-textarea-xl {
    min-height: 640px;
}

body.s544-body input:focus,
body.s544-body textarea:focus,
body.s544-body select:focus {
    outline: none;
    border-color: var(--s544-accent-hot);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

/* —— Buttons —— */

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

.s544-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 12px;
    text-decoration: none !important;
    font-family: var(--s544-display);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: none;
    font-variant: small-caps;
    line-height: 1.2;
    border: 1px solid var(--s544-orange);
    cursor: pointer;
    color: #ffffff !important;
    background: #161616;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.s544-btn:hover {
    background: #1f1f1f;
    color: #ffffff !important;
    border-color: var(--s544-orange-hot);
}

.s544-btn-primary {
    background: #1a1a1a !important;
    color: #ffffff !important;
    border-color: var(--s544-orange) !important;
}
.s544-btn-muted,
.s544-btn-secondary,
.s544-btn-info,
.s544-btn-purple,
.s544-btn-violet {
    background: transparent !important;
    color: #ffffff !important;
    border-color: var(--s544-orange) !important;
}
.s544-btn-muted:hover,
.s544-btn-secondary:hover,
.s544-btn-info:hover,
.s544-btn-purple:hover,
.s544-btn-violet:hover {
    border-color: var(--s544-orange-hot) !important;
    color: #ffffff !important;
    background: #1a1a1a !important;
}
.s544-btn-success {
    background: #161616 !important;
    color: #ffffff !important;
    border-color: var(--s544-success) !important;
}
.s544-btn-success:hover {
    background: #1a1a1a !important;
    border-color: #5ee9a0 !important;
    color: #ffffff !important;
}
.s544-btn-warning {
    background: #161616 !important;
    color: #ffffff !important;
    border-color: var(--s544-success) !important;
}
.s544-btn-warning:hover {
    background: #1a1a1a !important;
    border-color: #5ee9a0 !important;
    color: #ffffff !important;
}
.s544-btn-danger {
    background: transparent !important;
    color: var(--s544-danger) !important;
    border-color: var(--s544-danger) !important;
}
.s544-btn-danger:hover {
    background: rgba(255, 77, 77, 0.12) !important;
    color: #fff !important;
}

.s544-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 14px;
    background: #111111;
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
}

.s544-flash {
    background: rgba(61, 220, 132, 0.1);
    color: var(--s544-success);
    border: 1px solid rgba(61, 220, 132, 0.35);
    border-radius: var(--s544-radius);
    padding: 12px 16px;
    margin-bottom: 20px;
}

.s544-flash-error {
    background: rgba(255, 77, 77, 0.1);
    color: var(--s544-danger);
    border-color: rgba(255, 77, 77, 0.35);
}

/* —— Table / case list —— */

.s544-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
}

table.s544-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--s544-panel);
}

table.s544-table th,
table.s544-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--s544-line);
    text-align: left;
    vertical-align: top;
}

table.s544-table th {
    background: #161616;
    color: #ffffff;
    font-family: var(--s544-display);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: none;
    font-variant: small-caps;
    font-size: 0.92rem;
}

table.s544-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

table.s544-table td.s544-actions-cell {
    min-width: 300px;
}

.s544-status-draft { color: var(--s544-warning); font-weight: 700; }
.s544-status-trimis { color: var(--s544-success); font-weight: 700; }
.s544-status-arhivat { color: var(--s544-muted); font-weight: 700; }
.s544-status-eroare { color: var(--s544-danger); font-weight: 700; }

.s544-categorie {
    font-weight: 700;
    color: #d0d0d0;
}

.s544-case-title {
    font-weight: 700;
    color: #fff;
}

/* —— Forms extras —— */

.s544-email-box {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
    background: #0d0d0d;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px 8px;
}

.s544-email-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    min-width: 0;
}


.s544-email-row label {
    margin: 0;
    color: #d0d0d0;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: none;
    font-variant: small-caps;
}


.s544-inst-link {
    margin: 0;
    color: var(--s544-accent) !important;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: none;
    font-variant: small-caps;
    text-decoration: none;
    display: inline-block;
}

.s544-inst-link:hover {
    color: var(--s544-accent-hot) !important;
    text-decoration: underline;
}

.s544-cat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.s544-inst-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.s544-inst-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: #0d0d0d;
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
    text-decoration: none !important;
    color: #fff !important;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.s544-inst-card:hover {
    border-color: var(--s544-accent);
    background: #121212;
}

.s544-inst-name {
    font-family: var(--s544-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    color: var(--s544-accent);
}

.s544-inst-meta {
    color: var(--s544-muted);
    font-size: 0.85rem;
}

.s544-email-row input,
.s544-email-row .s544-input,
.s544-email-box .email-institutie {
    padding: 5px 8px !important;
    font-size: 0.72rem !important;
    line-height: 1.2;
    border-radius: 10px !important;
    border: 1px solid var(--s544-orange) !important;
    min-height: 0;
}

.s544-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.s544-check-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--s544-orange);
}

.s544-video-url {
    margin-top: 8px;
    max-width: 520px;
}

.s544-video-url .s544-label {
    margin-top: 8px;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.s544-video-url .s544-input {
    padding: 10px 12px;
}

.s544-readonly {
    white-space: pre-wrap;
    background: #0d0d0d;
    border: 1px solid var(--s544-orange);
    border-radius: var(--s544-radius);
    padding: 14px;
    line-height: 1.55;
    color: var(--s544-muted);
    max-height: 220px;
    overflow: auto;
    font-size: 0.9rem;
}


.s544-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: none;
    font-variant: small-caps;
}

.s544-badge-ok {
    background: rgba(61, 220, 132, 0.12);
    color: var(--s544-success);
    border: 1px solid rgba(61, 220, 132, 0.35);
}

.s544-badge-err {
    background: rgba(255, 77, 77, 0.12);
    color: var(--s544-danger);
    border: 1px solid rgba(255, 77, 77, 0.35);
}

.s544-badge-wait {
    background: rgba(255, 176, 32, 0.1);
    color: var(--s544-warning);
    border: 1px solid rgba(255, 176, 32, 0.3);
}

.s544-login-box {
    width: min(420px, 100%);
}

.s544-preview-panel {
    margin-top: 24px;
    padding: 20px;
    background: #0d0d0d;
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
}


.s544-preview-panel h2 {
    margin-top: 0;
    font-family: var(--s544-display);
    font-weight: 700;
    text-transform: none;
    font-variant: small-caps;
    letter-spacing: 0.05em;
    color: #ffffff;
}

.s544-preview-label {
    font-weight: 700;
    margin-bottom: 8px;
    color: #d0d0d0;
}

.s544-preview-content {
    white-space: pre-wrap;
    background: #080808;
    border: 1px solid var(--s544-orange);
    border-radius: 8px;
    padding: 14px;
    line-height: 1.6;
}

.s544-empty {
    border: 1px dashed var(--s544-line);
    border-radius: var(--s544-radius);
    padding: 28px;
    text-align: center;
    color: var(--s544-muted);
}

.s544-more {
    position: relative;
    display: inline-block;
}

.s544-more > summary {
    list-style: none;
}

.s544-more > summary::-webkit-details-marker {
    display: none;
}

.s544-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 210px;
    background: var(--s544-panel);
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
    padding: 8px;
    z-index: 50;
}

.s544-more[open] .s544-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.s544-menu .s544-btn {
    width: 100%;
    text-align: left;
}

.s544-autosave {
    position: fixed;
    bottom: max(12px, env(safe-area-inset-bottom));
    right: max(12px, env(safe-area-inset-right));
    z-index: 9999;
    max-width: min(280px, calc(100vw - 24px));
    background: #111;
    color: #ffffff;
    padding: 10px 15px;
    font-size: 13px;
    border: 1px solid var(--s544-orange);
    border-radius: 12px;
    font-family: var(--s544-display);
    letter-spacing: 0.04em;
    text-transform: none;
    font-variant: small-caps;
}

/* —— Responsive: tablet —— */

@media (max-width: 1024px) {
    .s544-main,
    .s544-wrap {
        width: min(var(--s544-max), calc(100% - 28px));
    }

    .s544-email-box {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .s544-textarea-lg {
        min-height: 380px;
    }

    .s544-textarea-xl {
        min-height: 500px;
    }
}

@media (max-width: 900px) {
    .s544-email-box {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    table.s544-table td.s544-actions-cell {
        min-width: 240px;
    }

    .s544-toolbar .s544-btn {
        flex: 1 1 calc(50% - 10px);
    }
}

/* —— Responsive: telefon —— */

@media (max-width: 720px) {
    .s544-brandbar {
        padding: 16px 12px 12px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .s544-brand {
        font-size: clamp(1.65rem, 8vw, 2.2rem);
    }

    .s544-tagline {
        font-size: 0.85rem;
        padding: 0 4px;
    }

    .s544-main,
    .s544-wrap {
        width: calc(100% - 20px);
        padding: 16px 0 36px;
        padding-bottom: max(36px, env(safe-area-inset-bottom));
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .s544-card {
        padding: 14px;
    }

    .s544-login-card {
        padding: 24px 18px 20px;
    }

    .s544-topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .s544-topbar-actions {
        width: 100%;
    }

    .s544-topbar-actions .s544-btn {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }

    .s544-toolbar {
        padding: 10px;
        gap: 8px;
    }

    .s544-toolbar .s544-btn {
        flex: 1 1 100%;
        width: 100%;
    }

    .s544-btn {
        text-align: center;
    }

    .s544-actions {
        width: 100%;
    }

    .s544-actions .s544-btn {
        flex: 1 1 calc(50% - 8px);
    }

    .s544-label {
        margin-top: 16px;
        font-size: 0.95rem;
    }

    .s544-textarea-lg {
        min-height: 260px;
    }

    .s544-textarea-xl {
        min-height: 360px;
    }

    .s544-readonly {
        max-height: 160px;
        font-size: 0.85rem;
        padding: 12px;
    }

    .s544-email-box {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .s544-email-row input,
    .s544-email-row .s544-input,
    .s544-email-box .email-institutie {
        padding: 10px 12px !important;
        font-size: 16px !important;
    }

    .s544-email-row label {
        font-size: 0.72rem;
    }

    .s544-check-row {
        align-items: flex-start;
    }

    .s544-check-row input[type="checkbox"] {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .s544-video-url {
        max-width: 100%;
    }

    /* Lista cazuri → carduri pe telefon */
    .s544-table-scroll {
        border: none;
        overflow: visible;
    }

    table.s544-table,
    table.s544-table thead,
    table.s544-table tbody,
    table.s544-table th,
    table.s544-table td,
    table.s544-table tr {
        display: block;
        width: 100%;
    }

    table.s544-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
    }

    table.s544-table tr {
        margin-bottom: 14px;
        padding: 14px;
        background: var(--s544-panel);
        border: 1px solid var(--s544-line);
        border-radius: var(--s544-radius);
    }

    table.s544-table tr:hover {
        background: var(--s544-panel);
    }

    table.s544-table td {
        border: none;
        border-bottom: 1px solid rgba(42, 42, 42, 0.7);
        padding: 10px 0;
        display: flex;
        flex-wrap: wrap;
        gap: 6px 10px;
        align-items: baseline;
        justify-content: space-between;
    }

    table.s544-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
        padding-top: 12px;
    }

    table.s544-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: #d0d0d0;
        font-family: var(--s544-display);
        font-weight: 700;
        font-size: 0.78rem;
        letter-spacing: 0.04em;
        text-transform: none;
        font-variant: small-caps;
    }

    table.s544-table td.s544-actions-cell {
        min-width: 0;
        display: block;
    }

    table.s544-table td.s544-actions-cell::before {
        display: block;
        margin-bottom: 8px;
    }

    table.s544-table .s544-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    table.s544-table .s544-actions .s544-btn {
        flex: none;
        width: 100%;
        font-size: 0.88rem;
        padding: 10px 8px;
    }

    .s544-autosave,
    #status-autosave {
        left: 12px;
        right: 12px;
        bottom: max(10px, env(safe-area-inset-bottom));
        max-width: none;
        text-align: center;
        font-size: 12px;
    }

    .institutie-rand .s544-btn,
    .bara-jos .s544-btn {
        width: 100%;
    }

    .institutie-meta {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 400px) {
    .s544-actions .s544-btn,
    table.s544-table .s544-actions {
        grid-template-columns: 1fr;
    }

    .s544-topbar-actions .s544-btn {
        flex: 1 1 100%;
    }
}

/* —— Landscape telefon / tabletă mică —— */

@media (max-width: 900px) and (orientation: landscape) {
    .s544-textarea-lg {
        min-height: 200px;
    }

    .s544-brandbar {
        padding-top: 10px;
        padding-bottom: 8px;
    }
}

/* —— Mail inbox —— */

.s544-mail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 8px;
}

.s544-mail-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
    color: #d0d0d0 !important;
    text-decoration: none !important;
    font-family: var(--s544-display);
    font-weight: 700;
    font-variant: small-caps;
    letter-spacing: 0.05em;
    background: #0d0d0d;
}

.s544-mail-tab:hover {
    border-color: var(--s544-accent);
    color: #fff !important;
}

.s544-mail-tab.is-active {
    border-color: var(--s544-accent);
    background: rgba(59, 130, 246, 0.15);
    color: #fff !important;
}

.s544-mail-layout {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 18px;
    margin-top: 12px;
    align-items: start;
}

.s544-mail-sidebar {
    background: #0d0d0d;
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
    padding: 12px;
}

.s544-mail-side-title {
    font-family: var(--s544-display);
    font-weight: 700;
    font-variant: small-caps;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    color: #fff;
}

.s544-mail-folders {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 420px;
    overflow: auto;
}

.s544-mail-folder {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: #d0d0d0 !important;
    text-decoration: none !important;
    border: 1px solid transparent;
    word-break: break-word;
}

.s544-mail-folder:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff !important;
}

.s544-mail-folder.is-active {
    border-color: var(--s544-accent);
    background: rgba(59, 130, 246, 0.15);
    color: #fff !important;
    font-weight: 700;
}

.s544-mail-newfolder {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--s544-line);
}

.s544-mail-newfolder .s544-label {
    margin-top: 0;
}

.s544-mail-panel {
    min-width: 0;
}

.s544-mail-move {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.s544-mail-move .s544-select {
    min-width: 120px;
    max-width: 160px;
    padding: 8px 10px;
    font-size: 0.85rem;
}

.s544-mail-move-read {
    margin: 0 0 16px;
}

.s544-mail-sharebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    background: #0d0d0d;
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
}

.s544-mail-checkall {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #d0d0d0;
    margin-right: auto;
}

.s544-mail-check {
    display: flex;
    align-items: center;
    padding-right: 4px;
}

.s544-mail-check input,
.s544-mail-checkall input {
    width: 18px;
    height: 18px;
    accent-color: var(--s544-accent);
}

.s544-mail-shared {
    border-color: rgba(61, 220, 132, 0.45);
}

.s544-mail-from .s544-badge {
    margin-left: 8px;
    vertical-align: middle;
}

.s544-mail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.s544-mail-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
    background: #0d0d0d;
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
}

.s544-mail-unread {
    border-color: var(--s544-accent);
    background: #101820;
}

.s544-mail-main {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none !important;
    color: #fff !important;
    min-width: 0;
}

.s544-mail-from {
    color: var(--s544-accent);
    font-weight: 700;
    font-size: 0.9rem;
    word-break: break-word;
}

.s544-mail-subject {
    color: #fff;
    font-weight: 600;
}

.s544-mail-unread .s544-mail-subject {
    color: #fff;
}

.s544-mail-date {
    color: var(--s544-muted);
    font-size: 0.82rem;
}

.s544-mail-del {
    display: flex;
    align-items: center;
}

.s544-mail-meta {
    margin: 16px 0;
    padding: 14px;
    background: #0d0d0d;
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
    color: var(--s544-muted);
    line-height: 1.7;
}

.s544-mail-atts {
    margin: 0 0 20px;
    padding: 14px;
    background: #0d0d0d;
    border: 1px solid var(--s544-line);
    border-radius: var(--s544-radius);
}

.s544-mail-atts-title {
    font-family: var(--s544-display);
    font-weight: 700;
    font-variant: small-caps;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    color: #fff;
}

.s544-mail-att-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.s544-mail-att {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--s544-line);
    border-radius: 10px;
    background: #121212;
}

.s544-mail-att-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.s544-mail-att-info a {
    color: var(--s544-accent-hot) !important;
    font-weight: 700;
    text-decoration: none !important;
    word-break: break-word;
}

.s544-mail-att-name {
    color: #fff;
    font-weight: 700;
    word-break: break-word;
}

.s544-mail-att-meta {
    color: var(--s544-muted);
    font-size: 0.82rem;
}

.s544-mail-att-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.s544-mail-att-preview {
    display: block;
    margin-top: 4px;
}

.s544-mail-att-preview img {
    display: block;
    max-width: min(100%, 420px);
    max-height: 280px;
    width: auto;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--s544-line);
    background: #000;
}

.s544-mail-body {
    margin-top: 10px;
    padding: 16px;
    background: #0d0d0d;
    border: 1px solid var(--s544-accent);
    border-radius: var(--s544-radius);
    overflow-x: auto;
    line-height: 1.55;
    color: #ddd;
}

.s544-mail-body pre {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    font-family: inherit;
    color: inherit;
}

@media (max-width: 720px) {
    .s544-mail-del {
        width: 100%;
    }

    .s544-mail-del .s544-btn {
        width: 100%;
    }

    .s544-mail-layout {
        grid-template-columns: 1fr;
    }

    .s544-mail-folders {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: none;
    }

    .s544-mail-folder {
        font-size: 0.9rem;
    }

    .s544-mail-move {
        width: 100%;
    }

    .s544-mail-move .s544-select {
        flex: 1 1 auto;
        max-width: none;
    }
}

