.avif-page { color: #17233b; }
.avif-page [hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.avif-heading { margin-bottom: 1.5rem; }
.avif-heading h1 { margin: 0 0 .7rem; font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.14; letter-spacing: 0; }
.avif-heading > p:not(.avif-eyebrow) { max-width: 780px; color: #5e7088; font-size: 1.02rem; line-height: 1.75; }
.avif-eyebrow { margin: 0 0 .35rem; color: #087f72; font-size: .78rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.privacy-badge { display: inline-flex; align-items: center; min-height: 32px; margin-top: .75rem; padding: .35rem .65rem; border: 1px solid #bcd9d3; border-radius: 6px; background: #f0f8f6; color: #176a5b; font-size: .78rem; font-weight: 800; }

.avif-tool { display: grid !important; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr) !important; border: 1px solid #d5e0eb !important; border-radius: 8px !important; background: #fff !important; box-shadow: none !important; overflow: hidden; }
.avif-form { padding: 1.25rem !important; border-right: 1px solid #dce5ee !important; background: #f7f9fb !important; }
.avif-panel-head { margin-bottom: .9rem; }
.avif-panel-head h2 { font-size: 1.2rem; letter-spacing: 0; }
.avif-panel-head p { font-size: .86rem; }
.avif-panel-head button, .avif-actions button, .file-actions button { min-height: 42px !important; margin: 0 !important; border: 1px solid #c8d6e3 !important; border-radius: 7px !important; background: #fff !important; color: #344860 !important; font-size: .84rem !important; font-weight: 800 !important; box-shadow: none !important; cursor: pointer; }
.avif-panel-head button, .avif-actions button:first-child { border-color: #087f72 !important; background: #087f72 !important; color: #fff !important; }
.avif-actions button:disabled, .file-actions button:disabled { cursor: not-allowed; opacity: .45; }
.avif-dropzone { min-height: 156px; padding: 1.15rem; border: 1px dashed #9eb6cb; background: #fff; }
.avif-dropzone strong { color: #17233b; }
.avif-dropzone small { margin-top: .45rem; color: #177363; font-size: .75rem; }
.avif-dropzone.is-dragover { border-color: #087f72; background: #eaf7f3; box-shadow: inset 0 0 0 2px rgba(8, 127, 114, .12); }

.format-fieldset { margin: 1rem 0 0; padding: 0; border: 0; }
.format-fieldset legend, .setting-label, .setting-block > label, .advanced-body > label { display: block; margin-bottom: .45rem; color: #30445c; font-size: .84rem; font-weight: 800; }
.format-segments { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.format-segments label { position: relative; margin: 0; cursor: pointer; }
.format-segments input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.format-segments span { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid #c8d6e3; border-radius: 7px; background: #fff; color: #40536a; font-weight: 800; }
.format-segments input:checked + span { border-color: #087f72; background: #087f72; color: #fff; }
.format-segments input:focus-visible + span { outline: 3px solid rgba(8, 127, 114, .2); outline-offset: 2px; }
.setting-block { margin-top: 1rem; }
.setting-block > label { display: flex; justify-content: space-between; align-items: center; }
.setting-block input[type="range"] { width: 100%; margin: .15rem 0 0; accent-color: #087f72; }
.format-notice { margin: 1rem 0 0; padding: .75rem; border-left: 3px solid #087f72; background: #eef8f5; color: #4a625e; font-size: .8rem; line-height: 1.55; }
.background-options { display: flex; flex-wrap: wrap; gap: .45rem; }
.background-options label { display: inline-flex; align-items: center; gap: .32rem; min-height: 40px; margin: 0; padding: .35rem .58rem; border: 1px solid #cbd8e4; border-radius: 6px; background: #fff; color: #40536a; font-size: .78rem; font-weight: 700; cursor: pointer; }
.background-options input[type="radio"] { margin: 0; }
.background-options input[type="color"] { width: 28px; height: 28px; margin: 0; padding: 1px; border: 1px solid #bcc9d6; border-radius: 4px; }
.swatch { width: 16px; height: 16px; border: 1px solid #aebdcb; border-radius: 3px; }
.swatch.white { background: #fff; }
.swatch.black { background: #111; }

.advanced-settings { margin-top: 1rem; border-top: 1px solid #dce5ed; border-bottom: 1px solid #dce5ed; }
.advanced-settings summary { padding: .85rem .1rem; color: #33475e; font-size: .86rem; font-weight: 800; cursor: pointer; }
.advanced-body { padding: .15rem 0 1rem; }
.advanced-body select, .custom-resize input { width: 100%; min-height: 46px; margin: 0; border: 1px solid #c8d5e2; border-radius: 7px; background: #fff; }
.custom-resize { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: .8rem; }
.custom-resize label { color: #506177; font-size: .78rem; font-weight: 700; }
.custom-resize input { margin-top: .3rem; }
.resize-checks { display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin-top: .8rem; }
.resize-checks label { margin: 0; color: #52647b; font-size: .78rem; }
.resize-checks input { margin-right: .25rem; }
.avif-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem !important; margin-top: 1rem !important; }
.avif-actions button:first-child { grid-column: 1 / -1; }
.progress-wrap { margin-top: 1rem; }
.progress-wrap label { display: block; margin-bottom: .35rem; color: #42546b; font-size: .78rem; font-weight: 800; }
.progress-wrap progress { width: 100%; height: 10px; border: 0; accent-color: #087f72; }
.avif-status { margin-top: .8rem; padding: .78rem .85rem; border-radius: 7px; font-size: .8rem; line-height: 1.55; }
.avif-status[data-type="warning"] { background: #fff7e6; color: #795b16; }

.avif-preview { padding: 1.25rem !important; }
.preview-head h2 { margin: 0; font-size: 1.15rem; letter-spacing: 0; }
.preview-head p { margin: .35rem 0 .85rem; font-size: .82rem; }
.preview-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.preview-grid figure { margin: 0; }
.preview-grid figcaption { margin-bottom: .35rem; color: #52647a; font-size: .76rem; font-weight: 800; }
.preview-box { position: relative; display: flex; align-items: center; justify-content: center; min-height: 200px; max-height: 310px; border: 1px solid #d6e1eb; border-radius: 7px; overflow: hidden; background-color: #fff; background-image: linear-gradient(45deg,#e9eef3 25%,transparent 25%),linear-gradient(-45deg,#e9eef3 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e9eef3 75%),linear-gradient(-45deg,transparent 75%,#e9eef3 75%); background-size: 20px 20px; background-position: 0 0,0 10px,10px -10px,-10px 0; }
.preview-box img { display: block; width: 100%; max-height: 310px; object-fit: contain; }
.preview-box > span { padding: .4rem .55rem; border-radius: 5px; background: rgba(255,255,255,.9); color: #748397; font-size: .78rem; }

.queue-section, .batch-summary { margin-top: 1.25rem; }
.queue-section > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.queue-section h2, .batch-summary h2 { margin: 0; font-size: 1.45rem; letter-spacing: 0; }
.queue-section > header > strong { color: #087f72; }
.file-queue { display: grid; gap: .65rem; }
.file-card { padding: .9rem; border: 1px solid #d5e0ea; border-radius: 8px; background: #fff; }
.file-card.is-selected { border-color: #72b9ac; box-shadow: inset 3px 0 #087f72; }
.file-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.file-card-top > div { min-width: 0; }
.file-name, .file-source-meta { display: block; }
.file-name { color: #1b2a41; overflow-wrap: anywhere; }
.file-source-meta { margin-top: .22rem; color: #718096; font-size: .75rem; }
.file-status { flex: 0 0 auto; padding: .28rem .5rem; border-radius: 5px; background: #eef2f6; color: #56677d; font-size: .7rem; font-weight: 800; }
.file-card[data-status="complete"] .file-status { background: #e7f5f1; color: #0b715f; }
.file-card[data-status="failed"] .file-status { background: #fff0ef; color: #a23d37; }
.file-card[data-status="converting"] .file-status { background: #eef4ff; color: #345e9b; }
.large-warning, .file-error { margin: .65rem 0 0; padding: .55rem .65rem; font-size: .75rem; line-height: 1.5; }
.large-warning { background: #fff7e6; color: #745817; }
.file-error { background: #fff0ef; color: #963b35; }
.file-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; margin: .75rem 0 0; }
.file-metrics div { min-width: 0; padding: .55rem; background: #f5f8fa; border-radius: 6px; }
.file-metrics dt, .file-metrics dd { margin: 0; }
.file-metrics dt { color: #7a899c; font-size: .67rem; }
.file-metrics dd { margin-top: .2rem; color: #2d4058; font-size: .78rem; font-weight: 800; overflow-wrap: anywhere; }
.file-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.file-actions button { min-height: 36px !important; padding: .35rem .7rem !important; font-size: .75rem !important; }
.file-actions .remove-button { margin-left: auto !important; color: #8b3a35 !important; }

.batch-summary { padding: 1rem; border: 1px solid #bcd9d3; border-radius: 8px; background: #f2f9f7; }
.batch-summary dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin: .8rem 0 0; }
.batch-summary dl div { min-width: 0; }
.batch-summary dt { color: #658079; font-size: .72rem; }
.batch-summary dd { margin: .2rem 0 0; color: #075f52; font-weight: 800; overflow-wrap: anywhere; }

.avif-guide { margin-top: 2.8rem !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; overflow: visible !important; }
.avif-guide > header { margin-bottom: 1rem; }
.avif-guide > header h2 { margin: 0 0 .5rem; font-size: 1.65rem; letter-spacing: 0; }
.avif-guide > header p { margin: 0; }
.avif-guide-grid { gap: 0 1.5rem !important; margin-top: 0 !important; }
.avif-guide-grid section { padding: 1.1rem 0 !important; border: 0 !important; border-top: 1px solid #dce4ec !important; border-radius: 0 !important; background: transparent !important; }
.avif-guide-grid h2, .avif-guide > section h2 { margin: 0 0 .5rem; color: #172940; font-size: 1.15rem; letter-spacing: 0; }
.avif-guide-grid p, .avif-guide > section p { margin: 0; color: #61728a; font-size: .92rem; line-height: 1.78; }
.avif-guide > section { margin-top: 1.6rem; }
.format-table-section .table-wrap { overflow-x: auto; }
.format-table-section table { width: 100%; min-width: 610px; margin: .7rem 0 0; font-size: .82rem; }
.format-table-section th, .format-table-section td { padding: .7rem; text-align: left; }
.format-table-section thead th { background: #f3f7f9; }
.avif-caution { padding: 1rem; border: 1px solid #ead39d; border-radius: 8px; background: #fff8e8; }
.faq-section details { border-top: 1px solid #dce4ec; }
.faq-section details:last-child { border-bottom: 1px solid #dce4ec; }
.faq-section summary { padding: .9rem .1rem; color: #263850; font-size: .9rem; font-weight: 800; cursor: pointer; }
.faq-section details p { padding: 0 .1rem .9rem; }

@media screen and (max-width: 1100px) {
  .avif-tool { grid-template-columns: 1fr !important; }
  .avif-form { border-right: 0 !important; border-bottom: 1px solid #dce5ee !important; }
  .preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 736px) {
  .avif-heading h1 { font-size: 2rem; }
  .avif-heading > p:not(.avif-eyebrow) { font-size: .94rem; }
  .avif-form, .avif-preview { padding: 1rem !important; }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-box { min-height: 180px; }
  .file-metrics, .batch-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avif-guide-grid { grid-template-columns: 1fr !important; }
  .avif-guide > header h2 { font-size: 1.4rem; }
}
@media screen and (max-width: 390px) {
  .avif-tool { margin-left: -.25rem; margin-right: -.25rem; }
  .avif-panel-head { flex-direction: column; }
  .avif-panel-head button { width: 100%; }
  .avif-dropzone { min-height: 140px; }
  .background-options label { flex: 1 1 calc(50% - .45rem); }
  .custom-resize { grid-template-columns: 1fr; }
  .avif-actions { grid-template-columns: 1fr !important; }
  .avif-actions button:first-child { grid-column: auto; }
  .file-metrics, .batch-summary dl { grid-template-columns: 1fr 1fr; }
  .file-card-top { align-items: flex-start; }
  .file-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .file-actions .remove-button { width: 100%; margin-left: 0 !important; grid-column: 1 / -1; }
}
