/* style.css */

/* ============================================================
   Base
   ============================================================ */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 20px;
    color: #333;
}

header {
    margin-bottom: 20px;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

header>p {
    color: #7f8c8d;
    margin-top: 0;
}

/* ============================================================
   Brand Dropdown
   ============================================================ */
.brand-dropdown {
    position: relative;
}

.brand-btn {
    background: #00a39f;
    border: none;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 163, 159, 0.3);
    white-space: nowrap;
    /* Prevent text wrapping */
}

.brand-btn::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid white;
    margin-right: 2px;
    border-radius: 1px;
}

.brand-btn:hover {
    background: #008581;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 163, 159, 0.4);
}

/* ============================================================
   Header Toolbar (icon buttons)
   ============================================================ */
.header-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 60;
}

.toolbar-icon-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.toolbar-icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.notification-btn {
    position: relative;
}

.notification-badge {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    border: 2px solid #0f172a;
    border-radius: 50%;
    background: #ff4d4f;
    box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.2);
}

.notification-btn.has-unread .notification-badge {
    display: block;
}

.brand-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: white;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    z-index: 100;
    text-align: left;
}

.brand-dropdown.active .brand-menu {
    display: block;
}

.brand-menu a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.brand-menu a:last-child {
    border-bottom: none;
}

.brand-menu-action {
    display: block;
    width: 100%;
    padding: 12px 16px;
    color: #333;
    background: white;
    border: none;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: normal;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.brand-menu a:hover {
    background: #f8f9fa;
    color: #00a39f;
    /* Brand color */
}

.brand-menu-action:hover {
    background: #f8f9fa;
    color: #00a39f;
}

@media (max-width: 768px) {
    .brand-dropdown {
        position: static;
        display: inline-block;
        margin-bottom: 10px;
    }
}

/* ============================================================
   Auth Bar
   ============================================================ */
.auth-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

#auth-logged-in {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s, box-shadow 0.3s;
}

.auth-btn:hover {
    background: #f8f8f8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-btn-small {
    padding: 5px 12px;
    font-size: 0.8rem;
    color: #888;
}

.google-icon {
    width: 18px;
    height: 18px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* ============================================================
   Controls
   ============================================================ */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* === Search toggle (Unified) === */
.search-wrapper {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
    width: 100%;
}

.search-wrapper.active {
    max-height: 60px;
    opacity: 1;
    margin-bottom: 15px;
    padding-top: 10px;
}

input[type="text"] {
    width: 100%;
    max-width: 500px;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 1rem;
}

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 8px 18px;
    border: none;
    background-color: #ecf0f1;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    overflow: visible;
}

.filter-btn:hover {
    background-color: #d5dbdb;
}

.filter-btn.active {
    background-color: #00a39f;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 163, 159, 0.3);
}

.filter-btn-free::after {
    content: attr(data-free-label);
    position: absolute;
    top: -7px;
    right: -6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fff4bf, #ffd166);
    color: #5b4300;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(91, 67, 0, 0.22);
    pointer-events: none;
}

.filter-btn-free.hide-free-badge::after {
    display: none;
}

/* ============================================================
   Grid Layout
   ============================================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card.locked {
    opacity: 0.85;
}

.card.locked:hover {
    transform: translateY(-3px);
}

/* ============================================================
   Thumbnails
   ============================================================ */
.thumbnail {
    height: 150px;
    background-color: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card.locked .thumbnail img {
    filter: blur(2px) brightness(0.6);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover .play-icon {
    opacity: 1;
}

.lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* ============================================================
   Card Content
   ============================================================ */
.card-content {
    padding: 15px;
}

.card-content h3 {
    margin: 0 0 10px;
    color: #2c3e50;
}

.card-content .meaning {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.premium-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 5px;
}

/* Core image hint */
.core-hint {
    display: block;
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: #95a5a6;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Card action button (visible only in list mode on mobile) */
.card-action {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    min-width: 44px;
    color: #00a39f;
}

/* ============================================================
   Similar Verb Column
   ============================================================ */
.hikaku-column-grid {
    display: block;
}

.hikaku-series-grid {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    align-items: stretch;
}

.hikaku-series-card {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    grid-template-areas: "thumb copy";
    gap: 12px;
    width: 100%;
    min-height: 0;
    padding: 12px;
    border: 1px solid rgba(0, 163, 159, 0.18);
    border-radius: 18px;
    background:
        radial-gradient(circle at 0 0, rgba(45, 212, 191, 0.12), transparent 34%),
        linear-gradient(135deg, #172235, #111a2a);
    color: #e2e8f0;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.18);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    align-items: center;
}

.hikaku-series-card:hover {
    transform: translateY(-2px);
    border-color: rgba(45, 212, 191, 0.48);
    box-shadow: 0 16px 30px rgba(2, 8, 23, 0.26);
}

.hikaku-series-card.coming-soon {
    cursor: default;
    border-style: dashed;
    opacity: 0.88;
}

.hikaku-series-card.coming-soon:hover {
    transform: none;
    border-color: rgba(0, 163, 159, 0.18);
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.18);
}

.hikaku-series-thumb {
    grid-area: thumb;
    position: relative;
    align-self: center;
    aspect-ratio: 4 / 3;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #050b14;
}

.hikaku-series-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    filter: brightness(0.86);
}

.hikaku-series-card.locked .hikaku-series-thumb img {
    filter: blur(1px) brightness(0.7);
}

.hikaku-series-thumb .hikaku-lock-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 6px 9px;
    font-size: 0.68rem;
}

.hikaku-coming-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, #94a3b8, #475569);
    color: #f8fafc;
    font-size: 0.68rem;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.hikaku-series-card.coming-soon .hikaku-series-thumb img {
    filter: grayscale(0.35) brightness(0.58);
}

.hikaku-series-copy {
    grid-area: copy;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.hikaku-series-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hikaku-series-copy strong {
    color: #ffffff;
    font-size: 1.22rem;
    font-weight: 900;
    line-height: 1.18;
    letter-spacing: -0.03em;
}

.hikaku-series-copy span:not(.hikaku-eyebrow) {
    color: #cbd5e1;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.5;
}

.hikaku-series-copy em {
    width: fit-content;
    margin-top: 2px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.12);
    color: #5eead4;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 900;
}

.hikaku-series-cta {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.12);
    color: #2dd4bf;
    font-size: 0.72rem;
    font-weight: 900;
}

.hikaku-series-modal-content {
    max-width: 980px;
    padding: 14px;
    background: transparent;
    box-shadow: none;
}

.hikaku-series-modal-content .close-hikaku-series {
    color: #e2e8f0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.hikaku-series-modal-content .close-hikaku-series:hover {
    color: #ffffff;
}

.hikaku-column {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    text-align: left;
    box-sizing: border-box;
}

.hikaku-column-hero {
    display: grid;
    gap: 18px;
    padding: 24px;
    box-sizing: border-box;
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: 26px;
    background:
        radial-gradient(circle at 12% 12%, rgba(45, 212, 191, 0.22), transparent 32%),
        linear-gradient(135deg, #102033, #18243a 56%, #102033);
    color: #e2e8f0;
    box-shadow: 0 18px 46px rgba(2, 8, 23, 0.26);
}

.hikaku-column-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.hikaku-eyebrow {
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.16);
    color: #5eead4;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.hikaku-column-copy h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.85rem, 4vw, 3.2rem);
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.hikaku-column-copy p {
    margin: 0;
    color: #cbd5e1;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.7;
}

.hikaku-main-video {
    position: relative;
    width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 9;
    align-self: center;
    max-width: 760px;
    margin: 0 auto;
    padding: 0;
    border: 1px solid rgba(45, 212, 191, 0.22);
    border-radius: 20px;
    background: #050b14;
    color: inherit;
    overflow: hidden;
    cursor: pointer;
}

.hikaku-main-video img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #050b14;
}

.hikaku-main-video.locked img {
    filter: blur(1px) brightness(0.72);
}

.hikaku-main-overlay {
    position: absolute;
    inset: auto 16px 16px auto;
}

.hikaku-lock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 13px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
    font-size: 0.82rem;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.hikaku-open-badge {
    background: linear-gradient(135deg, #2dd4bf, #00a39f);
    color: #062c2a;
}

.hikaku-inline-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 860px;
    width: 100%;
    margin: 2px auto 0;
}

.hikaku-inline-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas:
        "thumb copy"
        "thumb action";
    gap: 8px 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(45, 212, 191, 0.16);
    border-radius: 15px;
    background: rgba(15, 23, 42, 0.42);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.hikaku-inline-card:hover {
    transform: translateY(-2px);
    border-color: rgba(45, 212, 191, 0.42);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

.hikaku-inline-card img {
    grid-area: thumb;
    width: 96px;
    height: 58px;
    border-radius: 11px;
    object-fit: cover;
    background: #050b14;
}

.hikaku-inline-card.locked img {
    filter: blur(1px) brightness(0.78);
}

.hikaku-inline-copy {
    grid-area: copy;
    display: grid;
    gap: 4px;
    min-width: 0;
}

.hikaku-inline-copy strong {
    color: #5eead4;
    font-size: 1.02rem;
    font-weight: 900;
}

.hikaku-inline-copy span {
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
}

.hikaku-inline-action {
    grid-area: action;
    justify-self: start;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.12);
    color: #2dd4bf;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

/* ============================================================
   Video Modal
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

#combination-modal {
    z-index: 1100;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    /* Allow max 90% of screen height */
    overflow-y: auto;
    /* Enable vertical scrolling */
    position: relative;
    text-align: center;
}

.close,
.close-purchase,
.close-combination,
.close-announcements,
.close-survey,
.close-hikaku-series {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

.close:hover,
.close-purchase:hover,
.close-combination:hover,
.close-announcements:hover,
.close-survey:hover,
.close-hikaku-series:hover,
.close-settings:hover {
    color: black;
}

.announcements-modal-content {
    max-width: 560px;
    text-align: left;
}

.announcement-modal-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.announcement-modal-actions .close-announcements {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    line-height: 1;
}

.announcement-history-toggle {
    border: 1px solid rgba(0, 163, 159, 0.24);
    border-radius: 999px;
    padding: 7px 13px;
    background: rgba(0, 163, 159, 0.08);
    color: #007f7b;
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
}

.announcement-history-toggle[aria-pressed="true"] {
    background: #00a39f;
    color: #fff;
    border-color: #00a39f;
}

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

.announcement-item {
    position: relative;
    padding: 14px;
    padding-right: 42px;
    border: 1px solid rgba(0, 163, 159, 0.16);
    border-radius: 16px;
    background: rgba(0, 163, 159, 0.04);
}

.announcement-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.08);
    color: #64748b;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.announcement-dismiss:hover {
    background: rgba(239, 68, 68, 0.14);
    color: #ef4444;
}

.announcement-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.announcement-tag {
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(0, 163, 159, 0.12);
    color: #007f7b;
    font-size: 0.72rem;
    font-weight: 900;
}

.announcement-item time {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
}

.announcement-item h3 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 1rem;
    line-height: 1.35;
}

.announcement-item p {
    margin: 0;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.65;
}

.announcement-action {
    margin-top: 12px;
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #00a39f, #0284c7);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 163, 159, 0.22);
}

.announcement-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 163, 159, 0.28);
}

.announcements-empty {
    padding: 20px;
    border: 1px dashed rgba(100, 116, 139, 0.35);
    border-radius: 16px;
    color: #64748b;
    font-size: 0.92rem;
    font-weight: 800;
    text-align: center;
}

.btn-danger {
    background-color: #e74c3c !important;
    color: white !important;
    border-color: #c0392b !important;
}

.btn-danger:hover {
    background-color: #c0392b !important;
}

.survey-modal-content {
    max-width: 560px;
    text-align: left;
}

.survey-body {
    display: grid;
    gap: 14px;
}

.survey-desc {
    margin: 0;
    color: #475569;
    font-weight: 700;
    line-height: 1.7;
}

.survey-rating {
    display: flex;
    gap: 8px;
}

.survey-rating button {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 14px;
    background: #fff7ed;
    color: #d6a24b;
    font-size: 1.35rem;
    cursor: pointer;
}

.survey-rating button.active {
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    color: #4b3500;
    border-color: rgba(245, 158, 11, 0.55);
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.22);
}

.survey-body textarea,
.page-feedback-form textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    resize: vertical;
    font: inherit;
    line-height: 1.6;
    box-sizing: border-box;
}

.feedback-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.feedback-status {
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 800;
}

.feedback-status[data-type="success"] {
    color: #059669;
}

.feedback-status[data-type="error"] {
    color: #dc2626;
}

.feedback-submit-btn {
    border: none;
    border-radius: 999px;
    padding: 9px 18px;
    background: #00a39f;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.feedback-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

/* Settings Modal Specifics */
.settings-body {
    padding: 10px 0;
    text-align: left;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.settings-label {
    font-weight: bold;
    font-size: 1rem;
}

.account-settings-item {
    gap: 12px;
}

.account-status {
    text-align: left;
}

.status-mini {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    text-align: right;
}

.settings-version {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #999;
    text-align: center;
}

.close-settings {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

video {
    width: 100%;
    max-height: 500px;
    border-radius: 5px;
    margin-bottom: 15px;
    background: black;
}

#modal-title {
    margin-top: 0;
}

#modal-desc {
    font-size: 1.1rem;
    color: #e67e22;
    font-weight: bold;
}

.combination-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 14px;
    padding: 9px 14px;
    border: 1px solid rgba(0, 163, 159, 0.35);
    border-radius: 18px;
    background: rgba(0, 163, 159, 0.08);
    color: #007f7b;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.combination-inline-btn:hover {
    border-color: rgba(0, 163, 159, 0.65);
    box-shadow: 0 4px 12px rgba(0, 163, 159, 0.14);
    transform: translateY(-1px);
}

.composition-container {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #dbe8e6;
    border-radius: 10px;
    background: linear-gradient(135deg, #f7fffd, #fffaf1);
    text-align: left;
}

.composition-container h3 {
    margin: 0 0 12px;
    color: #00a39f;
    font-size: 1.1rem;
}

.composition-equation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.2fr);
    gap: 10px;
    align-items: stretch;
}

.composition-part,
.composition-result {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 163, 159, 0.18);
}

.composition-part[data-link-id] {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.composition-part[data-link-id]::after {
    content: "動画でイメージを見る";
    margin-top: 2px;
    color: #00a39f;
    font-size: 0.76rem;
    font-weight: 800;
}

.composition-part[data-link-id]:hover,
.composition-part[data-link-id]:focus-visible {
    border-color: rgba(0, 163, 159, 0.58);
    box-shadow: 0 4px 14px rgba(0, 163, 159, 0.16);
    outline: none;
    transform: translateY(-1px);
}

.composition-result {
    background: rgba(0, 163, 159, 0.08);
    border-color: rgba(0, 163, 159, 0.32);
}

.composition-label {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.composition-part strong,
.composition-result strong {
    color: #0f172a;
    font-size: 1.05rem;
}

.composition-part span:last-child {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.45;
}

.composition-operator {
    align-self: center;
    color: #00a39f;
    font-size: 1.45rem;
    font-weight: 800;
}

.composition-note {
    margin: 12px 0 0;
    color: #7c4a03;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.55;
}

.related-container {
    margin-top: 18px;
    padding: 16px 16px 18px;
    border: 1px solid rgba(0, 163, 159, 0.22);
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(0, 163, 159, 0.16), transparent 34%),
        linear-gradient(135deg, #f6fffd, #fffdf5);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    text-align: left;
}

.related-container h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: #0f766e;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.related-container h3::before {
    content: "↗";
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #00a39f;
    color: white;
    font-size: 0.86rem;
    font-weight: 900;
    box-shadow: 0 5px 12px rgba(0, 163, 159, 0.25);
}

.related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "word action"
        "meaning meaning";
    gap: 5px 10px;
    align-items: start;
    min-width: min(100%, 210px);
    flex: 1 1 210px;
    padding: 12px 13px;
    border: 1px solid rgba(0, 163, 159, 0.18);
    border-radius: 15px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(241, 255, 252, 0.86));
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.related-item:hover,
.related-item:focus-visible {
    border-color: rgba(0, 163, 159, 0.62);
    box-shadow: 0 10px 20px rgba(0, 163, 159, 0.16);
    outline: none;
    transform: translateY(-2px);
}

.related-word {
    grid-area: word;
    color: #0f172a;
    font-size: 1.02rem;
    font-weight: 900;
    line-height: 1.1;
}

.related-meaning {
    grid-area: meaning;
    color: #475569;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.45;
}

.related-action {
    grid-area: action;
    align-self: start;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.related-action-free {
    background: linear-gradient(135deg, #fff4bf, #ffd166);
    color: #5b4300;
    box-shadow: 0 2px 7px rgba(91, 67, 0, 0.18);
}

.related-action-premium {
    background: rgba(0, 163, 159, 0.11);
    color: #008b87;
}

.related-action-watch {
    background: rgba(0, 163, 159, 0.11);
    color: #008b87;
}

/* ============================================================
   Purchase Modal
   ============================================================ */
.purchase-modal-content {
    max-width: 500px;
    padding: 40px 30px;
}

.install-modal-content {
    max-width: 520px;
    padding: 28px 24px;
}

.install-body {
    text-align: left;
}

.install-intro {
    color: #555;
    line-height: 1.7;
    margin-bottom: 16px;
}

.install-status {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #eefaf8;
    color: #0f766e;
    font-weight: bold;
}

.install-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #eee;
}

.install-section h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
}

.combination-modal-content {
    max-width: 1040px;
}

.combination-body {
    text-align: left;
}

.combination-picker {
    display: flex;
    align-items: end;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.combination-select-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.combination-select-block label,
.operand-label {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.combination-select-block select {
    min-width: 140px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: white;
    color: #1e293b;
    font-size: 0.92rem;
    font-weight: 700;
}

.combination-symbol {
    padding-bottom: 8px;
    color: #00a39f;
    font-size: 1.25rem;
    font-weight: 900;
}

.combo-summary {
    min-width: 150px;
    padding: 8px 12px;
    border-radius: 16px;
    background: rgba(0, 163, 159, 0.1);
    color: #007f7b;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
}

.combination-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.operand-panel {
    padding: 14px;
    border: 1px solid #dbe8e6;
    border-radius: 10px;
    background: #f8fffd;
}

.operand-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.operand-header strong {
    color: #0f172a;
    font-size: 1.2rem;
}

.operand-panel video {
    max-height: 220px;
    margin-bottom: 10px;
}

.operand-desc {
    margin: 0;
    color: #475569;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.55;
}

.combination-results-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.combination-results-section h3 {
    margin: 0 0 12px;
    color: #00a39f;
}

.combo-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.combo-result-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    border: 1px solid #dbe8e6;
    border-radius: 10px;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.combo-result-item:hover {
    border-color: rgba(0, 163, 159, 0.55);
    box-shadow: 0 4px 14px rgba(0, 163, 159, 0.14);
    transform: translateY(-1px);
}

.combo-result-word {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
}

.combo-result-meaning {
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.45;
}

.combo-result-action {
    color: #00a39f;
    font-size: 0.78rem;
    font-weight: 800;
}

.combo-empty {
    margin: 0;
    color: #64748b;
    font-weight: 700;
}

.install-section p {
    margin: 0 0 10px 0;
    color: #555;
    line-height: 1.7;
}

.install-primary-btn {
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    background: #00a39f;
    color: white;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
}

.install-primary-btn:hover {
    background: #008b87;
}

.install-steps {
    margin: 0;
    padding-left: 1.4rem;
    color: #333;
    line-height: 1.8;
}

.purchase-desc {
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
}

.price-tag {
    font-size: 2.5rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 5px;
}

.price-note {
    font-size: 0.9rem;
    color: #888;
    font-weight: normal;
}

.purchase-features {
    text-align: left;
    max-width: 300px;
    margin: 20px auto;
}

.feature {
    padding: 6px 0;
    font-size: 0.95rem;
}

.purchase-btn {
    display: inline-block;
    background: linear-gradient(135deg, #00a39f, #008581);
    /* Brand color gradient */
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 20px 0;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.purchase-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 163, 159, 0.4);
    /* Brand color shadow */
}

.purchase-note {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 15px;
}

.purchase-note a {
    color: #999;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
    text-align: center;
    padding: 40px 0 20px;
    font-size: 0.85rem;
}

footer a {
    color: #999;
    text-decoration: none;
}

footer a:hover {
    color: #555;
}

/* ============================================================
   Dark Mode
   ============================================================ */
.dark-mode-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #f39c12;
    /* Sun/Moon color */
    transition: transform 0.3s;
}

.dark-mode-btn:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .dark-mode-btn {
        position: static;
        display: inline-block;
        margin-left: 10px;
        vertical-align: top;
    }
}

body.dark-mode {
    background-color: #0f172a;
    color: #e2e8f0;
}

body.dark-mode h1 {
    color: #fff;
}

body.dark-mode header>p {
    color: #94a3b8;
}

body.dark-mode .card,
body.dark-mode .modal-content,
body.dark-mode .auth-btn,
body.dark-mode .brand-menu {
    background-color: #1e293b;
    color: #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    border-color: #334155;
}

body.dark-mode .card-content h3 {
    color: #e2e8f0;
}

body.dark-mode .card-content .meaning {
    color: #94a3b8;
}

body.dark-mode .core-hint {
    color: #64748b;
}

body.dark-mode .card-action {
    color: #00a39f;
}

body.dark-mode .card.locked .card-action {
    color: #e74c3c;
}

body.dark-mode .hikaku-eyebrow {
    background: rgba(45, 212, 191, 0.12);
    color: #5eead4;
}

@media (max-width: 600px) {
    body.dark-mode .card {
        border-bottom-color: rgba(255, 255, 255, 0.06);
        box-shadow: none;
    }

    body.dark-mode .card:hover {
        background: rgba(0, 163, 159, 0.08);
    }
}

body.dark-mode .filter-btn {
    background-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .combination-select-block label,
body.dark-mode .operand-label {
    color: #94a3b8;
}

body.dark-mode .combination-select-block select {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-mode .combo-summary {
    background: rgba(45, 212, 191, 0.14);
    color: #5eead4;
}

body.dark-mode .combination-inline-btn {
    background: rgba(45, 212, 191, 0.12);
    border-color: rgba(45, 212, 191, 0.42);
    color: #5eead4;
}

body.dark-mode .operand-panel,
body.dark-mode .combo-result-item {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .operand-header strong,
body.dark-mode .combo-result-word {
    color: #e2e8f0;
}

body.dark-mode .operand-desc,
body.dark-mode .combo-result-meaning,
body.dark-mode .combo-empty {
    color: #94a3b8;
}

body.dark-mode .combination-results-section {
    border-top-color: #334155;
}

body.dark-mode .filter-btn:hover,
body.dark-mode .filter-btn.active {
    background-color: #00a39f;
    /* Brand color */
    color: white;
}

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

    .hikaku-column-hero {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 18px;
        border-radius: 20px;
    }

    .hikaku-column-copy h2 {
        font-size: clamp(1.75rem, 7vw, 2.35rem);
    }

    .hikaku-column-copy p {
        font-size: 0.92rem;
    }

    .hikaku-main-video {
        min-height: 0;
    }

    .hikaku-inline-list {
        grid-template-columns: 1fr;
        gap: 9px;
    }
}

body.dark-mode .filter-btn-free::after {
    background: linear-gradient(135deg, #fff1a6, #f6c453);
    color: #4b3500;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

body.dark-mode .brand-menu a {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

body.dark-mode .brand-menu-action {
    color: #e2e8f0;
    background: #1e293b;
    border-bottom-color: #334155;
}

body.dark-mode .brand-menu a:hover {
    background: #334155;
    color: #00a39f;
}

body.dark-mode .brand-menu-action:hover {
    background: #334155;
    color: #00a39f;
}

body.dark-mode input[type="text"] {
    background-color: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

body.dark-mode .close,
body.dark-mode .close-purchase,
body.dark-mode .close-combination,
body.dark-mode .close-announcements,
body.dark-mode .close-survey {
    color: #888;
}

body.dark-mode .close:hover,
body.dark-mode .close-purchase:hover,
body.dark-mode .close-combination:hover,
body.dark-mode .close-announcements:hover,
body.dark-mode .close-survey:hover,
body.dark-mode .close-settings:hover {
    color: #fff;
}

body.dark-mode .announcement-item {
    background: rgba(15, 23, 42, 0.72);
    border-color: #334155;
}

body.dark-mode .announcement-tag {
    background: rgba(45, 212, 191, 0.12);
    color: #5eead4;
}

body.dark-mode .announcement-item time,
body.dark-mode .announcement-item p {
    color: #94a3b8;
}

body.dark-mode .announcement-item h3 {
    color: #e2e8f0;
}

body.dark-mode .announcement-action {
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    box-shadow: 0 8px 18px rgba(20, 184, 166, 0.18);
}

body.dark-mode .announcement-history-toggle {
    background: rgba(45, 212, 191, 0.12);
    border-color: rgba(45, 212, 191, 0.32);
    color: #2dd4bf;
}

body.dark-mode .announcement-history-toggle[aria-pressed="true"] {
    background: #14b8a6;
    border-color: #14b8a6;
    color: #062c2a;
}

body.dark-mode .announcement-dismiss {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

body.dark-mode .announcement-dismiss:hover {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

body.dark-mode .announcements-empty {
    border-color: #334155;
    color: #94a3b8;
}

body.dark-mode .notification-badge {
    border-color: #0f172a;
}

body.dark-mode .purchase-desc {
    color: #ccc;
}

body.dark-mode .install-intro,
body.dark-mode .install-section p {
    color: #cbd5e1;
}

body.dark-mode .install-section {
    border-top-color: #334155;
}

body.dark-mode .install-status {
    background: rgba(0, 163, 159, 0.18);
    color: #7dd3cf;
}

body.dark-mode .settings-item {
    border-bottom-color: #334155;
}

body.dark-mode .status-mini {
    color: #94a3b8;
}

body.dark-mode .settings-version {
    color: #64748b;
}

body.dark-mode .survey-desc,
body.dark-mode .feedback-status,
body.dark-mode .page-feedback-row label {
    color: #94a3b8;
}

body.dark-mode .survey-rating button {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.28);
    color: #facc15;
}

body.dark-mode .survey-rating button.active {
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    color: #4b3500;
}

body.dark-mode .survey-body textarea,
body.dark-mode .page-feedback-form textarea,
body.dark-mode .page-feedback-row select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .video-reaction-btn {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .video-reaction-btn[data-reaction="good"].active {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.24), rgba(45, 212, 191, 0.18));
    border-color: rgba(45, 212, 191, 0.48);
    color: #5eead4;
}

body.dark-mode .video-reaction-btn[data-reaction="bad"].active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(251, 191, 36, 0.14));
    border-color: rgba(251, 191, 36, 0.48);
    color: #facc15;
}

body.dark-mode .page-feedback-form {
    background: rgba(15, 23, 42, 0.58);
    border-color: #334155;
}

/* ============================================================
   Learning & Social Features
   ============================================================ */

/* Progress Tracker */
.progress-tracker {
    max-width: 1200px;
    margin: 0 auto 30px auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.progress-title {
    font-size: 1.1rem;
}

.progress-text {
    color: #00a39f;
    font-size: 1.1rem;
}

.progress-bar-bg {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00a39f, #00d6d0);
    border-radius: 6px;
    transition: width 0.5s ease-out;
}

/* Learned Badge on Card */
.card {
    position: relative;
}

.card.learned .thumbnail::after {
    content: "✅";
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.card.learned .card-content {
    background: #f8fafc;
}

/* Modal Examples Section */
.examples-container {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: left;
}

.examples-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #00a39f;
    font-size: 1.2rem;
}

.examples-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.examples-list li {
    margin-bottom: 15px;
    padding-left: 15px;
    border-left: 3px solid #00a39f;
}

.examples-list .ex-en {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    display: block;
}

.examples-list .ex-ja {
    color: #666;
    font-size: 0.95rem;
    display: block;
}

.page-feedback-container {
    margin-top: 12px;
    text-align: left;
}

.video-reaction-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: -4px 0 12px;
    text-align: left;
}

.video-reaction-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.video-reaction-btn {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    padding: 8px 16px;
    background: #fff;
    color: #334155;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.video-reaction-btn:hover {
    transform: translateY(-1px);
}

.video-reaction-btn[data-reaction="good"].active {
    background: linear-gradient(135deg, #ecfdf5, #ccfbf1);
    border-color: rgba(5, 150, 105, 0.45);
    color: #047857;
}

.video-reaction-btn[data-reaction="bad"].active {
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border-color: rgba(245, 158, 11, 0.52);
    color: #92400e;
}

.video-reaction-btn:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.page-feedback-form {
    margin-top: 10px;
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(0, 163, 159, 0.14);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.02);
}

.page-feedback-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.page-feedback-row label {
    color: #475569;
    font-size: 0.86rem;
    font-weight: 900;
}

.page-feedback-row select {
    min-width: 160px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 8px 10px;
    background: #fff;
    color: #0f172a;
    font-weight: 800;
}

/* Action Buttons (New Layout) */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-top-actions .close {
    position: static;
    margin-left: 10px;
    font-size: 28px;
    line-height: 1;
}

.action-btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-learned {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.btn-learned.active {
    background-color: #10b981;
    color: white;
    border-color: #10b981;
}

.btn-x-share {
    background-color: #000000;
    color: white;
}

.btn-x-share .btn-icon {
    font-family: sans-serif;
    font-size: 0.9rem;
}


/* Dark Mode Overrides for New Elements */
body.dark-mode .progress-tracker {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .progress-header {
    color: #e2e8f0;
}

body.dark-mode .progress-bar-bg {
    background: #334155;
}

body.dark-mode .card.learned .card-content {
    background: #1e293b;
    opacity: 0.8;
}

body.dark-mode .card.learned .thumbnail::after {
    background: #334155;
}

body.dark-mode .examples-container {
    border-top-color: #334155;
}

body.dark-mode .composition-container {
    background: linear-gradient(135deg, #142434, #201f2a);
    border-color: #334155;
}

body.dark-mode .composition-container h3 {
    color: #2dd4bf;
}

body.dark-mode .composition-part,
body.dark-mode .composition-result {
    background: rgba(15, 23, 42, 0.72);
    border-color: #334155;
}

body.dark-mode .composition-result {
    background: rgba(0, 163, 159, 0.14);
    border-color: rgba(45, 212, 191, 0.42);
}

body.dark-mode .composition-part[data-link-id]::after {
    color: #2dd4bf;
}

body.dark-mode .composition-part[data-link-id]:hover,
body.dark-mode .composition-part[data-link-id]:focus-visible {
    border-color: rgba(45, 212, 191, 0.62);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

body.dark-mode .composition-label,
body.dark-mode .composition-part span:last-child {
    color: #94a3b8;
}

body.dark-mode .composition-part strong,
body.dark-mode .composition-result strong {
    color: #e2e8f0;
}

body.dark-mode .composition-note {
    color: #facc15;
}

body.dark-mode .related-container {
    background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.18), transparent 34%),
        linear-gradient(135deg, #111c2d, #172033);
    border-color: rgba(45, 212, 191, 0.22);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

body.dark-mode .related-container h3 {
    color: #2dd4bf;
}

body.dark-mode .related-container h3::before {
    background: #2dd4bf;
    color: #07211f;
    box-shadow: 0 5px 12px rgba(45, 212, 191, 0.22);
}

body.dark-mode .related-item {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(22, 38, 55, 0.82));
    border-color: rgba(148, 163, 184, 0.22);
}

body.dark-mode .related-item:hover,
body.dark-mode .related-item:focus-visible {
    border-color: rgba(45, 212, 191, 0.62);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.36);
}

body.dark-mode .related-word {
    color: #e2e8f0;
}

body.dark-mode .related-meaning {
    color: #94a3b8;
}

body.dark-mode .related-action-free {
    background: linear-gradient(135deg, #fff1a6, #f6c453);
    color: #4b3500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}

body.dark-mode .related-action-premium {
    background: rgba(45, 212, 191, 0.12);
    color: #2dd4bf;
}

body.dark-mode .related-action-watch {
    background: rgba(45, 212, 191, 0.12);
    color: #2dd4bf;
}

body.dark-mode .examples-list .ex-en {
    color: #e2e8f0;
}

body.dark-mode .examples-list .ex-ja {
    color: #94a3b8;
}

body.dark-mode .modal-header {
    border-bottom-color: #334155;
}

body.dark-mode .btn-learned {
    background-color: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

body.dark-mode .btn-learned.active {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

/* ============================================================
   Mobile Responsiveness
   ============================================================ */
@media (max-width: 600px) {

    /* === Global === */
    body {
        padding: 10px;
    }

    /* === Sticky Header === */
    header {
        position: sticky;
        top: 0;
        z-index: 50;
        background: #f4f4f9;
        padding: 10px 0 5px;
        margin-bottom: 10px;
    }

    body.dark-mode header {
        background: #0f172a;
    }

    /* Hide title and subtitle on mobile */
    h1,
    header>p {
        display: none;
    }

    /* Hide desktop auth bar and settings button on mobile */
    .auth-bar,
    .dark-mode-btn {
        display: none !important;
    }

    /* Show header toolbar on mobile - already handled by flow */
    .header-toolbar {
        gap: 8px;
    }

    body.dark-mode .toolbar-icon-btn {
        border-color: #475569;
        color: #e2e8f0;
    }

    body.dark-mode .toolbar-icon-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .brand-dropdown {
        margin: 0;
    }

    .brand-btn {
        font-size: 0.8rem;
        padding: 6px 14px;
        border-radius: 20px;
        /* Pill style */
    }

    /* Remove desktop dark mode toggle (using toolbar instead) */
    #dark-mode-toggle {
        display: none;
    }

    /* === Search & Filters === */
    input[type="text"] {
        max-width: none;
        font-size: 0.9rem;
    }

    .search-wrapper.active {
        max-height: 70px;
    }

    .combination-modal-content {
        width: 95%;
        max-height: 90vh;
        padding: 16px 12px;
    }

    .combination-picker {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        grid-template-areas:
            "verb times particle"
            "summary summary summary";
        align-items: end;
        gap: 8px 6px;
        margin-bottom: 12px;
    }

    .combination-select-block:first-child {
        grid-area: verb;
    }

    .combination-select-block:nth-of-type(2) {
        grid-area: particle;
    }

    .combination-symbol {
        padding-bottom: 8px;
        font-size: 1rem;
        line-height: 1;
    }

    .combination-picker .combination-symbol:first-of-type {
        grid-area: times;
    }

    .combination-picker .combination-symbol:nth-of-type(2) {
        display: none;
    }

    .combo-summary {
        grid-area: summary;
        justify-self: stretch;
        padding-bottom: 0;
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    .combination-select-block select {
        width: 100%;
        min-width: 0;
        padding: 7px 9px;
        font-size: 0.84rem;
        border-radius: 12px;
    }

    .combination-select-block label,
    .operand-label {
        font-size: 0.66rem;
    }

    .combination-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 14px;
    }

    .operand-panel {
        padding: 10px;
        border-radius: 12px;
    }

    .operand-header {
        display: block;
        margin-bottom: 6px;
    }

    .operand-header strong {
        display: block;
        margin-top: 2px;
        font-size: 0.98rem;
    }

    .operand-panel video {
        max-height: 120px;
        margin-bottom: 6px;
    }

    .operand-desc {
        font-size: 0.74rem;
        line-height: 1.35;
    }

    .combination-results-section {
        padding-top: 12px;
    }

    .combination-results-section h3 {
        margin-bottom: 8px;
        font-size: 0.95rem;
    }

    .combo-results {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .combo-result-item {
        padding: 10px 11px;
        border-radius: 12px;
    }

    .combo-result-word {
        font-size: 0.96rem;
    }

    .combo-result-meaning {
        font-size: 0.8rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 10px;
    }

    /* Wrapping-style categories */
    .filters {
        flex-wrap: wrap;
        /* Changed from nowrap */
        padding-bottom: 4px;
        gap: 6px;
        justify-content: flex-start;
    }

    .filter-btn {
        flex: 0 1 auto;
        /* Simplified */
        padding: 6px 14px;
        font-size: 0.8rem;
        border-radius: 16px;
    }

    .filter-btn-free::after {
        top: -6px;
        right: -4px;
        padding: 2px 5px;
        font-size: 0.52rem;
    }

    .hikaku-series-card {
        grid-template-columns: 104px minmax(0, 1fr);
        grid-template-areas: "thumb copy";
        min-height: 0;
        padding: 10px;
        gap: 10px;
        border-radius: 16px;
    }

    .hikaku-series-copy strong {
        font-size: 1.05rem;
    }

    .hikaku-series-copy span:not(.hikaku-eyebrow) {
        font-size: 0.8rem;
    }

    .hikaku-series-copy em {
        font-size: 0.66rem;
    }

    .hikaku-series-cta {
        padding: 3px 7px;
        font-size: 0.66rem;
    }

    .hikaku-column-hero {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 18px;
        border-radius: 20px;
    }

    .hikaku-column-copy h2 {
        font-size: 1.75rem;
    }

    .hikaku-column-copy p {
        font-size: 0.92rem;
    }

    .hikaku-main-video {
        min-height: 0;
    }

    .hikaku-inline-list {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .hikaku-inline-card {
        grid-template-columns: 104px minmax(0, 1fr) auto;
        grid-template-areas: "thumb copy action";
        padding: 9px;
    }

    .hikaku-inline-card img {
        width: 104px;
        height: 62px;
    }

    .hikaku-inline-action {
        justify-self: end;
        font-size: 0.66rem;
    }

    .composition-equation {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .composition-operator {
        justify-self: center;
        line-height: 1;
    }

    .related-item {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "word action"
            "meaning action";
        flex-basis: 100%;
        gap: 4px 8px;
        padding: 10px 12px;
    }

    .related-action {
        align-self: center;
        justify-self: end;
        padding: 3px 6px;
        font-size: 0.66rem;
    }

    .related-word {
        font-size: 0.98rem;
    }

    .related-meaning {
        font-size: 0.8rem;
        line-height: 1.35;
    }

    /* === Auth === */
    .auth-bar {
        margin-bottom: 8px;
    }

    /* === Progress === */
    .progress-tracker {
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* ============================================
       COMPACT LIST VIEW — High density cards
       ============================================ */
    .grid {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .card {
        display: flex;
        flex-direction: row;
        align-items: center;
        border-radius: 8px;
        box-shadow: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        padding: 8px;
        gap: 10px;
    }

    .card:hover {
        transform: none;
        background: rgba(0, 163, 159, 0.04);
    }

    .card:active {
        background: rgba(0, 163, 159, 0.10);
    }

    /* Small square thumbnail */
    .thumbnail {
        width: 56px;
        height: 56px;
        min-width: 56px;
        border-radius: 8px;
        font-size: 1.5rem;
        flex-shrink: 0;
    }

    .thumbnail img {
        border-radius: 8px;
    }

    .play-icon,
    .lock-icon {
        font-size: 1.2rem;
    }

    /* Text content — fills remaining space */
    .card-content {
        flex: 1;
        padding: 0;
        min-width: 0;
    }

    .card-content h3 {
        font-size: 0.95rem;
        margin: 0 0 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .card-content .meaning {
        font-size: 0.8rem;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Show core-hint on mobile */
    .core-hint {
        display: block;
    }

    /* Show action button on mobile */
    .card-action {
        display: flex;
    }

    .card.locked .card-action {
        color: #e74c3c;
    }

    /* Learned card subtle indicator */
    .card.learned {
        border-left: 3px solid #10b981;
    }

    /* === Modal Adjustments === */
    .modal-content {
        padding: 15px 10px;
        width: 95%;
    }

    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .modal-top-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .modal-top-actions .close {
        position: absolute;
        top: 5px;
        right: 10px;
        margin-left: 0;
    }

    .action-btn-small {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}
