/* V11 additional improvements. The original light/dark palettes are retained. */
.home-header-actions{display:flex;align-items:flex-start;gap:4px;flex-shrink:0}
#open-settings{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:6px;border:0;background:transparent;color:var(--home-muted,#52686e);font-size:22px;line-height:1;border-radius:8px}
#open-settings:focus-visible{outline:3px solid var(--home-focus,#147268);outline-offset:1px}
#settings-dialog{width:min(420px,calc(100vw - 32px))}
.settings-actions{display:grid;gap:12px}
.settings-actions>button{min-height:48px;text-align:left;padding:12px 16px}
.settings-actions>button small{display:block;font-size:12px;font-weight:400;line-height:1.6;margin-top:4px}
.photo-panel{min-width:0;margin:14px 0}
.photo-panel>summary{min-height:44px;line-height:1.6}
.photo-input-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}
.photo-input-actions .file-button{display:flex;align-items:center;justify-content:center;min-height:48px;padding:10px 8px;line-height:1.5;font-size:14px;min-width:0}
.photo-input-actions .file-button{position:relative}
.photo-input-actions input{position:absolute;width:1px;height:1px;opacity:0;clip-path:inset(50%)}
.photo-input-actions .file-button:focus-within{outline:3px solid var(--teal);outline-offset:2px}
.photo-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px;min-width:0}
.photo-item{min-width:0;margin:0}
.photo-thumbnail{width:100%;padding:0;overflow:hidden;display:block;line-height:1.5;text-align:center}
.photo-thumbnail img{display:block;aspect-ratio:7/5;width:100%;height:auto;object-fit:contain;background:#e4ebed}
.photo-thumbnail span{display:block;padding:8px 4px;font-size:12px}
.photo-item figcaption{display:none;font-size:12px;line-height:1.6;margin:6px 0;overflow-wrap:anywhere}
.photo-item>button:last-child{min-height:44px;width:100%;font-size:12px}
.photo-status{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7}
.photo-status:empty{display:none}
#photo-view-dialog{width:min(960px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:16px;overflow:auto}
#photo-view-dialog h2{font-size:16px;overflow-wrap:anywhere;min-width:0}
.photo-view-stage{overflow:auto;max-height:65dvh;min-height:180px;background:#e4ebed;border-radius:8px;touch-action:pan-x pan-y pinch-zoom}
.photo-view-stage img{display:block;max-width:100%;max-height:65dvh;width:auto;height:auto;margin:auto;object-fit:contain}
.photo-view-stage.zoomed img{width:200%;max-width:none;max-height:none;margin:0}
#photo-view-zoom{min-height:44px;min-width:80px}
#photo-delete-dialog{width:min(460px,calc(100vw - 32px))}
@media screen{html[data-theme="dark"] .photo-thumbnail img,html[data-theme="dark"] .photo-view-stage{background:var(--app-input)}html[data-theme="dark"] .photo-item figcaption{color:var(--app-muted)}}
#data-pane .company-browser>.list-tools{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.directory-table,.directory-table tbody{display:block;width:100%;min-width:0}
.directory-table{border-spacing:0;border-collapse:separate}
.directory-table thead,#companies td.directory-desktop-cell{display:none}
.directory-row{display:block;margin:0 0 6px;min-width:0}
.directory-company-cell{display:block;padding:0;min-width:0}
#companies .directory-company,#companies .directory-company.active{display:flex;flex-direction:column;align-items:stretch;width:100%;min-height:64px;gap:4px;padding:9px 12px;margin:0;white-space:normal;text-align:left;box-shadow:none;border-width:1px;min-width:0}
#companies .directory-mobile-top{display:flex;align-items:baseline;gap:8px;min-width:0}
#companies .directory-name{display:block;flex:1 1 0;min-width:0;font-size:15px;font-weight:700;line-height:1.5;overflow-wrap:anywhere;margin:0}
#companies .directory-mobile-meta{display:flex;align-items:baseline;gap:6px;min-width:0;font-size:12px;font-weight:400;line-height:1.55;color:#52686e}
#companies .directory-region,#companies .directory-result,#companies .directory-date{display:block;font-size:12px;line-height:1.55;font-weight:400;min-width:0;overflow-wrap:anywhere}
#companies .directory-region{flex:0 1 43%;max-width:43%;text-align:right;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#companies .directory-result{flex:1 1 0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#companies .directory-date{flex:0 0 auto;white-space:nowrap;font-variant-numeric:tabular-nums}
body.company-list-mode #companies{display:block}
#companies .directory-label{display:none}
@supports(content-visibility:auto){.directory-row{content-visibility:auto;contain-intrinsic-size:auto 64px}#companies .directory-company{contain-intrinsic-size:auto 64px}}
@media(min-width:761px){
 body.company-list-mode .directory-table{display:table;width:100%;table-layout:fixed;border-collapse:collapse;border:1px solid #c9d9d9;border-radius:8px}
 body.company-list-mode .directory-table thead{display:table-header-group}
 body.company-list-mode .directory-table tbody{display:table-row-group}
 body.company-list-mode .directory-row{display:table-row;margin:0;content-visibility:visible}
 body.company-list-mode #companies .directory-table th,body.company-list-mode #companies .directory-table td{display:table-cell;text-align:left;padding:10px 12px;border-bottom:1px solid #dce5e5;font-size:14px;line-height:1.6;vertical-align:middle;overflow-wrap:anywhere}
 body.company-list-mode .directory-table th{font-size:12px;color:#52686e;background:#f1f6f5;font-weight:600}
 body.company-list-mode .directory-table th:nth-child(1){width:46%}
 body.company-list-mode .directory-table th:nth-child(2){width:23%}
 body.company-list-mode .directory-table th:nth-child(3){width:17%}
 body.company-list-mode .directory-table th:nth-child(4){width:14%}
 body.company-list-mode .directory-table .directory-company-cell{padding:0}
 body.company-list-mode #companies .directory-company{min-height:48px;padding:12px;border:0;border-radius:0;background:transparent}
 body.company-list-mode #companies .directory-mobile-meta,body.company-list-mode #companies .directory-region{display:none}
 body.company-list-mode .directory-row.active{background:#edf8f6}
 body.company-list-mode #companies .directory-date{font-size:13px}
}
@media(max-width:360px){#companies .directory-company,#companies .directory-company.active{padding:9px 10px}#companies .directory-mobile-meta{gap:4px;font-size:11px}#companies .directory-region,#companies .directory-result,#companies .directory-date{font-size:11px}}
@media screen{
 html[data-theme="dark"] #open-settings,html[data-theme="dark"] #companies .directory-mobile-meta{color:var(--app-muted)}
 html[data-theme="dark"] .directory-table{color:var(--app-text);border-color:var(--app-line)}
 html[data-theme="dark"] body.company-list-mode .directory-table td{border-color:var(--app-line)}
 html[data-theme="dark"] body.company-list-mode .directory-table th{color:var(--app-muted);background:var(--app-raised);border-color:var(--app-line)}
 html[data-theme="dark"] body.company-list-mode .directory-row.active{background:var(--app-selected)}
}

.directory-row{cursor:pointer}
#export-dialog .export-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#export-dialog .export-actions>button{min-height:44px;min-width:0;padding:10px 4px;font-size:14px}
#export-dialog #export-close{display:block;min-height:44px;margin:12px 0 0 auto}
.registration-photo-warning{white-space:pre-wrap;line-height:1.7;font-size:13px}
.registration-photo-tools{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}

/* Output labels wrap naturally; retain the existing text size and control style. */
#data-tools>summary{gap:8px;line-height:1.6;white-space:normal}
#data-tools>summary>span{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
#data-tools>summary::after{flex:0 0 auto;margin-left:0}
#data-tools>.list-tools{grid-template-columns:minmax(0,1fr)}
#data-tools>.list-tools>button{width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.6}
