*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0f;
    --surface: #16161e;
    --surface-2: #1e1e2a;
    --border: #2a2a3a;
    --text: #e8e8ed;
    --text-muted: #8e8e9e;
    --accent: #007aff;
    --accent-hover: #0062cc;
    --green: #34c759;
    --red: #ff3b30;
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Header ── */
.site-header {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent);
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.header-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

@media (max-width: 600px) {
    .header-left {
        flex-wrap: wrap;
    }
    .header-subtitle {
        width: 100%;
        margin-top: -20px;
    }
}

.main-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 18px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav-link.active {
    color: #fff;
    background: var(--accent);
}

/* ── App Layout ── */
.app-layout {
    display: grid;
    grid-template-columns: 280px 320px 1fr;
    gap: 24px;
    padding-top: 32px;
    padding-bottom: 10px;
    align-items: start;
}

@media (max-width: 1100px) {
    .app-layout {
        grid-template-columns: 1fr 1fr;
    }
    .preview-panel {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

@media (max-width: 700px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    .preview-panel {
        grid-column: auto;
        order: -1;
    }
    .phone-wrapper {
        transform: none !important;
        margin-bottom: 0 !important;
    }
    .phone-frame {
        width: 80vw;
        max-width: 360px;
        height: calc(80vw * 932 / 430);
        max-height: 780px;
        border-radius: min(45px, 6.5vw);
        margin: 0 auto;
    }
    .phone-screen {
        border-radius: 40px;
    }
}

/* ── Controls Panel ── */
.controls-panel,
.messages-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

@media (max-width: 700px) {
    .controls-panel,
    .messages-panel {
        position: relative !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
}

.controls-panel::-webkit-scrollbar,
.messages-panel::-webkit-scrollbar {
    width: 6px;
}

.controls-panel::-webkit-scrollbar-track,
.messages-panel::-webkit-scrollbar-track {
    background: transparent;
}

.controls-panel::-webkit-scrollbar-thumb,
.messages-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -0.2px;
}

.control-group {
    margin-bottom: 16px;
}

.control-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.control-group input[type="text"],
.control-group input[type="time"],
.control-group select,
.control-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}

.control-group input:focus,
.control-group select:focus,
.control-group textarea:focus {
    border-color: var(--accent);
}

.control-group textarea {
    resize: vertical;
    min-height: 70px;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ── Toggle buttons ── */
.device-toggle,
.theme-toggle,
.sender-toggle {
    display: flex;
    gap: 8px;
}

.device-btn,
.theme-btn,
.sender-btn {
    flex: 1;
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.device-btn.active,
.theme-btn.active,
.sender-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ── Buttons ── */
.btn-add {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-add:hover {
    background: var(--accent-hover);
}

.btn-download {
    width: 100%;
    padding: 14px;
    background: var(--green);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    margin-top: 16px;
}

.btn-download:hover {
    background: #2db84e;
}

.btn-download:active {
    transform: scale(0.98);
}

/* ── Message List ── */
.message-list {
    margin-top: 16px;
}

.message-list h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.empty-state {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.msg-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 13px;
}

.msg-item-content {
    flex: 1;
    min-width: 0;
}

.msg-item-sender {
    font-weight: 600;
    color: var(--accent);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msg-item-sender.me {
    color: var(--green);
}

.msg-item-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    margin-top: 2px;
}

.msg-item-delete {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.msg-item-delete:hover {
    opacity: 1;
}

/* ── Preview Panel ── */
.preview-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.phone-wrapper {
    position: relative;
    transform: scale(0.82);
    transform-origin: top center;
    margin-bottom: -100px;
}

/* ── Phone Frame ── */
.phone-frame {
    width: 430px;
    height: 932px;
    background: #000;
    border-radius: 55px;
    padding: 14px;
    position: relative;
    box-shadow:
        0 0 0 2px #1a1a2e,
        0 0 0 4px #333,
        0 20px 60px rgba(0,0,0,0.5);
}

.phone-notch {
    display: none;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 45px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.phone-screen.dark {
    background: #000;
}

.home-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 5px;
    background: #666;
    border-radius: 3px;
}

/* ── Status Bar ── */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, 'SF Pro Text', 'Inter', sans-serif;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.phone-screen:not(.dark) .status-bar {
    color: #000;
}

.phone-screen.dark .status-bar {
    color: #fff;
}

.status-left {
    flex: 1;
}

.status-time {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.2px;
}

.status-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.dynamic-island {
    width: 126px;
    height: 35px;
    background: #000;
    border-radius: 20px;
}

.phone-screen.dark .dynamic-island {
    background: #1c1c1e;
}

.status-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 12px;
}

.status-signal {
    display: flex;
    align-items: flex-end;
    gap: 1.5px;
    height: 12px;
}

.signal-bar {
    width: 3px;
    border-radius: 1px;
    background: #c7c7cc;
}

.phone-screen.dark .signal-bar {
    background: #48484a;
}

.signal-bar:nth-child(1) { height: 4px; }
.signal-bar:nth-child(2) { height: 6px; }
.signal-bar:nth-child(3) { height: 9px; }
.signal-bar:nth-child(4) { height: 12px; }

.signal-bar.active {
    background: currentColor;
}

.phone-screen.dark .signal-bar.active {
    background: #fff;
}

.status-carrier {
    display: none;
}

.status-battery {
    display: flex;
    align-items: center;
    gap: 4px;
}

.battery-icon {
    width: 25px;
    height: 12px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 1.5px;
}

.battery-icon::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 5px;
    background: currentColor;
    border-radius: 0 1px 1px 0;
}

.battery-level {
    height: 100%;
    background: currentColor;
    border-radius: 1px;
    transition: width 0.3s;
}

.battery-text {
    font-size: 12px;
    font-weight: 500;
}

/* ── SMS Header ── */
.sms-header {
    display: flex;
    align-items: center;
    padding: 4px 16px 10px;
    border-bottom: 0.5px solid #e5e5e5;
    flex-shrink: 0;
}

.phone-screen.dark .sms-header {
    border-bottom-color: #2c2c2e;
}

.back-btn,
.call-btn {
    background: none;
    border: none;
    cursor: default;
    padding: 4px;
    display: flex;
    align-items: center;
}

.phone-screen:not(.dark) .back-btn,
.phone-screen:not(.dark) .call-btn {
    color: var(--accent);
}

.phone-screen.dark .back-btn,
.phone-screen.dark .call-btn {
    color: #0a84ff;
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.contact-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #c7c7cc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.phone-screen.dark .contact-avatar {
    background: #48484a;
}

.contact-name {
    font-size: 13px;
    font-weight: 600;
}

.phone-screen:not(.dark) .contact-name {
    color: #000;
}

.phone-screen.dark .contact-name {
    color: #fff;
}

/* ── Messages Area ── */
.sms-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.messages-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #8e8e93;
    font-size: 14px;
    padding: 20px;
}

.sms-date-separator {
    text-align: center;
    font-size: 11px;
    color: #8e8e93;
    padding: 8px 0;
    font-weight: 500;
}

.sms-bubble-row {
    display: flex;
    margin-bottom: 2px;
}

.sms-bubble-row.them {
    justify-content: flex-start;
}

.sms-bubble-row.me {
    justify-content: flex-end;
}

.sms-bubble {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 16px;
    line-height: 1.35;
    font-family: -apple-system, 'SF Pro Text', 'Inter', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    word-wrap: break-word;
    position: relative;
}

.phone-screen img.emoji {
    height: 1.2em !important;
    width: 1.2em !important;
    margin: 0 0.05em 0 0.1em !important;
    vertical-align: -0.2em !important;
    display: inline !important;
}

.transcript-msg img.emoji,
.view-meta img.emoji {
    height: 1.2em !important;
    width: 1.2em !important;
    margin: 0 0.05em 0 0.1em !important;
    vertical-align: -0.2em !important;
    display: inline !important;
}

.sms-bubble-row.them .sms-bubble {
    background: #e9e9eb;
    color: #000;
    border-bottom-left-radius: 6px;
}

.phone-screen.dark .sms-bubble-row.them .sms-bubble {
    background: #26252a;
    color: #fff;
}

.sms-bubble-row.me .sms-bubble {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.sms-bubble-time {
    font-size: 10px;
    color: #8e8e93;
    margin-top: 2px;
    padding: 0 4px;
}

.sms-bubble-row.me .sms-bubble-time {
    text-align: right;
}

/* ── Input Bar ── */
.sms-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 30px;
    border-top: 0.5px solid #e5e5e5;
    flex-shrink: 0;
}

.phone-screen.dark .sms-input-bar {
    border-top-color: #2c2c2e;
}

.input-actions-left,
.input-actions-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.fake-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #c7c7cc;
    border-radius: 20px;
    font-size: 16px;
    color: #c7c7cc;
    font-family: -apple-system, 'SF Pro Text', 'Inter', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.phone-screen.dark .fake-input {
    border-color: #3a3a3c;
    color: #636366;
    background: transparent;
}

/* ── Hidden utility ── */
.hidden {
    display: none !important;
}

/* ── Samsung Device ── */
.device-samsung {
    border-radius: 40px;
}

.device-samsung .phone-screen {
    border-radius: 32px;
}

.punch-hole {
    width: 12px;
    height: 12px;
    background: #000;
    border-radius: 50%;
}

.phone-screen.dark .punch-hole {
    background: #1c1c1e;
}

.samsung-status {
    padding: 10px 24px 8px;
}

.samsung-wifi {
    width: 14px;
    height: 11px;
}

.samsung-contact-info {
    flex-direction: row;
    gap: 10px;
}

.samsung-avatar {
    width: 36px;
    height: 36px;
    font-size: 15px;
    background: #5b86e5;
}

.phone-screen.dark .samsung-avatar {
    background: #3a5ba0;
}

.samsung-sms-header {
    padding: 8px 16px 12px;
}

.samsung-input-bar {
    padding: 10px 12px 20px;
    gap: 10px;
}

.samsung-fake-input {
    border-radius: 24px;
    background: #f0f0f0;
    border: none;
    color: #999;
    padding: 10px 16px;
}

.phone-screen.dark .samsung-fake-input {
    background: #2c2c2e;
    color: #636366;
    border: none;
}

.samsung-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #5b86e5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.samsung-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 6px 0 2px;
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
}

.samsung-nav-btn {
    color: #888;
    font-size: 14px;
    line-height: 1;
}

/* Samsung bubble style */
.device-samsung .sms-bubble-row.me .sms-bubble,
.phone-screen.samsung-active .sms-bubble-row.me .sms-bubble {
    background: #5b86e5;
    border-bottom-right-radius: 6px;
}

.device-samsung .sms-bubble-row.them .sms-bubble {
    background: #f0f0f0;
    color: #1a1a1a;
    border-bottom-left-radius: 6px;
}

.phone-screen.dark .device-samsung .sms-bubble-row.them .sms-bubble,
.device-samsung .phone-screen.dark .sms-bubble-row.them .sms-bubble {
    background: #2c2c2e;
    color: #fff;
}

/* ── Consent ── */
.consent-group {
    margin: 16px 0;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.5;
}

.consent-label input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--accent);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.consent-label a {
    color: var(--accent);
}

.consent-group.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ── Visibility Toggle ── */
.visibility-toggle {
    display: flex;
    gap: 8px;
}

.vis-btn {
    flex: 1;
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.vis-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-private-download {
    width: 100%;
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    margin-top: 8px;
}

.btn-private-download:hover {
    background: var(--border);
}

.btn-private-download:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Share Button ── */
.btn-share {
    width: 100%;
    padding: 14px;
    background: var(--green);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.btn-share:hover {
    background: #2db84e;
}

.btn-share:active {
    transform: scale(0.98);
}

.btn-share:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Toast notifications ── */
.toast-root {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
    width: min(420px, 100%);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: auto;
}

.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.toast--info .toast-icon {
    background: rgba(0, 122, 255, 0.2);
    color: var(--accent);
}

.toast--success .toast-icon {
    background: rgba(52, 199, 89, 0.2);
    color: var(--green);
}

.toast--warning .toast-icon {
    background: rgba(255, 149, 0, 0.2);
    color: #ff9500;
}

.toast--error .toast-icon {
    background: rgba(255, 59, 48, 0.2);
    color: var(--red);
}

.toast-message {
    flex: 1;
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
    padding-top: 2px;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 4px;
    margin: -4px 0 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text);
}

@media (max-width: 480px) {
    .toast-root {
        top: auto;
        bottom: 100px;
        left: 16px;
        right: 16px;
        transform: none;
        width: auto;
        max-width: none;
    }
}

/* ── Share Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.modal-box h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.share-preview {
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-height: 300px;
    display: flex;
    justify-content: center;
    background: var(--surface-2);
}

.share-preview img {
    max-height: 300px;
    width: auto;
    object-fit: contain;
}

.share-link-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.share-link-group input {
    flex: 1;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.btn-copy {
    padding: 10px 18px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.share-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.share-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    transition: opacity 0.2s;
}

.share-btn:hover {
    opacity: 0.85;
}

.share-facebook { background: #1877f2; }
.share-twitter { background: #1da1f2; }
.share-whatsapp { background: #25d366; }

.btn-download-alt {
    width: 100%;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-download-alt:hover {
    background: var(--border);
}

/* ── Cookie Banner ── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-content p {
    font-size: 13px;
    color: var(--text-muted);
    flex: 1;
    min-width: 200px;
}

.cookie-content a {
    color: var(--accent);
}

.cookie-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid var(--border);
}

.cookie-accept {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.cookie-decline {
    background: var(--surface-2);
    color: var(--text-muted);
}

/* ── Ad Containers ── */
.ad-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 24px;
}

.ad-container.ad-top {
    padding: 4px 24px 6px;
}

.ad-mobile-only {
    display: none;
    overflow: hidden;
}

.ad-desktop-only {
    display: block;
}

.gallery-ad-mid {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
    padding: 10px 0;
}

.ad-after-screenshot {
    margin-top: 16px;
    padding: 0;
}

@media (max-width: 700px) {
    .ad-mobile-only {
        display: block;
    }
    .ad-desktop-only {
        display: none;
    }
}


/* ── Footer ── */
.site-footer {
    padding: 20px 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

/* ── Gallery ── */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    justify-items: center;
}


.gallery-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    text-decoration: none;
    color: var(--text);
    display: block;
    width: 100%;
    max-width: 300px;
}

.gallery-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.gallery-card-image {
    width: 100%;
    aspect-ratio: 9 / 12;
    object-fit: contain;
    object-position: center;
    background: var(--surface-2);
    padding: 8px;
}

.gallery-card-info {
    padding: 14px 16px;
}

.gallery-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.gallery-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-link {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.page-link:hover {
    border-color: var(--accent);
}

.page-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.gallery-empty p {
    font-size: 16px;
    margin-bottom: 16px;
}

.gallery-empty a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* ── View Page ── */
.view-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .view-layout { grid-template-columns: 1fr; }
}


.view-image-wrap {
    text-align: center;
}

.view-image-wrap img {
    max-width: 100%;
    max-height: 900px;
}

.view-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.view-nav img {
    flex: 0 1 auto;
}

.view-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.view-nav-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.1);
}

.view-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.view-sidebar h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.view-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.8;
}

.view-cta {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    margin-top: 20px;
    transition: background 0.2s;
}

.view-cta:hover {
    background: var(--accent-hover);
}

.view-delete-request {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
}

.view-delete-request:hover {
    color: var(--red);
}

.view-transcript {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.view-transcript h2 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.transcript-msg {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    background: var(--surface-2);
}

.transcript-msg.transcript-me {
    border-left: 3px solid var(--accent);
}

.transcript-msg.transcript-them {
    border-left: 3px solid var(--text-muted);
}

.transcript-sender {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
}

.transcript-me .transcript-sender {
    color: var(--green);
}

.transcript-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 8px;
}

.transcript-msg p {
    font-size: 14px;
    color: var(--text);
    margin-top: 2px;
    line-height: 1.5;
}

/* ── Admin ── */
.admin-login-wrap {
    max-width: 400px;
    margin: 80px auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.admin-login-wrap h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.admin-login-wrap input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    margin-bottom: 12px;
    outline: none;
    font-family: inherit;
}

.admin-login-wrap input:focus {
    border-color: var(--accent);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.admin-dashboard {
    padding: 32px 0 60px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.admin-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td img {
    width: 40px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.btn-admin-delete {
    padding: 4px 12px;
    background: var(--red);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.admin-error {
    color: var(--red);
    font-size: 13px;
    margin-top: 8px;
}

/* ── OCR Upload ── */
.ocr-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.ocr-upload-area:hover,
.ocr-upload-area.dragover {
    border-color: var(--accent);
    background: rgba(0, 122, 255, 0.05);
}

.ocr-upload-placeholder {
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ocr-upload-placeholder p {
    font-size: 14px;
}

.ocr-preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.ocr-analyze-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ocr-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.ocr-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ocr-spin 0.8s linear infinite;
}

@keyframes ocr-spin {
    to { transform: rotate(360deg); }
}

.ocr-messages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ocr-message-row {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.ocr-msg-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.ocr-msg-header .sender-btn {
    padding: 4px 10px;
    font-size: 12px;
}

.ocr-msg-time {
    width: 70px;
    padding: 4px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    margin-left: auto;
}

.ocr-msg-time:focus {
    border-color: var(--accent);
}

.ocr-msg-delete {
    flex-shrink: 0;
}

.ocr-msg-text {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

.ocr-msg-text:focus {
    border-color: var(--accent);
}

/* ── Legal Pages ── */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.legal-content h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.legal-content h2 {
    font-size: 18px;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 12px;
}

.legal-content p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 12px;
}

.legal-content ul {
    color: var(--text-muted);
    padding-left: 24px;
    margin-bottom: 12px;
    line-height: 1.8;
}

.legal-content a {
    color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .phone-screen {
        border-radius: 36px;
    }

    .app-layout {
        padding-top: 20px;
        gap: 24px;
    }
}
