:root {
    --ink: #122126;
    --paper: #f3efe5;
    --cream: #fffaf0;
    --coral: #ee6c4d;
    --coral-dark: #bf422b;
    --teal: #1f6f78;
    --teal-soft: #d8ece9;
    --line: rgba(18, 33, 38, 0.14);
    --muted: #67767a;
    --shadow: 0 28px 80px rgba(18, 33, 38, 0.14);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: "Aptos", "Segoe UI Variable", sans-serif;
    background:
        linear-gradient(rgba(18, 33, 38, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 33, 38, 0.035) 1px, transparent 1px),
        var(--paper);
    background-size: 32px 32px;
    overflow-x: hidden;
}

button, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.ambient {
    position: fixed;
    z-index: 0;
    border-radius: 999px;
    filter: blur(2px);
    pointer-events: none;
}

.ambient-one {
    width: 460px;
    height: 460px;
    right: -180px;
    top: 80px;
    background: radial-gradient(circle, rgba(238, 108, 77, 0.24), rgba(238, 108, 77, 0));
}

.ambient-two {
    width: 520px;
    height: 520px;
    left: -250px;
    bottom: -140px;
    background: radial-gradient(circle, rgba(31, 111, 120, 0.19), rgba(31, 111, 120, 0));
}

.public-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 36px;
}

.public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 34px;
}

.brand {
    display: inline-flex;
    gap: 13px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 14px 4px 14px 4px;
    color: white;
    background: var(--ink);
    font-family: Georgia, serif;
    font-weight: 700;
}

.brand strong { display: block; font-size: 18px; letter-spacing: 0.04em; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: 0.18em; }

.privacy-chip, .live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 250, 240, 0.65);
    font-size: 13px;
}

.privacy-chip span, .live-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #39a96b;
    box-shadow: 0 0 0 5px rgba(57, 169, 107, 0.12);
}

.hero-card {
    display: grid;
    grid-template-columns: 1.28fr 0.72fr;
    min-height: 610px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 34px 8px 34px 8px;
    background: rgba(255, 250, 240, 0.82);
    box-shadow: var(--shadow);
    animation: rise 0.65s ease-out both;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(42px, 7vw, 92px);
    background:
        radial-gradient(circle at 85% 15%, rgba(238, 108, 77, 0.19), transparent 33%),
        linear-gradient(135deg, rgba(255,255,255,0.65), transparent);
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--teal);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2em;
}

.hero-copy h1 {
    max-width: 750px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(48px, 6vw, 82px);
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.hero-copy h1 em { color: var(--coral); font-weight: 400; }

.hero-description {
    max-width: 570px;
    margin: 30px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
}

.create-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px;
    color: white;
    background: var(--ink);
}

.step-number {
    position: absolute;
    right: 28px;
    top: 22px;
    color: rgba(255,255,255,0.14);
    font-family: Georgia, serif;
    font-size: 88px;
}

.create-panel label { margin-bottom: 12px; font-size: 14px; color: rgba(255,255,255,0.7); }

.domain-control {
    display: flex;
    align-items: center;
    min-width: 0;
    border-bottom: 1px solid rgba(255,255,255,0.28);
    margin-bottom: 26px;
}

.domain-control span { color: var(--coral); font-family: Georgia, serif; font-size: 30px; }

.domain-control select {
    min-width: 0;
    width: 100%;
    padding: 18px 10px;
    border: 0;
    outline: 0;
    color: white;
    background: transparent;
    font-size: clamp(18px, 2vw, 24px);
}

.domain-control option { color: var(--ink); background: white; }

.primary-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 20px;
    border: 0;
    border-radius: 4px 16px 4px 16px;
    color: white;
    background: var(--coral);
    font-weight: 800;
    transition: transform 0.2s, background 0.2s;
}

.primary-button:hover:not(:disabled) { transform: translateY(-2px); background: #f07b60; }
.primary-button:disabled { cursor: wait; opacity: 0.48; }
.primary-button b { font-size: 24px; }
.form-hint { margin: 18px 0 0; color: rgba(255,255,255,0.48); font-size: 12px; line-height: 1.6; }

.mailbox-workspace { animation: rise 0.55s ease-out both; }

.mailbox-topline {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin: 46px 0 30px;
}

.address-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.address-line h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(27px, 4vw, 52px); font-weight: 400; overflow-wrap: anywhere; }

.icon-button, .text-button, .danger-button, .code-panel button {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--cream);
    color: var(--ink);
    padding: 10px 15px;
}

.timer-card {
    --progress: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 286px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 20px 5px 20px 5px;
    background: rgba(255,250,240,0.72);
}

.timer-ring {
    display: grid;
    flex: 0 0 66px;
    height: 66px;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--coral) calc(var(--progress) * 1turn), rgba(18,33,38,0.1) 0);
    position: relative;
}

.timer-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--paper); }
.timer-ring span { position: relative; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer-card small, .timer-card strong { display: block; }
.timer-card small { color: var(--muted); margin-bottom: 4px; }
.timer-card strong { font-size: 14px; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr); gap: 22px; }
.inbox-card, .message-detail {
    min-height: 560px;
    border: 1px solid var(--line);
    background: rgba(255,250,240,0.78);
    box-shadow: 0 18px 50px rgba(18,33,38,0.08);
}
.inbox-card { border-radius: 28px 6px 6px 6px; overflow: hidden; }
.message-detail { border-radius: 6px 6px 28px 6px; overflow: hidden; }

.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 26px; border-bottom: 1px solid var(--line); }
.section-heading .eyebrow { margin-bottom: 8px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 30px; font-weight: 400; }
.section-heading h2 span { color: var(--coral); }
.live-indicator { background: var(--teal-soft); color: var(--teal); border-color: transparent; }

.empty-inbox, .detail-placeholder { display: grid; place-items: center; align-content: center; min-height: 430px; padding: 36px; text-align: center; color: var(--muted); }
.empty-inbox h3, .detail-placeholder h3 { margin: 22px 0 7px; color: var(--ink); font-family: Georgia, serif; font-size: 24px; font-weight: 400; }
.empty-inbox p, .detail-placeholder p { max-width: 330px; line-height: 1.65; }
.radar { display: grid; width: 100px; height: 100px; place-items: center; border: 1px solid rgba(31,111,120,0.35); border-radius: 50%; animation: pulse 2.2s infinite; }
.radar::before { content: ""; width: 58px; height: 58px; border: 1px solid rgba(31,111,120,0.25); border-radius: 50%; }
.radar i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.detail-placeholder span { color: rgba(18,33,38,0.13); font-family: Georgia, serif; font-size: 92px; }

.message-list { display: grid; }
.message-item { display: grid; grid-template-columns: 1fr auto; gap: 10px 18px; width: 100%; padding: 20px 24px; border: 0; border-bottom: 1px solid var(--line); text-align: left; color: var(--ink); background: transparent; transition: background 0.2s; }
.message-item:hover, .message-item.active { background: white; }
.message-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-item time { color: var(--muted); font-size: 12px; }
.message-item p { grid-column: 1 / -1; margin: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.message-code { align-self: start; padding: 5px 8px; border-radius: 6px; color: var(--coral-dark); background: rgba(238,108,77,0.12); font-family: ui-monospace, monospace; font-weight: 900; letter-spacing: 0.1em; }

.detail-header { padding: 26px; border-bottom: 1px solid var(--line); }
.detail-header .text-button { float: right; }
.detail-sender { margin: 16px 0 8px; color: var(--teal); font-size: 13px; overflow-wrap: anywhere; }
.detail-header h2 { margin: 0 0 10px; font-family: Georgia, serif; font-size: clamp(25px, 3vw, 36px); font-weight: 400; }
.detail-header time { color: var(--muted); font-size: 12px; }
.code-panel { display: grid; grid-template-columns: 1fr auto; gap: 5px 20px; align-items: center; margin: 20px 24px 0; padding: 18px; border: 1px solid rgba(238,108,77,0.28); border-radius: 18px 5px 18px 5px; background: rgba(238,108,77,0.09); }
.code-panel span { color: var(--coral-dark); font-size: 12px; }
.code-panel strong { grid-row: 2; color: var(--ink); font-family: ui-monospace, monospace; font-size: 28px; letter-spacing: 0.16em; }
.code-panel button { grid-row: 1 / 3; grid-column: 2; background: white; }
#messageFrame { width: 100%; min-height: 390px; border: 0; background: white; margin-top: 18px; }

.mailbox-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 4px; color: var(--muted); font-size: 13px; }
.danger-button { color: var(--coral-dark); border-color: rgba(191,66,43,0.32); background: transparent; }
.danger-button:hover { color: white; background: var(--coral-dark); }

.expired-card { max-width: 720px; margin: 100px auto; padding: 64px; border: 1px solid var(--line); border-radius: 34px 8px 34px 8px; text-align: center; background: var(--cream); box-shadow: var(--shadow); }
.expired-card h2 { margin: 0 0 16px; font-family: Georgia, serif; font-size: 44px; font-weight: 400; }
.expired-card p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.expired-card .primary-button { width: min(300px, 100%); margin: 30px auto 0; justify-content: center; }

.public-footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 4px 0; color: var(--muted); font-size: 12px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 999px; color: white; background: var(--ink); opacity: 0; pointer-events: none; transition: 0.25s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(31,111,120,0.08); } 50% { box-shadow: 0 0 0 20px rgba(31,111,120,0); } }

@media (max-width: 900px) {
    .hero-card { grid-template-columns: 1fr; }
    .hero-copy { min-height: 430px; }
    .create-panel { min-height: 330px; }
    .workspace-grid { grid-template-columns: 1fr; }
    .message-detail { min-height: 480px; border-radius: 6px 6px 28px 6px; }
}

@media (max-width: 640px) {
    .public-shell { width: min(100% - 24px, 1180px); padding-top: 18px; }
    .public-header { margin-bottom: 20px; }
    .privacy-chip { padding: 8px; font-size: 0; }
    .hero-card { min-height: auto; border-radius: 24px 6px 24px 6px; }
    .hero-copy { min-height: 390px; padding: 34px 24px; }
    .hero-copy h1 { font-size: 46px; }
    .hero-description { font-size: 15px; }
    .create-panel { min-height: 310px; padding: 34px 24px; }
    .mailbox-topline { align-items: stretch; flex-direction: column; margin-top: 34px; }
    .timer-card { min-width: 0; }
    .section-heading { align-items: flex-start; }
    .live-indicator { font-size: 0; padding: 10px; }
    .inbox-card, .message-detail { min-height: 480px; }
    .code-panel { grid-template-columns: 1fr; }
    .code-panel button { grid-row: auto; grid-column: auto; }
    .mailbox-footer, .public-footer { align-items: stretch; flex-direction: column; }
    .expired-card { padding: 44px 24px; margin: 60px auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
