.material-buttons {display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px;}
.material-button {--tone:var(--material-text);display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;max-width:100%;padding:9px 14px;border:1px solid color-mix(in srgb,var(--tone) 45%,#fff);border-radius:9px;background:transparent;color:var(--tone);font-size:12px;line-height:20px;font-weight:550;text-decoration:none;white-space:normal;overflow-wrap:anywhere;}
.dark .material-button {--tone:var(--material-light);border-color:color-mix(in srgb,var(--tone) 45%,#182338);}
.material-button[data-material-appearance="filled"] {background:var(--material-color);border-color:var(--material-color);color:var(--material-on-fill);}
.material-button[data-material-appearance="soft"] {background:color-mix(in srgb,var(--tone) 11%,#fff);border-color:color-mix(in srgb,var(--tone) 18%,#fff);}
.dark .material-button[data-material-appearance="soft"] {background:color-mix(in srgb,var(--tone) 11%,#182338);border-color:color-mix(in srgb,var(--tone) 18%,#182338);}
.material-button:hover {filter:brightness(.96);}
.dark .material-button:hover {filter:brightness(1.12);}
.material-button:focus-visible {outline:2px solid #2563eb;outline-offset:3px;}
.material-button-icon {display:flex;flex:none;}
.material-button-icon svg,.material-button-image {width:18px;height:18px;flex:none;}
.material-button-image {border-radius:4px;object-fit:cover;}
.material-style-editor {margin:16px 0;padding:16px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;color:#334155;}
.dark .material-style-editor {border-color:#334155;background:#111827;color:#e2e8f0;}
.material-style-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.material-style-editor label,.material-style-editor legend {font-size:12px;font-weight:500;}
.material-style-editor select,.material-style-editor input[type="text"] {width:100%;height:38px;margin-top:6px;padding:6px 10px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;color:#334155;font-size:12px;}
.dark .material-style-editor select,.dark .material-style-editor input[type="text"] {border-color:#475569;background:#182338;color:#e2e8f0;}
.material-color-picker {margin:16px 0 0;padding:0;border:0;min-width:0;}
.material-color-picker legend {margin-bottom:10px;}
.material-color-palette {display:grid;grid-template-columns:repeat(auto-fit,32px);gap:8px;width:312px;max-width:100%;}
.material-color-swatch {width:32px;height:32px;border-radius:8px;border:1px solid #80808040;background:var(--swatch-color);color:transparent;cursor:pointer;font-size:17px;font-weight:700;transition:none;}
.material-color-swatch[aria-checked="true"] {color:var(--swatch-check);outline:2px solid #475569;outline-offset:2px;}
.dark .material-color-swatch[aria-checked="true"] {outline-color:#cbd5e1;}
.material-color-swatch:focus-visible {outline:2px solid #2563eb;outline-offset:3px;}
.material-custom-color {display:flex;gap:16px;margin-top:16px;align-items:center;flex-wrap:wrap;}
.material-custom-color label {display:flex;align-items:center;gap:8px;}
.material-custom-color input[type="color"] {width:38px;height:34px;padding:2px;border:1px solid #cbd5e1;border-radius:7px;background:transparent;cursor:pointer;}
.material-custom-color input[type="text"] {width:95px;height:34px;margin:0;font:12px ui-monospace,monospace;}
.material-custom-color input[aria-invalid="true"] {border-color:#dc2626;}
.material-preview {margin-top:16px;padding:14px;border:1px dashed #cbd5e1;border-radius:8px;}
.dark .material-preview {border-color:#475569;}
.material-preview-label {margin-bottom:8px;font-size:11px;color:#64748b;}
.material-preview .material-button,.material-preview .material-button * {transition:none;}
.dark .material-preview-label {color:#94a3b8;}
@media(max-width:639px){.material-button {padding:7px 10px;}.material-color-palette {grid-template-columns:repeat(4,32px);width:152px;}}
@media(max-width:359px){.material-style-editor {padding:12px;}.material-color-palette {grid-template-columns:repeat(4,32px);gap:10px;}.material-style-fields {grid-template-columns:1fr;}}
.result-link-modal {width:min(720px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:0;border:1px solid #e2e8f0;border-radius:14px;background:#fff;color:#334155;box-shadow:0 24px 80px #0f172a33;}
.result-link-modal::backdrop {background:#0f172a66;}
.material-link-form {--form-border:#e2e8f0;--form-input:#fff;font-size:13px;}
.dark .material-link-form {--form-border:#334155;--form-input:#182338;color-scheme:dark;}
.material-primary-fields {display:grid;grid-template-columns:1fr 1.3fr;gap:14px;}
.material-link-form label:not(.material-checkbox),.material-link-form legend {font-size:12px;font-weight:500;}
.material-link-form input:not([type="hidden"]):not([type="checkbox"]):not([type="color"]):not([type="file"]):not([name="color"]),.material-link-form select {min-width:0;width:100%;height:38px;padding:7px 10px;border:1px solid var(--form-border);border-radius:7px;background:var(--form-input);color:inherit;font-size:13px;box-shadow:none;}
.material-link-form input:focus-visible,.material-link-form select:focus-visible {outline:2px solid #2563eb;outline-offset:2px;}
.material-section-title {margin:0 0 14px;font-size:13px;font-weight:600;line-height:20px;}
.material-link-form .material-style-editor {margin:4px 0 18px;padding:18px 0;border:0;border-top:1px solid var(--form-border);border-bottom:1px solid var(--form-border);border-radius:0;background:transparent;color:inherit;}
.material-link-form .material-preview {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 14px;border:0;background:#f8fafc;}
.dark .material-link-form .material-preview {background:#1e293b;}
.material-link-form .material-preview-label {margin:0;flex:none;}
.material-link-form .material-preview[hidden] {display:none;}
.material-link-form .material-custom-color input[type="text"] {width:95px;height:34px;}
.material-link-form .image-upload-field {padding:0 0 18px;border:0;border-bottom:1px solid var(--form-border);border-radius:0;background:transparent;color:inherit;}
.material-publication-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;}
.material-publication-heading .material-section-title {margin:0;}
.material-schedule-fields {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 90px;gap:12px;}
.material-visibility-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 16px;padding:4px 0 20px;}
.material-checkbox {display:flex;align-items:center;gap:9px;min-height:36px;font-size:12px;line-height:18px;cursor:pointer;color:inherit;}
.material-checkbox input[type="checkbox"] {appearance:auto;width:16px;height:16px;flex:none;margin:0;accent-color:#2563eb;cursor:pointer;}
.material-checkbox input:focus-visible {outline:2px solid #2563eb;outline-offset:3px;}
.material-checkbox span {min-width:0;}
.result-link-modal .result-link-modal-footer {justify-content:flex-end;gap:10px;}
.result-link-modal-footer button {min-height:38px;}
.result-link-modal-footer button[type="submit"] {order:2;}
@media(max-width:639px){.material-primary-fields {grid-template-columns:1fr;gap:0;}.material-schedule-fields {grid-template-columns:repeat(2,minmax(0,1fr));}.material-schedule-fields>div:last-child {max-width:110px;}.material-visibility-fields {grid-template-columns:1fr;gap:0;}.material-publication-heading {flex-wrap:wrap;}.material-link-form .material-preview {align-items:flex-start;flex-direction:column;gap:8px;}}
html:has(.result-link-modal[open]) {overflow:hidden;scrollbar-gutter:stable;}
.dark .result-link-modal {background:#111827;color:#e2e8f0;border-color:#334155;}
.result-link-modal-header {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;border-bottom:1px solid #e2e8f0;}
.dark .result-link-modal-header {border-color:#334155;}
.result-link-modal-header h3 {font-size:16px;font-weight:600;}
.result-link-modal-header button {width:32px;height:32px;border:0;border-radius:7px;color:inherit;background:transparent;font-size:24px;line-height:1;cursor:pointer;}
.result-link-modal-header button:hover {background:#64748b20;}
#result-link-modal-content {padding:16px 20px;max-height:calc(100dvh - 106px);overflow-y:auto;scrollbar-width:thin;}
#result-link-modal-content > form,#result-link-modal-content > div > form {border:0;padding:0;}
.result-link-modal-footer {position:sticky;bottom:-16px;z-index:2;margin:0 -20px -16px;padding:14px 20px;border-top:1px solid #e2e8f0;background:#fff;}
.dark .result-link-modal-footer {border-color:#334155;background:#111827;}
@media(max-width:639px){.result-link-modal-header {padding:12px 16px;}#result-link-modal-content {padding:14px 16px;}.result-link-modal-footer {margin:0 -16px -14px;padding:12px 16px;bottom:-14px;}}

.material-link-form select[name="iconKey"][hidden] {display:none;}
.material-icon-trigger {display:flex;align-items:center;gap:9px;width:100%;height:38px;padding:7px 10px;border:1px solid var(--form-border);border-radius:7px;background:var(--form-input);color:inherit;font-size:13px;text-align:left;}
.material-icon-trigger>span {flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.material-icon-trigger svg,.material-icon-menu svg {width:18px;height:18px;flex:none;}
.material-icon-trigger .material-icon-chevron {width:16px;height:16px;color:#64748b;}
.material-icon-trigger:focus-visible {outline:2px solid #2563eb;outline-offset:2px;}
.material-icon-menu {position:fixed;inset:auto;margin:0;padding:5px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;border:1px solid #e2e8f0;border-radius:10px;background:#fff;color:#334155;box-shadow:0 12px 32px #0f172a26;}
.dark .material-icon-menu {background:#182338;border-color:#334155;color:#e2e8f0;color-scheme:dark;}
.material-icon-menu button {display:flex;align-items:center;gap:10px;width:100%;min-height:38px;padding:8px 10px;border:0;border-radius:6px;background:transparent;color:inherit;font-size:13px;text-align:left;}
.material-icon-menu button>span:not(.material-icon-check) {flex:1;}
.material-icon-menu button:hover,.material-icon-menu button:focus-visible {background:#f1f5f9;outline:none;}
.material-icon-menu button[aria-selected="true"] {background:#eff6ff;color:#1d4ed8;}
.dark .material-icon-menu button:hover,.dark .material-icon-menu button:focus-visible {background:#26364e;}
.dark .material-icon-menu button[aria-selected="true"] {background:#26364e;color:#bfdbfe;}
.material-icon-check {visibility:hidden;}
.material-icon-menu button[aria-selected="true"] .material-icon-check {visibility:visible;}

.material-save-error {margin-bottom:14px;padding:10px 12px;border:1px solid #fecaca;border-radius:8px;background:#fef2f2;color:#991b1b;font-size:13px;line-height:20px;}
.dark .material-save-error {border-color:#7f1d1d;background:#451a1a;color:#fecaca;}
.material-save-error[hidden] {display:none;}
.material-link-form button[type="submit"]:disabled {opacity:.6;cursor:wait;}
