/* ==========================================================================
   wordlist-mobile.css — 연령별 필수 단어 모바일 레이어
   - 599px 이하 폰 폭에서만 활성. 600px 이상은 데스크톱 UI 유지.
   ========================================================================== */

#screen-wordlist .wlm-mobile-only {
  display: none !important;
}

@media screen and (max-width: 599px) {
  #screen-wordlist .nav-bar,
  #screen-wordlist .wl-main {
    display: none !important;
  }

  #screen-wordlist .wlm-mobile-only {
    display: block !important;
    min-height: 100vh;
    background: var(--bg-cream);
    padding-bottom: calc(92px + var(--safe-bottom));
  }

  #screen-wordlist .wlm-top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding-top: var(--safe-top);
  }
  #screen-wordlist .wlm-top-row {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    min-height: 46px;
    padding: 4px 12px 2px;
  }
  #screen-wordlist .wlm-top-back {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 22px;
    line-height: 1;
  }
  #screen-wordlist .wlm-top-back:active {
    background: var(--bg-cream);
  }
  #screen-wordlist .wlm-title {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
  }
  #screen-wordlist .wlm-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px 10px;
    min-height: 42px;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-cream);
  }
  #screen-wordlist .wlm-search:focus-within {
    background: #fff;
    border-color: var(--teal-dark);
    box-shadow: 0 0 0 3px rgba(21, 94, 117, 0.12);
  }
  #screen-wordlist .wlm-search-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
  }
  #screen-wordlist .wlm-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
  }
  #screen-wordlist .wlm-search-input::placeholder {
    color: var(--text-secondary);
    font-weight: 500;
  }
  #screen-wordlist .wlm-search-clear {
    width: 28px;
    height: 28px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.08);
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    padding: 0;
    font-family: inherit;
  }

  #screen-wordlist .wlm-body {
    padding: 10px 12px 14px;
  }
  #screen-wordlist .wlm-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 2px 2px 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
  }
  #screen-wordlist .wlm-summary strong {
    color: var(--teal-dark);
  }
  #screen-wordlist .wlm-section {
    margin-bottom: 14px;
  }
  #screen-wordlist .wlm-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 2px 8px;
  }
  #screen-wordlist .wlm-section-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--teal-dark);
  }
  #screen-wordlist .wlm-section-head p {
    margin: 3px 0 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
  }
  #screen-wordlist .wlm-status {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 2px 10px;
  }
  #screen-wordlist .wlm-status-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
  }
  #screen-wordlist .wlm-status-meta {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
  }
  #screen-wordlist .wlm-cat {
    margin-bottom: 14px;
  }
  #screen-wordlist .wlm-cat-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 2px 8px;
  }
  #screen-wordlist .wlm-cat-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--teal-dark);
  }
  #screen-wordlist .wlm-cat-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
  }
  #screen-wordlist .wlm-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  #screen-wordlist .wlm-card {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 7px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: inherit;
    text-align: center;
    cursor: pointer;
  }
  #screen-wordlist .wlm-card:active {
    border-color: var(--teal-dark);
    background: #EEF6FA;
  }
  #screen-wordlist .wlm-card-badge,
  #screen-wordlist .wlm-card-priority {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1.3;
    font-weight: 800;
    color: #fff;
  }
  #screen-wordlist .wlm-card-badge.priority-1 { background: #D84848; }
  #screen-wordlist .wlm-card-badge.priority-2 { background: #E8A020; }
  #screen-wordlist .wlm-card-badge.priority-3 { background: #7AB5A8; }
  #screen-wordlist .wlm-card-priority.wlm-priority-1 { background: #D84848; }
  #screen-wordlist .wlm-card-priority.wlm-priority-2 { background: #E8A020; }
  #screen-wordlist .wlm-card-priority.wlm-priority-3 { background: #7AB5A8; }
  #screen-wordlist .wlm-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 6px;
  }
  #screen-wordlist .wlm-card-image img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: contain;
  }
  #screen-wordlist .wlm-card-img,
  #screen-wordlist .wlm-card-fallback {
    width: 72px;
    height: 72px;
    margin: 0 auto 6px;
  }
  #screen-wordlist .wlm-card-img {
    display: block;
    object-fit: contain;
  }
  #screen-wordlist .wlm-card-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
  }
  #screen-wordlist .wlm-card-fallback svg {
    width: 72px;
    height: 72px;
    display: block;
  }
  #screen-wordlist .wlm-card-name {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }
  #screen-wordlist .wlm-card-meta {
    min-height: 26px;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-secondary);
    word-break: keep-all;
  }
  #screen-wordlist .wlm-empty {
    padding: 70px 20px;
    text-align: center;
    color: var(--text-secondary);
  }
  #screen-wordlist .wlm-empty-icon {
    font-size: 36px;
    margin-bottom: 10px;
  }
  #screen-wordlist .wlm-empty-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
  }

  #screen-wordlist .wlm-bottom-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 12px 14px 16px;
    padding-bottom: calc(16px + var(--safe-bottom));
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
  }
  #screen-wordlist .wlm-dock-trigger {
    min-width: 0;
    min-height: 56px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px;
    border: 1px solid var(--teal-dark);
    border-radius: var(--radius-md);
    background: var(--teal-dark);
    color: #fff;
    font-family: inherit;
    text-align: center;
  }
  #screen-wordlist .wlm-dock-trigger:active {
    filter: brightness(0.92);
  }
  #screen-wordlist .wlm-dock-label {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.72;
    line-height: 1;
  }
  #screen-wordlist .wlm-dock-value {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.1;
  }

  #screen-wordlist .wlm-sheet-list {
    padding: 8px 12px 16px;
  }
  #screen-wordlist .wlm-option {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin: 4px 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
  }
  #screen-wordlist .wlm-option.is-active {
    background: #EEF6FA;
    border-color: var(--teal-dark);
  }
  #screen-wordlist .wlm-option-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 15px;
    font-weight: 800;
  }
  #screen-wordlist .wlm-option-title {
    font-size: 15px;
    font-weight: 800;
  }
  #screen-wordlist .wlm-option-sub {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
  }
  #screen-wordlist .wlm-option-count {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--teal-dark);
  }

  #screen-wordlist .wlm-detail-sheet {
    max-height: 86vh;
  }
  #screen-wordlist .wlm-detail-body {
    padding: 14px 18px 24px;
  }
  #screen-wordlist .wlm-detail-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding-bottom: 14px;
  }
  #screen-wordlist .wlm-detail-visual img,
  #screen-wordlist .wlm-detail-visual .wlm-detail-fallback {
    width: 112px;
    height: 112px;
  }
  #screen-wordlist .wlm-detail-visual img {
    display: block;
    object-fit: contain;
  }
  #screen-wordlist .wlm-detail-info {
    min-width: 0;
  }
  #screen-wordlist .wlm-detail-kicker {
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    word-break: keep-all;
  }
  #screen-wordlist .wlm-detail-info h3 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 850;
    line-height: 1.2;
    color: var(--text-primary);
    word-break: keep-all;
  }
  #screen-wordlist .wlm-detail-info .wlm-detail-priority {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-top: 0;
    padding: 4px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
  }
  #screen-wordlist .wlm-detail-info .wlm-detail-priority.wlm-priority-1 { background: #D84848; }
  #screen-wordlist .wlm-detail-info .wlm-detail-priority.wlm-priority-2 { background: #E8A020; }
  #screen-wordlist .wlm-detail-info .wlm-detail-priority.wlm-priority-3 { background: #7AB5A8; }
  #screen-wordlist .wlm-detail-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-bottom: 14px;
  }
  #screen-wordlist .wlm-detail-img,
  #screen-wordlist .wlm-detail-fallback {
    width: 156px;
    height: 156px;
  }
  #screen-wordlist .wlm-detail-img {
    object-fit: contain;
  }
  #screen-wordlist .wlm-detail-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
  }
  #screen-wordlist .wlm-detail-fallback svg {
    width: 112px;
    height: 112px;
    display: block;
  }
  #screen-wordlist .wlm-detail-name {
    font-size: 24px;
    font-weight: 850;
    color: var(--text-primary);
    line-height: 1.2;
    text-align: center;
  }
  #screen-wordlist .wlm-detail-meta {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
  }
  #screen-wordlist .wlm-detail-priority {
    margin-top: 4px;
    padding: 12px 14px 14px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--teal-dark);
    background: var(--bg-cream);
  }
  #screen-wordlist .wlm-detail-priority.priority-1 {
    background: #FEF2F2;
    border-left-color: #D84848;
  }
  #screen-wordlist .wlm-detail-priority.priority-2 {
    background: #FFFBEB;
    border-left-color: #E8A020;
  }
  #screen-wordlist .wlm-detail-priority.priority-3 {
    background: #F0FDFA;
    border-left-color: #7AB5A8;
  }
  #screen-wordlist .wlm-detail-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
  }
  #screen-wordlist .wlm-detail-badge.priority-1 { background: #D84848; }
  #screen-wordlist .wlm-detail-badge.priority-2 { background: #E8A020; }
  #screen-wordlist .wlm-detail-badge.priority-3 { background: #7AB5A8; }
  #screen-wordlist .wlm-detail-reason {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-cream);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-primary);
    word-break: keep-all;
  }
  #screen-wordlist .wlm-detail-reason h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 850;
    color: var(--teal-dark);
  }
  #screen-wordlist .wlm-detail-reason p {
    margin: 0;
  }
}

@media screen and (min-width: 600px) and (max-width: 899px) {
  #screen-wordlist .wlm-body {
    max-width: 940px;
    margin: 0 auto;
    padding: 14px 20px 24px;
  }
  #screen-wordlist .wlm-card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
  }
  #screen-wordlist .wlm-card {
    min-height: 146px;
  }
  #screen-wordlist .wlm-cat-name,
  #screen-wordlist .wlm-status-title {
    font-size: 18px;
  }
  #screen-wordlist .wlm-bottom-dock {
    left: 50%;
    right: auto;
    width: min(920px, calc(100vw - 32px));
    transform: translateX(-50%);
    border-radius: 18px 18px 0 0;
  }
}
