:root {
    --bg: #f2efe8;
    --ink: #1f2a2e;
    --soft: #f8f6f1;
    --accent: #d4583d;
    --accent-2: #2f706d;
    --line: #d9d1c1;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 10%, #f7dec7 0%, transparent 40%),
        radial-gradient(circle at 90% 20%, #d4ebe5 0%, transparent 45%),
        var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(248, 246, 241, 0.9);
    backdrop-filter: blur(6px);
}

.top-nav-inner {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.top-nav-brand {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

.top-nav-links {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.top-nav-links a {
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    background: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.top-nav-links a:hover {
    background: #f6f3ed;
}

.top-nav-links a.is-active {
    background: linear-gradient(120deg, var(--accent), #df7a34);
    color: #fff;
    border-color: transparent;
}

.shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

body > .shell,
main.shell {
    padding-top: 1.1rem;
}

.hero {
    margin-bottom: 1.25rem;
}

.breadcrumb-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
    color: #5b666d;
    font-size: 0.92rem;
}

.breadcrumb-row a {
    color: var(--accent-2);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb-row a:hover {
    text-decoration: underline;
}

.hero h1 {
    margin: 0.4rem 0;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    line-height: 1.2;
}

.kicker {
    display: inline-block;
    margin: 0;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--soft);
    color: var(--accent-2);
    font-size: 0.85rem;
}

.lead {
    max-width: 72ch;
    font-size: 1.04rem;
}

.card {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 8px 30px rgba(30, 36, 30, 0.06);
    margin-bottom: 1rem;
}

.upload-form {
    display: grid;
    gap: 0.7rem;
}

input,
button {
    font: inherit;
}

input[type="file"],
input[type="number"] {
    width: 100%;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.6rem;
}

.hidden-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-picker {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.file-picker-btn {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    background: #fff;
    color: var(--ink);
    font-weight: 600;
}

.file-picker-name {
    color: #5d6663;
    font-size: 0.94rem;
}

button {
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    background: linear-gradient(120deg, var(--accent), #df7a34);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.05);
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

pre {
    white-space: pre-wrap;
    font-family: "IBM Plex Mono", "Consolas", monospace;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.8rem;
    max-height: 420px;
    overflow: auto;
}

video {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #000;
}

audio {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}

.yt-entry video,
.yt-entry audio {
    max-width: 480px;
}

.ghost {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--accent-2);
}

.progress-container {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #df7a34);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}

.status-message {
    text-align: center;
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    color: var(--accent-2);
}

.status-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1rem;
    padding: 0.8rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.content-section {
    width: 100%;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.section-head h2,
.section-head h3 {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    background: #fff;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.copy-btn:hover {
    filter: none;
    background: #f6f3ed;
}

hashtag {
    display: inline-block;
    color: #1a6fd4;
    font-weight: 600;
}

summary.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
}

summary.section-head::-webkit-details-marker {
    display: none;
}

summary.section-head::before {
    content: '▸';
    flex-shrink: 0;
    font-size: 0.8em;
    color: var(--muted);
}

details[open] > summary.section-head::before {
    content: '▾';
}

.transcript-content {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.2rem;
    line-height: 1.8;
    color: var(--ink);
    word-wrap: break-word;
    white-space: pre-wrap;
    font-family: "IBM Plex Mono", "Consolas", monospace;
    font-size: 0.95rem;
    max-height: 500px;
    overflow-y: auto;
}

.social-content {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.2rem;
    line-height: 1.8;
    font-size: 1rem;
    color: var(--ink);
    text-align: justify;
}

.social-content b {
    font-weight: 700;
    color: var(--accent);
}

.social-content em {
    font-style: italic;
    color: var(--accent-2);
}

.social-title {
    font-size: 1.3rem;
    margin: 0 0 0.8rem 0;
    color: var(--accent);
    font-weight: 700;
}

.bottom-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 2rem 0;
}

.btn-primary {
    display: inline-block;
    padding: 0.9rem 2rem;
    background: linear-gradient(120deg, var(--accent), #df7a34);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(212, 88, 61, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 20px rgba(212, 88, 61, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: #f6f3ed;
}

.btn-danger {
    border: 1px solid #cf8f84;
    border-radius: 10px;
    padding: 0.45rem 0.8rem;
    background: #fff5f3;
    color: #9c2f22;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger:hover {
    background: #ffe9e5;
}

.inline-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.recent-list {
    display: grid;
    gap: 0.9rem;
}

.recent-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem;
    background: #fff;
}

.recent-item h3 {
    margin: 0;
    font-size: 1rem;
}

.yt-entry {
    width: 100%;
}

.yt-section {
    margin-top: 0.8rem;
}

.yt-section summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.yt-meta {
    margin-top: 0.9rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--line);
}

.yt-meta p {
    margin: 0.25rem 0;
}

.hint {
    color: #536067;
    font-size: 0.92rem;
}

.error {
    border-color: #cc6e5e;
}

@media (max-width: 800px) {
    .grid {
        grid-template-columns: 1fr;
    }
}
