:root {
    color-scheme: light;
    --bg: #f5f7fa;
    --panel: #ffffff;
    --text: #17202a;
    --muted: #637083;
    --line: #dce3ec;
    --accent: #1769aa;
    --accent-dark: #0f4f82;
    --success: #116c3f;
    --danger: #a32929;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.page {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.compact {
    width: min(760px, calc(100% - 32px));
}

.shared-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    width: min(1000px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 0 28px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
}

h2 {
    margin: 6px 0 0;
    font-size: 1.15rem;
}

.subtitle {
    margin: 12px 0 0;
    max-width: 640px;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.5;
}

.admin-link,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.primary:hover {
    background: var(--accent-dark);
}

.danger-button {
    border-color: var(--danger);
    background: var(--danger);
    color: #ffffff;
}

.danger-button:hover {
    background: #7f1f1f;
}

.success-button {
    border-color: var(--success);
    background: var(--success);
    color: #ffffff;
}

.success-button:hover {
    background: #0d542f;
}

.warning-button {
    border-color: #d39b00;
    background: #f4c542;
    color: #17202a;
}

.warning-button:hover {
    background: #e2b52f;
}

.notice,
.player-panel,
.form-panel,
.empty {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.notice {
    margin-bottom: 16px;
    padding: 14px 16px;
    color: var(--accent-dark);
}

.notice.error {
    color: var(--danger);
}

.notice.success {
    color: var(--success);
}

.player-panel {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
    align-items: center;
    gap: 18px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(23, 32, 42, 0.08);
}

.player-label,
.date,
.hint {
    color: var(--muted);
}

.player-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

audio {
    width: 100%;
}

.list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.comment-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.comment-card.selected {
    border-color: var(--accent);
    box-shadow: inset 4px 0 0 var(--accent);
}

.shared-player {
    min-height: min(520px, calc(100vh - 64px));
    align-content: center;
    grid-template-columns: 1fr;
    justify-items: start;
}

.shared-player h1 {
    margin-bottom: 24px;
}

.shared-player .button {
    min-width: 180px;
}

.podcast-share {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1402 / 1122;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background-color: transparent;
    box-shadow: 0 8px 24px rgba(23, 32, 42, 0.08);
}

.podcast-share::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: transparent;
}

.podcast-share > * {
    position: relative;
    z-index: 2;
}

.podcast-share > img[aria-hidden="true"] {
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}

.podcast-share-actions {
    position: absolute !important;
    left: 28px;
    right: 28px;
    bottom: 28px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
}

.podcast-share-actions .button {
    min-width: 160px;
}

.podcast-file-name {
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.date {
    margin: 0;
    font-weight: 700;
}

.actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.actions.left {
    justify-content: flex-start;
}

.empty {
    padding: 28px;
}

.empty h2 {
    margin: 0 0 8px;
}

.empty p {
    margin: 0;
    color: var(--muted);
}

.empty .button {
    margin-top: 18px;
}

.form-panel {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.recorder-panel {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.recording-time {
    font-size: 2rem;
    font-weight: 700;
}

.recorder-panel audio {
    width: 100%;
}

label {
    font-weight: 700;
}

input[type='password'],
input[type='file'] {
    width: 100%;
    min-height: 44px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    font: inherit;
}

.hint {
    margin: 0;
    line-height: 1.45;
}

.publish-success {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.publish-success p {
    width: 100%;
    margin: 0;
}

.logout-form {
    margin-top: 16px;
}

.text-button {
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 760px) {
    .shared-page {
        width: 100vw;
        min-height: 100svh;
        padding: 0;
    }

    .podcast-share {
        width: 100vw;
        min-height: 100svh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .podcast-share > img[aria-hidden="true"] {
        object-fit: cover !important;
    }

    .podcast-share-actions {
        left: 16px;
        right: 16px;
        bottom: 16px;
        align-items: stretch;
        flex-direction: column;
    }

    .podcast-share-actions .button {
        width: 100%;
    }

    .header,
    .comment-card,
    .player-panel {
        grid-template-columns: 1fr;
    }

    .header {
        display: grid;
    }

    .admin-link,
    .button {
        width: 100%;
    }

    .actions {
        justify-content: stretch;
    }
}
