@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=Raleway:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg: #628dc8;
    --surface: #ffffff;
    --border: #CCCCCC;
    --text-primary: #171717;
    --text-secondary: #363636;
    --text-muted: #525252;
    --accent: #4872AE;
    --accent-hover: #3b5f91;
    --yellow: #FFC829;
    --red: #DA1A00;
    --tag-bg: #EAEAEA;
    --font-sans: 'Raleway', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.nav {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
    margin-right: 8px;
}

.nav-btn {
    flex: 1;
    padding: 10px 0;
    border: 2px solid var(--accent);
    background: #FFFFFF;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nav-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #FFFFFF;
}

.view {
    display: none;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 20px 24px;
}

.view.active {
    display: block;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.speech-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}

.speech-card:active {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(72, 114, 174, 0.15);
}

.speech-card-img {
    width: 88px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--tag-bg);
}

.speech-card-img-placeholder {
    width: 88px;
    height: 100px;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--tag-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.speech-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.speech-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.speech-card-time {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.speech-card-topic {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.speaker-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
}

.speaker-avatar {
    width: 88px;
    height: 100px;
    border-radius: 0;
    flex-shrink: 0;
}

.speaker-avatar-placeholder {
    width: 88px;
    height: 100px;
    border-radius: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.speaker-info {
    flex: 1;
    min-width: 0;
}

.speaker-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.speaker-role {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.speaker-speeches {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 4px;
}

#detail-view,
#speaker-detail-view {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 100;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

#detail-view.open,
#speaker-detail-view.open {
    transform: translateX(0);
}

.detail-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px;
    background-color: var(--surface);
}

.detail-hero {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-hero-placeholder {
    width: 100%;
    height: 220px;
    background: var(--tag-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.detail-body {
    padding: 20px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
}

.detail-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-time {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-time::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.detail-topic-label,
.detail-speakers-label,
.detail-desc-label {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.detail-topic {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.detail-speakers-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-speakers-list li {
    font-size: 15px;
    color: var(--text-primary);
    padding-left: 12px;
    position: relative;
}

.detail-speakers-list li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.detail-desc {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.detail-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1.5px solid var(--border);
    z-index: 200;
}

.footer-btn {
    flex: 1;
    padding: 11px 8px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-btn:active {
    background: var(--tag-bg);
}

.footer-btn.center {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    flex: 0 0 auto;
    padding: 11px 20px;
    font-weight: 600;
}

.footer-btn.center:active {
    opacity: 0.85;
}

.footer-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}

.footer-btn .arrow {
    font-size: 15px;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 8px;
}

.section-divider span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
}