.heic-page { color: #17233b; }
.heic-page [hidden] { display: none !important; }
.heic-heading { margin-bottom: 1.5rem; }
.heic-heading h1 { margin: 0 0 .7rem; color: #17233b; font-size: 2.45rem; line-height: 1.14; letter-spacing: 0; }
.heic-heading > p:not(.heic-eyebrow) { max-width: 780px; margin: 0; color: #5e7088; font-size: 1rem; line-height: 1.75; }
.heic-eyebrow { margin: 0 0 .35rem; color: #087f72; font-size: .78rem; font-weight: 800; letter-spacing: 0; }
.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; }

.heic-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; }
.heic-form { padding: 1.25rem !important; border-right: 1px solid #dce5ee !important; background: #f7f9fb !important; }
.heic-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.heic-panel-head h2, .preview-head h2 { margin: 0; font-size: 1.15rem; letter-spacing: 0; }
.heic-panel-head p, .preview-head p { margin: .3rem 0 0; color: #68798e; font-size: .82rem; line-height: 1.55; }
.heic-panel-head button, .heic-actions button, .file-actions button, .quality-presets 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: .82rem !important; font-weight: 800 !important; box-shadow: none !important; cursor: pointer; }
.heic-panel-head button, .heic-actions button:first-child { border-color: #087f72 !important; background: #087f72 !important; color: #fff !important; }
.heic-actions button:disabled, .file-actions button:disabled { cursor: not-allowed; opacity: .45; }
.heic-dropzone { display: grid; place-items: center; min-height: 156px; padding: 1.15rem; border: 1px dashed #9eb6cb; border-radius: 7px; background: #fff; text-align: center; cursor: pointer; }
.heic-dropzone strong, .heic-dropzone span, .heic-dropzone small { display: block; }
.heic-dropzone strong { color: #17233b; }
.heic-dropzone span { margin-top: .25rem; color: #62748b; font-size: .84rem; }
.heic-dropzone small { margin-top: .45rem; color: #177363; font-size: .75rem; }
.heic-dropzone.is-dragover { border-color: #087f72; background: #eaf7f3; box-shadow: inset 0 0 0 2px rgba(8, 127, 114, .12); }
.heic-dropzone:focus-visible { outline: 3px solid rgba(8, 127, 114, .22); outline-offset: 2px; }

.setting-block { margin-top: 1rem; }
.setting-block > label, .advanced-body > label { display: flex; align-items: center; justify-content: space-between; margin-bottom: .45rem; color: #30445c; font-size: .84rem; font-weight: 800; }
.setting-block input[type="range"] { width: 100%; margin: .15rem 0 0; accent-color: #087f72; }
.setting-block select, .advanced-body select, .custom-resize input { width: 100%; min-height: 46px; margin: 0; border: 1px solid #c8d5e2; border-radius: 7px; background: #fff; }
.quality-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin-top: .55rem; }
.quality-presets button { min-height: 36px !important; padding: .35rem !important; font-size: .72rem !important; }
.field-help, .download-help { margin: .5rem 0 0; color: #6a7b90; font-size: .73rem; line-height: 1.55; }
.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; }
.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; }
.heic-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem !important; margin-top: 1rem !important; }
.heic-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; }
.heic-status { margin: .8rem 0 0; padding: .78rem .85rem; border-radius: 7px; background: #eef3f7; color: #4d6178; font-size: .8rem; line-height: 1.55; }
.heic-status[data-type="success"] { background: #e9f6f2; color: #0b6b5b; }
.heic-status[data-type="warning"] { background: #fff7e6; color: #795b16; }
.heic-status[data-type="error"] { background: #fff0ef; color: #963b35; }

.heic-preview { padding: 1.25rem !important; }
.preview-box { position: relative; display: flex; align-items: center; justify-content: center; min-height: 300px; max-height: 470px; margin-top: .85rem; 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: 470px; object-fit: contain; }
.preview-box > span { padding: .4rem .55rem; border-radius: 5px; background: rgba(255,255,255,.92); color: #748397; font-size: .78rem; }
.preview-source { display: grid; grid-template-columns: 1fr; gap: .45rem; margin: .75rem 0 0; }
.preview-source div { padding: .6rem .7rem; border-radius: 6px; background: #f4f7f9; }
.preview-source dt, .preview-source dd { margin: 0; }
.preview-source dt { color: #748599; font-size: .69rem; }
.preview-source dd { margin-top: .15rem; color: #30445c; font-size: .78rem; font-weight: 800; overflow-wrap: anywhere; }
.preview-note { margin: .65rem 0 0; color: #718096; font-size: .72rem; line-height: 1.5; }

.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.4rem; 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, .metadata-note { 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; }
.metadata-note { background: #eef5f8; color: #526a79; }
.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; border-radius: 6px; background: #f5f8fa; }
.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(5, 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; }

.heic-guide { margin-top: 2.8rem !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; overflow: visible !important; }
.heic-guide > header { margin-bottom: 1rem; }
.heic-guide > header h2 { margin: 0 0 .5rem; font-size: 1.6rem; letter-spacing: 0; }
.heic-guide > header p { margin: 0; color: #61728a !important; font-size: .91rem !important; line-height: 1.78 !important; }
.process-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: 1rem 0 0; padding: 0; list-style-position: inside; }
.process-list li { padding: .75rem; border: 1px solid #dce4ec; border-radius: 7px; background: #f8fafb; color: #4f6279; font-size: .84rem; }
.heic-guide-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem !important; margin-top: 1.4rem !important; }
.heic-guide-grid section { padding: 1.1rem 0 !important; border: 0 !important; border-top: 1px solid #dce4ec !important; border-radius: 0 !important; background: transparent !important; }
.heic-guide-grid h2, .heic-guide > section h2 { margin: 0 0 .5rem; color: #172940; font-size: 1.13rem; letter-spacing: 0; }
.heic-guide-grid p, .heic-guide > section p { margin: 0; color: #61728a; font-size: .91rem; line-height: 1.78; }
.heic-guide > section { margin-top: 1.6rem; }
.source-link { margin-top: .6rem !important; }
.source-link a { color: #087f72; font-weight: 800; }
.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; }
.heic-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) {
  .heic-tool { grid-template-columns: 1fr !important; }
  .heic-form { border-right: 0 !important; border-bottom: 1px solid #dce5ee !important; }
  .preview-box { min-height: 260px; }
}
@media screen and (max-width: 736px) {
  .heic-heading h1 { font-size: 1.9rem; }
  .heic-heading > p:not(.heic-eyebrow) { font-size: .93rem; }
  .heic-form, .heic-preview { padding: 1rem !important; }
  .preview-box { min-height: 210px; }
  .file-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heic-guide-grid { grid-template-columns: 1fr !important; }
  .heic-guide > header h2 { font-size: 1.38rem; }
}
@media screen and (max-width: 480px) {
  .heic-tool { margin-left: -.2rem; margin-right: -.2rem; }
  .heic-panel-head { flex-direction: column; }
  .heic-panel-head button { width: 100%; }
  .heic-dropzone { min-height: 140px; }
  .quality-presets, .custom-resize, .heic-actions { grid-template-columns: 1fr !important; }
  .heic-actions button:first-child { grid-column: auto; }
  .process-list { grid-template-columns: 1fr; }
  .file-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .file-actions .remove-button { width: 100%; margin-left: 0 !important; grid-column: 1 / -1; }
}
