@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SignWriting&display=swap');

:root {
    --brand-primary: rgb(0, 189, 211);
    --brand-secondary: rgb(190, 88, 161);
    --ink: #18232c;
    --muted: #65727c;
    --line: #dce5e9;
    --surface: #fff;
    --soft: #f4fbfc;
    --font-heading: "Lexend", "Public Sans", "Noto Sans Hong Kong", "Noto Sans HK", sans-serif;
    --font-body: "Public Sans", "Noto Sans Hong Kong", "Noto Sans HK", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f7f8;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    letter-spacing: 0;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

.material-symbols-outlined {
    display: inline-block;
    font-family: "Material Symbols Outlined";
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    line-height: 1;
    vertical-align: middle;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

a {
    color: #087e8e;
}

.site-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 174px;
    padding: 28px max(24px, calc((100vw - 1240px) / 2));
    background: var(--surface);
    border-bottom: 4px solid var(--brand-primary);
}

.site-header::after {
    position: absolute;
    right: 0;
    bottom: -4px;
    width: 28%;
    height: 4px;
    background: var(--brand-secondary);
    content: "";
}

.logo-container {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
}

.logo-container img {
    width: 200px;
    max-height: 256px;
    object-fit: contain;
}

.heading-copy {
    flex: 1;
}

.heading-copy h1,
.panel-heading h2,
.results-toolbar h2,
.dialog-header h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.035em;
}

.heading-copy h1 {
    font-size: clamp(28px, 4vw, 42px);
}

.heading-copy > p:last-child {
    margin: 4px 0 0;
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 4px;
    color: #087e8e;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.schema-link {
    align-self: flex-start;
    margin-top: 5px;
    font-size: 13px;
    font-weight: 600;
}

.header-controls {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
}

.header-controls select {
    max-width: 180px;
    padding: 7px 9px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
}

main {
    width: min(1240px, calc(100% - 40px));
    margin: 30px auto 64px;
}

.site-footer {
    width: min(1240px, calc(100% - 40px));
    margin: -36px auto 24px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

html[lang="en-GB"] .acknowledgement-zh,
html[lang="zh-HK"] .acknowledgement-en {
    display: none;
}

.search-panel,
.results-section {
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 8px 28px rgb(24 35 44 / 4%);
}

.panel-heading,
.results-toolbar,
.result-controls,
.quick-search,
.query-toolbar,
.builder-actions,
.special-tools,
.pagination,
.dialog-header {
    display: flex;
    align-items: center;
}

.panel-heading,
.results-toolbar {
    justify-content: space-between;
    gap: 16px;
}

.panel-heading h2,
.results-toolbar h2 {
    font-size: 24px;
}

.text-link {
    font-size: 13px;
}

.local-badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef9fa;
    color: #087e8e;
    font-size: 12px;
    font-weight: 700;
}

.quick-search-label {
    display: block;
    margin: 20px 0 7px;
    font-size: 13px;
    font-weight: 700;
}

.quick-search {
    gap: 10px;
}

.quick-search input,
.filter-rule input,
.filter-rule select,
.query-toolbar select,
.result-controls select,
.glyph-search {
    min-width: 0;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid #cbd8dd;
    border-radius: 8px;
}

.quick-search input {
    flex: 1;
    min-height: 44px;
    font-size: 15px;
}

.quick-search input:focus,
.filter-rule input:focus,
.filter-rule select:focus,
select:focus,
.glyph-search:focus {
    outline: 3px solid rgb(0 189 211 / 20%);
    border-color: var(--brand-primary);
}

.button {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: background-color .15s ease, transform .15s ease;
}

.button .material-symbols-outlined {
    font-size: 18px;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    min-height: 44px;
    padding-inline: 22px;
    color: #06363d;
    background: var(--brand-primary);
}

.button-primary:hover {
    background: #28c8d9;
}

.button-secondary {
    color: #fff;
    background: var(--brand-secondary);
}

.button-quiet {
    color: #34434c;
    background: #f4f7f8;
    border-color: var(--line);
}

.advanced-search {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.advanced-search > summary {
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
}

.summary-hint {
    margin-left: 8px;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 400;
}

.query-toolbar {
    gap: 9px;
    margin: 15px 0 10px;
    font-size: 13px;
}

.query-toolbar select {
    padding: 7px 10px;
    font-size: 12px;
}

.filter-groups {
    display: grid;
    gap: 10px;
}

.filter-group {
    min-width: 0;
    padding: 12px;
    background: #f7fafb;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.filter-group.nested {
    margin: 8px 0 0 12px;
    background: #fff;
    border-left: 3px solid var(--brand-secondary);
}

.group-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.group-heading label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.group-heading select {
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
}

.group-heading .remove-group {
    margin-left: auto;
}

.filter-rule {
    display: grid;
    grid-template-columns: minmax(190px, 1.5fr) minmax(126px, .8fr) minmax(130px, 1fr) auto auto;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
}

.filter-rule input,
.filter-rule select {
    width: 100%;
    padding: 8px 9px;
    font-size: 12px;
}

.filter-rule select[data-field] {
    text-overflow: ellipsis;
}

.field-help {
    width: 20px;
    height: 20px;
    padding: 0;
    color: #53646e;
    background: #eaf0f2;
    border: 0;
    border-radius: 50%;
    font-size: 12px;
}

.rule-remove,
.remove-group {
    padding: 4px 8px;
    color: #7b444c;
    background: transparent;
    border: 0;
    font-size: 12px;
}

.special-rule {
    display: none;
    grid-column: 1 / -1;
    align-items: center;
    gap: 8px;
    padding-left: 3px;
}

.special-rule.visible {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
}

.special-picker-panel {
    grid-column: 1 / -1;
    min-width: 0;
    padding: 13px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
}

.special-picker-panel[hidden] {
    display: none;
}

.special-picker-panel > p:first-child {
    margin: 0 0 9px;
}

.special-picker-panel .glyph-grid {
    max-height: 260px;
}

.special-picker-heading {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
}

.arto-picker-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.arto-picker-columns {
    display: grid;
    grid-template-areas: "other dominant";
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.arto-picker-columns.left-handed {
    grid-template-areas: "dominant other";
}

.arto-other-column {
    grid-area: other;
}

.arto-dominant-column {
    grid-area: dominant;
}

.arto-code-list {
    display: grid;
    gap: 6px;
}

.arto-code-option {
    width: 100%;
    min-height: 36px;
    padding: 6px 10px;
    color: #59324f;
    background: #faeff7;
    border: 1px solid #efd8e8;
    border-radius: 6px;
    text-align: left;
}

.arto-code-option[aria-pressed="true"] {
    color: #fff;
    background: var(--brand-secondary);
    border-color: var(--brand-secondary);
}

.arto-code-option .code-symbol {
    display: inline-block;
    min-width: 24px;
    margin-right: 7px;
    font-family: monospace;
    font-size: 15px;
    font-weight: 700;
}

.arto-picker-tools button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.builder-actions {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.special-tools {
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 17px;
    color: #9aa5ab;
    font-size: 13px;
}

.text-button {
    padding: 0;
    color: #087e8e;
    background: transparent;
    border: 0;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.status {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.local-data {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding: 12px;
    background: #fff7e8;
    border: 1px solid #efd9a9;
    border-radius: 8px;
    font-size: 13px;
}

.local-data p {
    margin: 0;
}

.results-section {
    margin-top: 24px;
}

.result-count {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.result-controls {
    flex-wrap: wrap;
    gap: 7px;
    color: #53616a;
    font-size: 12px;
}

.result-controls select {
    max-width: 220px;
    padding: 7px 9px;
    font-size: 12px;
}

.sort-direction {
    width: 32px;
    height: 32px;
    color: #087e8e;
    background: #eff9fa;
    border: 1px solid #d5eff1;
    border-radius: 7px;
    font-weight: 700;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.results-grid.results-details {
    display: block;
    overflow-x: auto;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.details-table th,
.details-table td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.details-table th {
    position: sticky;
    top: 0;
    color: #34434c;
    background: #f4f8f9;
    font-family: var(--font-heading);
    font-size: 12px;
}

.details-table td:first-child {
    width: 170px;
}

.details-table td:nth-child(2) {
    min-width: 180px;
}

.details-table .sign-media {
    width: 150px;
}

.details-table .sign-video {
    width: 100%;
    min-height: 90px;
    max-height: 120px;
    background: #fff;
}

.details-table .sign-card-header {
    padding: 0;
}

.details-table .sign-card-body {
    padding: 0;
}

.thumbnail-view {
    grid-template-columns: repeat(auto-fill, minmax(var(--thumbnail-width), 1fr));
}

.thumbnail-very-small {
    --thumbnail-width: 112px;
}

.thumbnail-small {
    --thumbnail-width: 168px;
}

.thumbnail-medium {
    --thumbnail-width: 248px;
}

.thumbnail-large {
    --thumbnail-width: 340px;
}

.thumbnail-view .sign-video {
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 4 / 3;
    background: #fff;
}

.thumbnail-view .sign-card-body {
    padding: 8px 12px 12px;
}

.thumbnail-view .translation-grid,
.thumbnail-view .metadata-groups,
.thumbnail-view .all-properties {
    display: none;
}

.thumbnail-view .video-downloads {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.sign-card {
    overflow: hidden;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.sign-card-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px 10px;
}

.sign-card-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.sign-card-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.sign-card-header .secondary-language {
    color: #087e8e;
    font-size: 13px;
    font-weight: 600;
}

.entry-status {
    align-self: flex-start;
    padding: 4px 8px;
    color: #236e46;
    background: #e9f7ef;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.entry-status.under_review {
    color: #7b5916;
    background: #fff4d8;
}

.entry-status.removed {
    color: #81434a;
    background: #fcebed;
}

.sign-video {
    display: block;
    width: 100%;
    max-height: 320px;
    min-height: 170px;
    background: #101820;
    object-fit: contain;
}

.video-fallback {
    display: grid;
    min-height: 170px;
    place-items: center;
    color: #fff;
    background: #26343d;
    font-size: 13px;
}

.sign-card-body {
    padding: 12px 16px 16px;
}

.translation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.translation-cell {
    min-width: 0;
    padding: 9px;
    background: var(--soft);
    border-radius: 8px;
}

.translation-cell span,
.metadata-item dt {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.translation-cell strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 600;
}

.metadata-groups {
    display: grid;
    gap: 8px;
}

.metadata-group {
    padding-top: 8px;
    border-top: 1px solid #edf1f2;
}

.metadata-group h4 {
    margin: 0 0 6px;
    color: #34434c;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
}

.metadata-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 12px;
    margin: 0;
}

.metadata-item {
    min-width: 0;
}

.filtered-properties {
    margin: 0 0 10px;
    padding: 9px;
    background: #f3fbfc;
    border: 1px solid #d8f0f2;
    border-radius: 8px;
}

.filtered-properties h4 {
    margin: 0 0 5px;
    color: #087e8e;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
}

.filtered-properties .metadata-list {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px 10px;
}

.metadata-item dd {
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    font-size: 12px;
}

.noto-sans-signwriting-regular {
    font-family: "Noto Sans SignWriting", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.video-downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #edf1f2;
    font-size: 11px;
}

.video-downloads a {
    font-weight: 600;
}

.all-properties {
    margin-top: 11px;
    color: #087e8e;
    font-size: 12px;
}

.all-properties > summary {
    cursor: pointer;
    font-weight: 600;
}

.pagination {
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
}

.page-jump-label {
    color: var(--muted);
    font-size: 12px;
}

.page-jump-input {
    width: 68px;
    min-width: 0;
    padding: 7px 8px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid #cbd8dd;
    border-radius: 7px;
}

.pagination span {
    min-width: 104px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.pagination button:disabled {
    cursor: not-allowed;
    opacity: .45;
    transform: none;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 38px 18px;
    color: var(--muted);
    background: #f7fafb;
    border: 1px dashed #cbd8dd;
    border-radius: 12px;
    text-align: center;
}

.help-dialog {
    width: min(900px, calc(100% - 32px));
    max-height: min(82vh, 800px);
    padding: 0;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgb(0 0 0 / 26%);
}

.help-dialog.toast-dialog[open] {
    position: fixed;
    inset: auto 24px 24px auto;
    width: min(390px, calc(100% - 32px));
    max-height: min(60vh, 420px);
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgb(24 35 44 / 20%);
}

.help-dialog::backdrop {
    background: rgb(16 28 35 / 56%);
}

.dialog-header {
    position: sticky;
    top: 0;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
    font-size: 20px;
}

.dialog-close {
    width: 34px;
    height: 34px;
    color: #36454e;
    background: #f1f5f6;
    border: 0;
    border-radius: 50%;
    font-size: 24px;
}

.dialog-content {
    padding: 18px 20px 22px;
    font-size: 14px;
}

.dialog-content p:first-child {
    margin-top: 0;
}

.help-dialog:not(.toast-dialog) .dialog-content {
    max-height: calc(82vh - 70px);
    overflow: auto;
}

.guide-section {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.guide-section h3 {
    margin: 0 0 8px;
    color: #087e8e;
    font-family: var(--font-heading);
    font-size: 17px;
}

.guide-section h4 {
    margin: 14px 0 6px;
    font-size: 14px;
}

.notation-example {
    margin: 10px 0 16px;
}

.notation-example pre {
    margin: 0;
    padding: 10px 12px;
    overflow-x: auto;
    color: var(--ink);
    background: #f4f8f9;
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
}

.notation-example figcaption {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.dialog-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 12px 0;
}

.glyph-picker-controls {
    display: grid;
    gap: 9px;
    margin: 16px 0 12px;
}

.glyph-search {
    width: 100%;
}

.glyph-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 8px;
    max-height: 330px;
    overflow: auto;
    padding: 2px;
}

.glyph-option {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 7px;
    min-height: 58px;
    padding: 6px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: left;
}

.glyph-option:hover,
.glyph-option:focus-visible {
    border-color: var(--brand-primary);
    background: #f1fbfc;
}

.glyph-option img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: #fff;
    border-radius: 5px;
}

.glyph-option span {
    font-size: 11px;
    line-height: 1.35;
}

.glyph-option strong {
    display: block;
}

.arto-categories {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.arto-category {
    padding: 9px;
    color: #33444d;
    background: #f7fafb;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
    text-align: left;
}

.arto-category strong {
    display: inline-grid;
    width: 25px;
    height: 25px;
    margin-right: 5px;
    place-items: center;
    color: #07383f;
    background: #bff2f6;
    border-radius: 6px;
}

.arto-code-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.arto-code-buttons button {
    min-width: 34px;
    padding: 6px 9px;
    color: #59324f;
    background: #faeff7;
    border: 1px solid #efd8e8;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
}

.description-note {
    color: var(--muted);
    font-size: 12px;
}

.home-content {
    display: grid;
    gap: 18px;
}

.home-panel {
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 8px 28px rgb(24 35 44 / 4%);
}

.home-panel h2 {
    margin: 0 0 10px;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.home-panel p {
    color: #46545d;
}

.home-panel p:last-child {
    margin-bottom: 0;
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.home-action {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 118px;
    padding: 16px;
    color: var(--ink);
    background: #f7fafb;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
}

.home-action:hover,
.home-action:focus-visible {
    border-color: var(--brand-primary);
    background: #f1fbfc;
}

.home-action strong {
    color: #087e8e;
    font-family: var(--font-heading);
    font-size: 15px;
}

.home-action span {
    color: var(--muted);
    font-size: 13px;
}

.home-action .material-symbols-outlined {
    color: var(--brand-secondary);
    font-size: 24px;
}

@media (max-width: 760px) {
    .site-header {
        flex-wrap: wrap;
        gap: 14px;
        padding: 20px;
    }

    .logo-container img {
        width: 130px;
    }

    .heading-copy {
        flex-basis: calc(100% - 150px);
    }

    .heading-copy > p:last-child {
        font-size: 13px;
    }

    .schema-link {
        margin-left: auto;
    }

    .header-controls {
        width: 100%;
        justify-content: flex-end;
    }

    main {
        width: min(100% - 24px, 620px);
        margin-top: 14px;
    }

    .search-panel,
    .results-section {
        padding: 17px;
        border-radius: 12px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .thumbnail-view {
        grid-template-columns: repeat(auto-fill, minmax(min(var(--thumbnail-width), 44vw), 1fr));
    }

    .details-table td:first-child {
        width: 130px;
    }

    .details-table .sign-media {
        width: 110px;
    }

    .results-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-controls {
        width: 100%;
    }

    .result-controls select {
        max-width: none;
    }

    .help-dialog.toast-dialog[open] {
        inset: auto 12px 12px;
        width: auto;
    }

    .result-controls #sortField {
        flex: 1;
    }

    .filter-rule {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    }

    .filter-rule select[data-field] {
        grid-column: 1 / -1;
    }

    .filter-rule .rule-value {
        grid-column: 1 / 3;
    }

    .field-help {
        grid-column: 3;
        grid-row: 2;
    }

    .rule-remove {
        grid-column: 3;
        grid-row: 1;
    }
}

@media (max-width: 440px) {
    .logo-container img {
        width: 100px;
    }

    .heading-copy {
        flex-basis: calc(100% - 114px);
    }

    .heading-copy h1 {
        font-size: 26px;
    }

    .quick-search {
        align-items: stretch;
        flex-direction: column;
    }

    .home-panel {
        padding: 18px;
    }

    .translation-grid,
    .metadata-list,
    .arto-categories {
        grid-template-columns: 1fr;
    }

    .result-controls {
        gap: 5px;
    }

    .result-controls label {
        font-size: 11px;
    }
}
