* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode header {
    background: #2a2a2a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.dark-mode header h1 {
    color: #e0e0e0;
}

body.dark-mode .video-item {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

body.dark-mode .video-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

body.dark-mode .video-title {
    color: #e0e0e0;
}

body.dark-mode .video-title:hover {
    color: #66b3ff;
}

body.dark-mode .video-summary {
    color: #c0c0c0;
}

body.dark-mode .video-summary.processing {
    color: #707070;
}

body.dark-mode .video-tags {
    color: #a0a0a0;
}

body.dark-mode .metadata-section {
    color: #c8c8c8;
}

body.dark-mode .metadata-section strong {
    color: #f0f0f0;
}

body.dark-mode .metadata-list li {
    color: #c8c8c8;
}

body.dark-mode .status-badge.processed {
    background-color: #1b4d1b;
    color: #66ff66;
}

body.dark-mode .status-badge.processing {
    background-color: #4d4d1b;
    color: #ffff66;
}

body.dark-mode .btn-process {
    background-color: #3a3a3a;
    border-color: #4a4a4a;
    color: #e0e0e0;
}

body.dark-mode .btn-process:hover {
    background-color: #4a4020;
    border-color: #f9ab00;
}

body.dark-mode button {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border-color: #4a4a4a;
}

body.dark-mode button:hover:not(:disabled) {
    background-color: #4a4a4a;
}

body.dark-mode input[type="text"] {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border-color: #4a4a4a;
}

body.dark-mode #loading {
    color: #b0b0b0;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 32px;
    width: 32px;
}

header h1 {
    font-size: 24px;
    color: #1a1a1a;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#login-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.btn-icon:hover {
    background-color: #f0f0f0;
    border-color: #1a73e8;
    color: #1a73e8;
}

body.dark-mode .btn-icon {
    border-color: #4a4a4a;
    color: #b0b0b0;
}

body.dark-mode .btn-icon:hover {
    background-color: #3a3a3a;
    border-color: #66b3ff;
    color: #66b3ff;
}

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

#sync-btn.syncing {
    color: #1a73e8;
    border-color: #1a73e8;
    opacity: 1;
}

#sync-btn.syncing svg {
    animation: spin 1s linear infinite;
}

body.dark-mode #sync-btn.syncing {
    color: #66b3ff;
    border-color: #66b3ff;
}

.search-input {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    width: 300px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #1a73e8;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #1a73e8;
    color: white;
}

.btn-primary:hover {
    background-color: #1557b0;
}

.btn-secondary {
    background-color: #5f6368;
    color: white;
}

.btn-secondary:hover {
    background-color: #4a4d50;
}

#loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.message-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.message-box h2 {
    margin-bottom: 15px;
    color: #1a1a1a;
}

.message-box p {
    color: #666;
    font-size: 16px;
}

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

#videos-container h2 {
    margin: 0;
    color: #1a1a1a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

#videos-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    transition: transform 0.2s, box-shadow 0.2s;
}

.video-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.video-thumbnail-section {
    flex-shrink: 0;
    width: 320px;
    display: flex;
    flex-direction: column;
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    position: relative;
    background: #000;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.listenability-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
    cursor: default;
}

.video-thumbnail-metadata {
    padding: 12px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
}

body.dark-mode .video-thumbnail-metadata {
    background: #252525;
    border-top-color: #333;
}

.video-thumbnail-metadata .metadata-section {
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.6;
}

.video-tags-inline {
    font-size: 13px;
    color: #737373;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-variant: small-caps;
}

body.dark-mode .video-tags-inline {
    color: #a0a0a0;
}

.tag-link {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.2s, text-decoration 0.2s;
}

.tag-link:hover {
    color: #1557b0;
    text-decoration: underline;
}

body.dark-mode .tag-link {
    color: #66b3ff;
}

body.dark-mode .tag-link:hover {
    color: #4d9fff;
    text-decoration: underline;
}

.person-link {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.2s, text-decoration 0.2s;
}

.person-link:hover {
    color: #1557b0;
    text-decoration: underline;
}

body.dark-mode .person-link {
    color: #66b3ff;
}

body.dark-mode .person-link:hover {
    color: #4d9fff;
    text-decoration: underline;
}

.video-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.video-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.video-title {
    font-size: 22px;
    font-weight: 700;
    color: #0a0a0a;
    text-decoration: none;
    flex: 1;
    line-height: 1.3;
    letter-spacing: -0.02em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.video-title:hover {
    color: #1a73e8;
}

.btn-process {
    background-color: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 32px;
    height: 28px;
}

.btn-process:hover {
    background-color: #fef7e0;
    border-color: #f9ab00;
    transform: scale(1.1);
}

.btn-process:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.video-content-columns {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.video-content-left {
    flex: 1;
}

.video-content-right {
    flex: 1;
}

.video-summary {
    font-size: 16px;
    color: #3a3a3a;
    line-height: 1.7;
    letter-spacing: 0;
    font-weight: 400;
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

.video-summary.processing {
    font-style: italic;
    color: #999;
}

.extended-summary-container {
    margin-top: 12px;
    margin-bottom: 8px;
}

.extended-summary-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 5px;
    user-select: none;
    transition: background-color 0.2s;
}

.extended-summary-toggle:hover {
    background-color: #e8e8e8;
}

body.dark-mode .extended-summary-toggle {
    background-color: #3a3a3a;
}

body.dark-mode .extended-summary-toggle:hover {
    background-color: #454545;
}

.toggle-icon {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s;
}

body.dark-mode .toggle-icon {
    color: #b0b0b0;
}

.toggle-text {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.02em;
}

body.dark-mode .toggle-text {
    color: #e0e0e0;
}

.extended-summary-content {
    margin-top: 8px;
    padding: 14px 16px;
    background-color: #fafafa;
    border-left: 3px solid #1a73e8;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.75;
    color: #2a2a2a;
    letter-spacing: 0;
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

body.dark-mode .extended-summary-content {
    background-color: #2a2a2a;
    color: #c8c8c8;
    border-left-color: #66b3ff;
}

.inline-toggle {
    cursor: pointer;
    user-select: none;
    margin-left: 4px;
}

.inline-toggle .toggle-text {
    color: #666;
    font-size: 0.85em;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.inline-toggle:hover .toggle-text {
    color: #333;
}

body.dark-mode .inline-toggle .toggle-text {
    color: #aaa;
}

body.dark-mode .inline-toggle:hover .toggle-text {
    color: #ddd;
}

.highlights-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 5px;
    user-select: none;
    transition: background-color 0.2s;
    margin-top: 8px;
}

.highlights-toggle:hover {
    background-color: #e8e8e8;
}

body.dark-mode .highlights-toggle {
    background-color: #3a3a3a;
}

body.dark-mode .highlights-toggle:hover {
    background-color: #454545;
}

.highlights-hidden {
    margin-top: 8px;
}

.video-tags {
    font-size: 11px;
    color: #737373;
    margin-top: 10px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-variant: small-caps;
}

.metadata-section {
    font-size: 15px;
    color: #3a3a3a;
    margin-bottom: 12px;
    line-height: 1.7;
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

.metadata-section strong {
    color: #0a0a0a;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.metadata-list {
    margin: 6px 0 0 20px;
    padding: 0;
}

.metadata-list li {
    margin-bottom: 6px;
    color: #3a3a3a;
    font-size: 15px;
    line-height: 1.65;
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

.video-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #888;
}

.video-content .video-meta {
    margin-top: 12px;
}

.video-thumbnail-metadata .video-meta {
    margin-top: 4px;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.processed {
    background-color: #e6f4ea;
    color: #1e8e3e;
}

.status-badge.processing {
    background-color: #fef7e0;
    color: #f9ab00;
}

/* Commute mode toggle */
.commute-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.commute-icon {
    color: #5f6368;
    flex-shrink: 0;
}

body.dark-mode .commute-icon {
    color: #b0b0b0;
}

.commute-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.commute-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.commute-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.commute-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.commute-toggle input:checked + .commute-slider {
    background-color: #1a73e8;
}

.commute-toggle input:checked + .commute-slider::before {
    transform: translateX(20px);
}

body.dark-mode .commute-slider {
    background-color: #4a4a4a;
}

body.dark-mode .commute-toggle input:checked + .commute-slider {
    background-color: #66b3ff;
}

/* Commute mode indicator */
.commute-mode-indicator {
    display: none;
    background: #e8f0fe;
    color: #1a73e8;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
    text-align: center;
}

body.dark-mode .commute-mode-indicator {
    background: #1a3050;
    color: #66b3ff;
}

.commute-mode-indicator.active {
    display: block;
}

/* Commute settings */
.setting-section-header {
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
    margin-top: 4px;
}

.setting-section-header label {
    font-weight: 700 !important;
    font-size: 15px !important;
}

body.dark-mode .setting-section-header {
    border-top-color: #4a4a4a;
}

.range-with-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-with-value input[type="range"] {
    -webkit-appearance: none;
    width: 120px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
}

.range-with-value input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #1a73e8;
    border-radius: 50%;
    cursor: pointer;
}

body.dark-mode .range-with-value input[type="range"] {
    background: #4a4a4a;
}

body.dark-mode .range-with-value input[type="range"]::-webkit-slider-thumb {
    background: #66b3ff;
}

.range-value {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    min-width: 24px;
}

body.dark-mode .range-value {
    color: #e0e0e0;
}

/* Dual-range slider */
.dual-range-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 180px;
}

.dual-range-value {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

body.dark-mode .dual-range-value {
    color: #e0e0e0;
}

.dual-range-track {
    position: relative;
    width: 100%;
    height: 24px;
}

.dual-range-track::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    transform: translateY(-50%);
    background: #e0e0e0;
    border-radius: 3px;
}

body.dark-mode .dual-range-track::before {
    background: #4a4a4a;
}

.dual-range-fill {
    position: absolute;
    top: 50%;
    height: 6px;
    transform: translateY(-50%);
    background: #1a73e8;
    border-radius: 3px;
    pointer-events: none;
}

body.dark-mode .dual-range-fill {
    background: #66b3ff;
}

.dual-range-input {
    -webkit-appearance: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    background: transparent;
    pointer-events: none;
    outline: none;
}

.dual-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #1a73e8;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

body.dark-mode .dual-range-input::-webkit-slider-thumb {
    background: #66b3ff;
    border-color: #2a2a2a;
}

.dual-range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #1a73e8;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

body.dark-mode .dual-range-input::-moz-range-thumb {
    background: #66b3ff;
    border-color: #2a2a2a;
}

/* Account page */
.account-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.account-header h2 {
    margin: 0;
    color: #1a1a1a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

body.dark-mode .account-header h2 {
    color: #e0e0e0;
}

.account-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body.dark-mode .account-card {
    background: #2a2a2a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.account-card h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

body.dark-mode .account-card h3 {
    color: #e0e0e0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

body.dark-mode .detail-row {
    border-bottom-color: #3a3a3a;
}

.detail-label {
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

body.dark-mode .detail-label {
    color: #a0a0a0;
}

.detail-value {
    color: #333;
    font-size: 14px;
}

body.dark-mode .detail-value {
    color: #e0e0e0;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-row label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

body.dark-mode .setting-row label {
    color: #e0e0e0;
}

.setting-row input[type="number"],
.setting-row input[type="text"],
.setting-row select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    color: #333;
    transition: border-color 0.2s;
    min-width: 160px;
}

.setting-row input[type="number"]:focus,
.setting-row input[type="text"]:focus,
.setting-row select:focus {
    outline: none;
    border-color: #1a73e8;
}

body.dark-mode .setting-row input[type="number"],
body.dark-mode .setting-row input[type="text"],
body.dark-mode .setting-row select {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #4a4a4a;
}

body.dark-mode .setting-row input[type="number"]:focus,
body.dark-mode .setting-row input[type="text"]:focus,
body.dark-mode .setting-row select:focus {
    border-color: #66b3ff;
}

.playlist-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.playlist-selector input[type="text"] {
    flex: 1;
    min-width: 250px;
}

#playlist-save-status,
#add-playlist-status {
    font-size: 13px;
    white-space: nowrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Q&A Section */
.qa-section {
    margin-top: 16px;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

body.dark-mode .qa-section {
    border-top-color: #3a3a3a;
}

.qa-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qa-pair {
    padding: 10px 14px;
    background-color: #fafafa;
    border-radius: 6px;
    border-left: 3px solid #1a73e8;
}

body.dark-mode .qa-pair {
    background-color: #2a2a2a;
    border-left-color: #66b3ff;
}

.qa-pair.qa-pending {
    opacity: 0.7;
}

.qa-question {
    font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 6px;
}

body.dark-mode .qa-question {
    color: #e0e0e0;
}

.qa-answer {
    font-size: 14px;
    line-height: 1.6;
    color: #3a3a3a;
}

body.dark-mode .qa-answer {
    color: #c8c8c8;
}

.qa-spinner {
    font-style: italic;
    color: #999;
    animation: qa-pulse 1.5s ease-in-out infinite;
}

@keyframes qa-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.qa-input-container {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.qa-question-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.qa-question-input:focus {
    outline: none;
    border-color: #1a73e8;
}

body.dark-mode .qa-question-input {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border-color: #4a4a4a;
}

body.dark-mode .qa-question-input:focus {
    border-color: #66b3ff;
}

.btn-qa-submit {
    padding: 8px 16px;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-qa-submit:hover:not(:disabled) {
    background-color: #1557b0;
}

.btn-qa-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-qa-cancel {
    padding: 8px 12px;
    background-color: #f0f0f0;
    color: #5f6368;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-qa-cancel:hover {
    background-color: #e0e0e0;
}

body.dark-mode .btn-qa-cancel {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border-color: #4a4a4a;
}

body.dark-mode .btn-qa-cancel:hover {
    background-color: #4a4a4a;
}

.btn-ask {
    background-color: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 32px;
    height: 28px;
    color: #5f6368;
}

.btn-ask:hover {
    background-color: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
    transform: scale(1.1);
}

body.dark-mode .btn-ask {
    background-color: #3a3a3a;
    border-color: #4a4a4a;
    color: #e0e0e0;
}

body.dark-mode .btn-ask:hover {
    background-color: #2a3a4a;
    border-color: #66b3ff;
    color: #66b3ff;
}

.video-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* Swipe card wrapper */
.video-card-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.swipe-action-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s, visibility 0.1s;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.swipe-delete-bg {
    background: #dc3545;
    color: white;
    justify-content: flex-end;
    padding-right: 40px;
}

.swipe-archive-bg {
    background: #28a745;
    color: white;
    justify-content: flex-start;
    padding-left: 40px;
}

.video-card-wrapper .video-item {
    position: relative;
    z-index: 1;
    touch-action: pan-y;
    user-select: none;
}

.video-card-wrapper .video-item:hover {
    transform: none;
}

body.dark-mode .swipe-delete-bg {
    background: #a82030;
}

body.dark-mode .swipe-archive-bg {
    background: #1e7e34;
}

@media (max-width: 768px) {
    .video-item {
        flex-direction: column;
    }

    .video-thumbnail-section {
        width: 100%;
    }

    .video-thumbnail {
        width: 100%;
    }

    .video-content-columns {
        flex-direction: column;
        gap: 12px;
    }

    header {
        flex-direction: column;
        gap: 10px;
        padding: 12px 15px;
    }

    .header-left h1 {
        display: none;
    }

    #user-info {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .search-input {
        flex: 1;
        min-width: 0;
        width: auto;
        order: -1;
    }

    .commute-toggle-wrapper {
        order: -1;
        width: auto;
    }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .setting-row input[type="number"],
    .setting-row input[type="text"],
    .setting-row select {
        width: 100%;
    }

    .playlist-selector {
        width: 100%;
    }

    .playlist-selector input[type="text"] {
        min-width: 0;
    }

    #app {
        padding: 10px;
    }

    .qa-input-container {
        flex-wrap: wrap;
    }

    .qa-question-input {
        width: 100%;
    }
}

/* Update available banner */
#update-banner {
    background: #1a73e8;
    color: #fff;
    text-align: center;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

#update-banner a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

.dark-mode #update-banner {
    background: #394457;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #323232;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    pointer-events: none;
}

.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-error {
    background: #d93025;
}
