/* Inbox-specific styles. Shared utilities come from the Tailwind runtime. */
body {
    background-color: #050505;
}

.tech-panel {
    background: rgba(13, 13, 18, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.clip-edges {
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

@media (max-width: 768px) {
    .tech-panel {
        clip-path: none;
        border-radius: 12px 12px 0 0;
        border-top: 1px solid rgba(0, 240, 255, 0.2);
        border-left: 1px solid rgba(0, 240, 255, 0.2);
        border-right: 1px solid rgba(0, 240, 255, 0.2);
        border-bottom: none;
        min-height: auto;
        background: rgba(13, 13, 18, 0.95);
    }
}

#emailAddress {
    font-family: 'Fira Code', monospace;
    letter-spacing: 0.5px;
}

.email-list-item {
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.email-list-item:hover,
.email-list-item:focus-within {
    background-color: rgba(0, 240, 255, 0.05);
}

.email-list-item:focus-visible {
    outline: 2px solid #00f0ff;
    outline-offset: -2px;
}

#activeEmailView,
#noEmailSelected {
    transition: opacity 0.2s ease;
}

.status-online {
    /* Keep the system indicator steady across browsers and pointer types. */
    display: inline-block;
    flex: 0 0 auto;
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

.countdown {
    display: inline-flex;
    min-height: 1.9rem;
    align-items: center;
    gap: 0.45rem;
    padding: 0.36rem 0.62rem;
    border: 1px solid rgba(159, 250, 255, 0.26);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(5, 5, 5, 0.58));
    color: #d8fdff;
    font: 600 0.72rem/1 'Fira Code', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 5px 16px rgba(0, 0, 0, 0.18);
    transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.countdown::before {
    content: '';
    display: block;
    flex: 0 0 auto;
    width: 0.52rem;
    height: 0.52rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    opacity: 0.9;
}

.countdown[data-countdown-state='active'] {
    border-color: rgba(148, 247, 197, 0.28);
    background: linear-gradient(135deg, rgba(148, 247, 197, 0.1), rgba(5, 5, 5, 0.58));
    color: #d9ffe9;
}

.countdown.warning {
    border-color: rgba(255, 209, 102, 0.52);
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.16), rgba(30, 22, 8, 0.68));
    color: #ffe09a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 5px 16px rgba(255, 209, 102, 0.08);
}

.countdown.expired {
    border-color: rgba(255, 107, 138, 0.5);
    background: linear-gradient(135deg, rgba(255, 107, 138, 0.14), rgba(35, 10, 18, 0.68));
    color: #ffb1c3;
}

.countdown[data-countdown-state='idle'] {
    border-color: rgba(100, 116, 139, 0.32);
    background: rgba(15, 23, 42, 0.42);
    color: #94a3b8;
}

/* Countdown updates its text once per second, but never animates or reflows. */
.countdown,
.countdown::before {
    animation: none !important;
}

.expiry-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem);
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    padding: 0.8rem;
    border: 1px solid rgba(0, 240, 255, 0.22);
    background:
        linear-gradient(135deg, rgba(0, 240, 255, 0.075), transparent 48%),
        rgba(5, 5, 5, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.expiry-control-copy {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.expiry-control-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
}

.expiry-control-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 2.1rem;
    height: 2.1rem;
    place-items: center;
    border: 1px solid rgba(0, 240, 255, 0.34);
    background: rgba(0, 240, 255, 0.08);
    color: #9ffaff;
    font-size: 1rem;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.08);
}

.expiry-control-label {
    display: block;
    overflow: hidden;
    color: rgba(0, 240, 255, 0.88);
    font: 700 0.68rem/1.2 'Fira Code', monospace;
    letter-spacing: 0.09em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.expiry-control-help {
    display: block;
    margin-top: 0.28rem;
    color: #718096;
    font-size: 0.65rem;
    line-height: 1.35;
}

.expiry-current {
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 1.55rem;
    align-items: center;
    border: 1px solid rgba(0, 240, 255, 0.32);
    background: rgba(0, 240, 255, 0.08);
    color: #9ffaff;
    padding: 0.25rem 0.5rem;
    font: 700 0.59rem/1.2 'Fira Code', monospace;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.expiry-controls[data-pending='true'] .expiry-current {
    border-color: rgba(255, 209, 102, 0.5);
    background: rgba(255, 209, 102, 0.09);
    color: #ffd166;
}

.expiry-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    min-width: 0;
}

.expiry-option {
    display: grid;
    min-width: 0;
    min-height: 3.1rem;
    align-content: center;
    justify-items: center;
    gap: 0.06rem;
    border: 1px solid rgba(0, 240, 255, 0.24);
    border-radius: 0;
    background: rgba(13, 13, 18, 0.76);
    color: #82a4ad;
    padding: 0.4rem 0.3rem;
    font-family: 'Fira Code', monospace;
    line-height: 1;
    transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.expiry-option:hover,
.expiry-option:focus-visible {
    border-color: rgba(0, 240, 255, 0.78);
    background: rgba(0, 240, 255, 0.1);
    color: #c8fbff;
}

.expiry-option:focus-visible {
    outline: 2px solid #00f0ff;
    outline-offset: 2px;
}

.expiry-option:active { transform: translateY(1px); }

.expiry-option.is-selected {
    border-color: #00f0ff;
    background: linear-gradient(155deg, rgba(0, 240, 255, 0.24), rgba(0, 240, 255, 0.07));
    color: #fff;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.12), inset 0 0 0 1px rgba(0, 240, 255, 0.12);
}

.expiry-option-days {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.expiry-option-unit {
    color: currentColor;
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.expiry-option-meta {
    color: #63828a;
    font-size: 0.5rem;
    letter-spacing: 0.05em;
}

.expiry-option.is-selected .expiry-option-meta { color: #9ffaff; }

.inbox-expiry {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 240, 255, 0.18);
    background: rgba(0, 240, 255, 0.04);
}

.inbox-expiry strong {
    color: #fff;
    font: 700 0.9rem/1.2 'Fira Code', monospace;
    font-variant-numeric: tabular-nums;
}

.inbox-expiry small {
    color: #64748b;
    font-size: 0.7rem;
}

.private-link-row {
    display: flex;
    gap: 0.35rem;
    min-width: 0;
}

.private-link-input {
    min-width: 0;
    flex: 1;
    background: #050505;
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: #c8fbff;
    padding: 0.65rem 0.75rem;
    font: 500 0.7rem/1.2 'Fira Code', monospace;
    text-overflow: ellipsis;
}

.private-link-button {
    flex: 0 0 auto;
    border: 1px solid #00f0ff;
    background: #00f0ff;
    color: #050505;
    padding: 0.55rem 0.65rem;
    font: 700 0.65rem/1.2 'Fira Code', monospace;
}

.private-link-button.secondary {
    border-color: rgba(255, 0, 60, 0.65);
    background: transparent;
    color: #ff6b8a;
}

.private-link-button:hover { filter: brightness(1.12); }

.private-link-button:focus-visible,
.private-link-input:focus-visible {
    outline: 2px solid #00f0ff;
    outline-offset: 2px;
}

.private-link-button:disabled,
button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.55);
    opacity: 0.55;
}

#syncStatus[data-tone='error'] { color: #ff6b8a; }
#syncStatus[data-tone='loading'] { color: #9ffaff; }
#syncStatus[data-tone='success'] { color: #94f7c5; }

@media (max-width: 640px) {
    .expiry-controls {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .expiry-control-copy {
        align-items: flex-start;
        flex-direction: column;
    }

    .expiry-current { max-width: 100%; white-space: normal; }
    .expiry-picker { width: 100%; }
    .expiry-option { min-height: 3rem; }
    .countdown { font-size: 0.66rem; }
    .private-link-row { flex-wrap: wrap; }
    .private-link-input { flex-basis: 100%; }
    .private-link-button { flex: 1; }
}

@media (max-width: 380px) {
    .expiry-controls { padding: 0.65rem; }
    .expiry-control-heading { gap: 0.5rem; }
    .expiry-control-icon { width: 1.9rem; height: 1.9rem; }
    .expiry-option { padding-right: 0.2rem; padding-left: 0.2rem; }
    .expiry-option-meta { font-size: 0.45rem; }
}

@media (prefers-reduced-motion: reduce) {
    .email-list-item,
    #activeEmailView,
    #noEmailSelected,
    .status-online {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}
