/* Shared, touch-friendly scope selector. */
.tag-picker { width: 100%; min-width: 0; max-width: 280px; margin: 0; }
.tag-picker .form-label { display:block; margin:0 0 4px; font-size: .75rem; font-weight:600; color:#78849b; }
.tag-picker select.form-select { box-sizing:border-box; display:block; width:100%; min-height:44px; padding:10px 36px 10px 14px; border:1px solid #e3ddf2; border-radius:12px; background-color:#f7f4fc; color:#62469a; font:inherit; font-size:16px; text-overflow:ellipsis; cursor:pointer; }
.tag-picker select:focus-visible { outline:3px solid #b9a4e6; outline-offset:2px; }
.tag-filter-form { width:240px; max-width:100%; min-width:0; margin:0; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
.page-heading h1 { margin:0; }
.learning-header .tag-filter-form { flex:1; max-width:240px; }
.learning-header .learning-stats { flex-shrink:0; }
.word-filter-toolbar { display:flex; flex-wrap:wrap; align-items:end; gap:12px; }
.word-filter-toolbar > .input-group { flex:1; min-width:240px; }
@media (max-width: 991px) {
 .learning-header .tag-filter-form { order:3; flex:0 0 100%; width:100%; max-width:none; }
 .learning-header .tag-picker { max-width:none; }
}
@media (max-width: 575px) {
 .tag-filter-form, .tag-picker { width:100%; max-width:none; }
 .learning-header .learning-title { font-size:1.5rem; }
 .word-filter-toolbar > .input-group { min-width:0; flex-basis:100%; }
 .page-heading .tag-filter-form { flex-basis:100%; }
}

#tagsInput { min-height:44px; border:1px solid #e3ddf2; border-radius:12px; background:#f7f4fc; color:#62469a; font-size:16px; }
form[method="post"] > .tag-picker { margin-bottom:20px; }

.card-with-context { border:1px solid #e7e2ef; border-radius:24px; overflow:hidden; }
.card-with-context .word-card { border:0; border-radius:0; box-shadow:none; }
.card-context { padding:0 24px 18px; background:#fff; }
.card-context:empty { display:none; }
.card-tag-list { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding-top:12px; }
.card-tag { display:inline-block; max-width:100%; overflow-wrap:anywhere; background:#f1edf8; color:#78628d; border:1px solid transparent; border-radius:20px; padding:5px 10px; font-size:.78rem; }
.card-tag.selected { background:#e9def9; color:#6844a4; border-color:#b9a0dc; font-weight:600; }
.more-card-tags summary { color:#7853ad; cursor:pointer; padding:10px; min-height:44px; }
.card-context select { max-width:100%; text-overflow:ellipsis; font-size:16px; }
@media(max-width:575px) { .card-context { padding:0 16px 16px; } }
