@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --page: #f5f7fb;
  --surface: #fff;
  --surface-soft: #f8f9fc;
  --ink: #17213a;
  --muted: #788198;
  --line: #e8ebf2;
  --primary: rgb(0, 226, 0);
  --primary-dark: rgb(0, 200, 0);
  --primary-very-soft: #43bd4b;
  --primary-very-soft-2: #e9feed;
  --primary-soft: #effff1;
  --star: #6af075;
  --orbit: #d3fbdb;
  --orbit2: #defbe3;
  --btn-bg-hover: #efffef;
  --btn-brd-hover: #c3f4c8;
  --btn-bg: #f7fff7;
  --green: #2f9e75;
  --shadow: 0 12px 35px rgba(37, 46, 78, .055);
  --radius: 18px;
  --color: #c2ffc8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; text-decoration: none; }
.site-header { height: 76px; padding: 0 max(28px, calc((100% - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; 
  border-radius: 12px; color: white; 
  background: linear-gradient(140deg, var(--primary), var(--primary-dark)); 
  font: 800 17px Manrope, sans-serif; letter-spacing: -.08em; 
  box-shadow: 0 5px 12px #6254dc40; }
.brand-mark span { color: #b7f4de; font-size: 13px; }
.brand-copy { display: grid; line-height: 1.2; }
.brand-copy strong { font: 800 15px Manrope, sans-serif; letter-spacing: -.025em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.header-right { display: flex; align-items: center; gap: 19px; }
.domain-label { color: var(--muted); font-size: 12px; }
.language-picker select { min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font-size: 11px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
html[dir=rtl] body { direction: rtl; }
html[dir=rtl] .action-row .button-primary { margin-right: auto; margin-left: 0; }
html[dir=rtl] textarea.code-input, html[dir=rtl] #script-input, html[dir=rtl] #script-result, html[dir=rtl] #sql-source, html[dir=rtl] #sql-result { direction: ltr; text-align: left; }
.icon-button { width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); font-size: 19px; }
.page-shell { max-width: 1240px; margin: auto; padding: 26px 28px 0; }
.hero { position: relative; min-height: 250px; display: flex; align-items: center; justify-content: space-between; overflow: hidden; padding: 30px 64px; border: 1px solid #e7e8f4; border-radius: 22px; background: linear-gradient(112deg, #fff 2%, #fff 49%, #effff1 100%); }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 9px; color: var(--primary); font-size: 10px; font-weight: 700; letter-spacing: .145em; }
.eyebrow-dot { width: 7px; height: 7px; display: inline-block; margin-right: 5px; border-radius: 100%; background: #40b98a; vertical-align: 1px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font: 800 clamp(30px, 4vw, 43px)/1.13 Manrope, sans-serif; letter-spacing: -.055em; }
.gradient-text { color: var(--primary); }
.hero-description { max-width: 560px; margin-bottom: 15px; color: #69738c; font-size: 14px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 18px; color: #69738c; font-size: 11px; }
.hero-points i { margin-right: 5px; color: var(--green); font-style: normal; font-weight: 700; }
.hero-art { position: relative; width: 285px; height: 205px; flex: 0 0 285px; margin-left: 30px; }
.orbit { position: absolute; top: 50%; left: 50%; width: 238px; height: 115px; transform: translate(-50%, -50%) rotate(-24deg); border: 1px solid var(--orbit); border-radius: 50%; }
.orbit-two { width: 204px; height: 166px; transform: translate(-50%, -50%) rotate(42deg); border-color: var(--orbit2); }
.art-card { position: absolute; display: flex; flex-direction: column; border: 1px solid #e5e6f4; border-radius: 13px; background: white; box-shadow: 0 12px 35px #39397412; }
.art-card-back { top: 38px; left: 40px; width: 128px; height: 139px; padding: 42px 15px 15px; gap: 8px; transform: rotate(-8deg); }
.art-lines { width: 100%; height: 5px; border-radius: 5px; background: #e9e9f4; }
.art-lines.short { width: 63%; }
.art-card-front { top: 25px; left: 112px; width: 120px; height: 146px; padding: 17px; transform: rotate(7deg); }
.art-chip { 
  align-self: flex-start; 
  margin-bottom: 14px; 
  padding: 4px 7px; 
  border-radius: 5px; 
  color: var(--primary-very-soft); 
  background: var(--primary-very-soft-2); 
  font-size: 8px; 
  font-weight: 700; 
  letter-spacing: .12em; }
.art-card-front strong { font: 800 19px/1.17 Manrope, sans-serif; letter-spacing: -.04em; }
.art-arrow { position: absolute; right: 15px; bottom: 12px; color: var(--green); font-size: 20px; }
.art-spark { position: absolute; color: var(--star); }
.spark-one { top: 18px; left: 58px; font-size: 23px; }
.spark-two { right: 19px; bottom: 35px; color: #45b58b; font-size: 17px; }
.tabs { display: flex; gap: 6px; margin-top: 23px; padding: 7px; overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.tab-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; white-space: nowrap; border: 0; border-radius: 10px; color: #737c92; background: transparent; font-size: 12px; font-weight: 600; transition: background .15s, color .15s; }
.tab-button:hover { color: var(--ink); background: var(--surface-soft); }
.tab-button.is-active { color: var(--primary); background: var(--primary-soft); }
.tab-icon { font-size: 16px; }
.tab-count { min-width: 21px; padding: 1px 5px; border-radius: 5px; color: var(--primary); background: #dedcff; font-size: 9px; }
.tab-panel { padding-top: 31px; }
.tab-panel[hidden] { display: none; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 21px; }
.panel-heading .eyebrow { margin-bottom: 5px; }
h2 { margin-bottom: 5px; font: 800 25px/1.25 Manrope, sans-serif; letter-spacing: -.045em; }
.panel-heading p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.heading-badge { margin-top: 5px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font: 700 11px Manrope, sans-serif; }
.heading-badge span { color: #b5bbca; }
.workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.conversion-grid { grid-template-columns: minmax(0, 1fr); }
.extraction-card { max-width: 900px; margin: 0 auto; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.controls-card { padding: 21px; }
.card-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.card-heading h3, .output-title h3, .toolbar-title h3 { margin: 0; font: 700 14px Manrope, sans-serif; letter-spacing: -.02em; }
.card-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.step-number { width: 29px; height: 29px; display: grid; flex: 0 0 29px; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 700; }
.drop-zone { position: relative; min-height: 108px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; overflow: hidden; border: 1px dashed #d1d2e6; border-radius: 12px; color: var(--ink); background: #fbfbfe; text-align: center; cursor: pointer; }
.drop-zone:hover { border-color: var(--primary); background: #faf9ff; }
.drop-zone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.visually-hidden-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.conversion-upload-card { max-width: 900px; margin: 0 auto 15px; }
.conversion-upload-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.conversion-upload-actions label { cursor: pointer; }
.drop-zone strong { font-size: 12px; }
.drop-zone small { color: var(--muted); font-size: 10px; }
.drop-icon { width: 24px; height: 24px; display: grid; place-items: center; margin-bottom: 1px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font-size: 15px; }
.selected-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.file-chip { max-width: 100%; overflow: hidden; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; color: #616b83; background: var(--surface-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.button { min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; font-size: 11px; font-weight: 700; transition: .15s ease; }
.button-primary { color: white; background: var(--primary); box-shadow: 0 4px 11px #6254dc2b; }
.button-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.button-secondary { border-color: var(--orbit2); color: var(--primary); background: var(--btn-bg); }
.button-secondary:hover:not(:disabled) { border-color: var(--btn-brd-hover); background: var(--btn-bg-hover); }
.button-quiet { border-color: var(--line); color: #69738a; background: var(--surface); }
.button-quiet:hover:not(:disabled) { color: var(--ink); background: var(--surface-soft); }
.button-full { width: 100%; margin-top: 10px; }
.button-small { min-height: 28px; min-width: 30px; padding: 0 8px; }
.field-block { min-width: 0; margin-top: 15px; }
.field-block > label { display: block; margin-bottom: 6px; color: #434d64; font-size: 10px; font-weight: 700; }
.label-hint { float: right; color: #9299a9; font-size: 9px; font-weight: 400; }
input[type=text], input[type=url], input[type=number], select, textarea { width: 100%; border: 1px solid #e4e7ef; border-radius: 9px; outline: none; color: var(--ink); background: var(--surface); font-size: 11px; transition: border-color .15s, box-shadow .15s; }
input[type=text], input[type=url], input[type=number], select { min-height: 37px; padding: 0 11px; }
textarea { display: block; padding: 10px 11px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: #a7a0ed; box-shadow: 0 0 0 3px #6254dc13; }
input::placeholder, textarea::placeholder { color: #a9afbd; }
select { cursor: pointer; }
.field-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; color: #9aa1b1; font-size: 9px; }
.field-help { display: block; margin-top: 5px; color: #8d95a8; font-size: 9px; line-height: 1.5; }
.template-reset { margin-top: 7px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.action-row .button-primary { margin-left: auto; }
.action-row.tight { gap: 5px; margin-top: 7px; }
.action-row.tight .button { min-height: 30px; padding: 0 9px; font-size: 9px; }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.two-fields .field-block { margin-top: 14px; }
.input-with-button { display: flex; gap: 7px; }
.input-with-button input { flex: 1; min-width: 0; }
.input-with-button .button { flex: 0 0 auto; }
.output-card { margin-top: 16px; padding: 17px 20px 20px; }
.output-title, .toolbar-title { display: flex; align-items: center; justify-content: space-between; }
.output-title > div, .toolbar-title { display: flex; align-items: center; gap: 8px; }
.output-title > span { color: #969daf; font-size: 10px; }
.output-indicator { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #42b889; box-shadow: 0 0 0 4px #42b88918; }
.output-preview { min-height: 115px; max-height: 350px; overflow: auto; margin: 13px 0 0; padding: 13px; border: 1px solid #eceef4; border-radius: 10px; color: #58627a; background: #fafbfe; font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.youtube-layout, .website-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: start; gap: 16px; }
.vtt-card { margin-top: 0; }
.vtt-preview { min-height: 460px; max-height: none; }
.info-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 15px; padding: 12px 14px; border: 1px solid #e4e3fa; border-radius: 11px; background: #f9f8ff; }
.info-note > span { width: 17px; height: 17px; display: grid; flex: 0 0 17px; place-items: center; border-radius: 50%; color: var(--primary); background: var(--primary-very-soft-2); font-size: 10px; font-weight: 700; }
.info-note p { margin: 0; color: #707a92; font-size: 10px; }
.website-result { min-height: 410px; background: #fafbfe; }
.feature-heading { margin: 34px 0 16px; }
.feature-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.feature-tool { min-width: 0; }
.feature-tool .field-help { display: block; margin: 8px 0 12px; }
.feature-tool textarea { font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.feature-tool input[type=file] { width: 100%; }
.status-banner { margin-top: 13px; padding: 10px 13px; border: 1px solid #d7ecdf; border-radius: 9px; color: #2b795e; background: #f0faf4; font-size: 11px; }
.status-banner[data-type=error] { border-color: #f4d8d8; color: #a64242; background: #fff5f5; }
.status-banner[data-type=info] { border-color: #e4e3fa; color: #5b52a7; background: var(--btn-bg); }

.split-layout { display: grid; grid-template-columns: minmax(290px, 360px) minmax(0, 1fr); align-items: start; gap: 15px; }
.split-sidebar { display: grid; gap: 12px; }
.split-card { padding: 16px; }
.card-heading.compact { margin-bottom: 13px; }
.card-heading.compact .step-number { width: 25px; height: 25px; flex-basis: 25px; border-radius: 8px; }
.card-heading.compact h3 { font-size: 12px; }
.card-heading.compact p { font-size: 9px; }
.compact-drop { min-height: 86px; }
.source-list { display: grid; gap: 5px; max-height: 205px; overflow: auto; margin-top: 9px; }
.source-row { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: grab; }
.source-row.is-selected { border-color: #beb9f0; background: #faf9ff; }
.source-row.is-dragging, .group-row.is-dragging { opacity: .45; }
.source-row .source-name { min-width: 0; flex: 1; overflow: hidden; color: #566078; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.source-row .source-type { color: #949bad; font-size: 8px; text-transform: uppercase; }
.source-row .source-state { color: var(--green); font-size: 11px; }
.source-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px; margin-top: 8px; }
.source-actions .button { min-height: 30px; padding: 0 9px; font-size: 9px; }
.split-summary { margin-top: 9px; color: var(--muted); font-size: 9px; }
.input-with-checkbox { display: flex; align-items: center; gap: 8px; }
.input-with-checkbox > input { flex: 1; min-width: 0; }
.checkbox-label { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; color: #737c91; font-size: 9px; white-space: nowrap; }
.checkbox-label input { accent-color: var(--primary); }
.visual-preview { min-height: 145px; max-height: 320px; overflow: auto; padding: 10px; border: 1px solid #e4e7ef; border-radius: 9px; color: #58627a; background: #fafbfe; font: 10px/1.65 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.visual-preview:focus { border-color: #a7a0ed; box-shadow: 0 0 0 3px #6254dc13; outline: none; }
.visual-preview.is-empty::before { color: #a9afbd; content: attr(data-placeholder); }
.visual-split-marker { border-radius: 3px; color: #176b3b; background: #d7f6df; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.visual-split-marker.is-selected { outline: 2px solid #40a66b; }
.visual-dialog { width: min(920px, calc(100vw - 32px)); max-height: min(90vh, 900px); margin: auto; padding: 20px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface); box-shadow: 0 22px 70px #11182735; }
.visual-dialog::backdrop { background: #10162980; backdrop-filter: blur(2px); }
.visual-dialog-heading h2 { margin: 0 0 4px; font: 700 19px Manrope, sans-serif; }
.visual-dialog-heading p { margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.visual-dialog > .field-block { margin-bottom: 10px; }
.visual-dialog .visual-preview { min-height: 260px; max-height: 48vh; font-size: 12px; }
.visual-dialog-actions, .visual-dialog-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.visual-marker-count { margin-left: auto; color: var(--muted); font-size: 10px; }
.visual-marker-list { display: grid; gap: 5px; max-height: 120px; overflow: auto; margin-top: 10px; }
.visual-marker-item { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface-soft); font-size: 10px; text-align: left; }
.visual-marker-item.is-selected { border-color: #55ad76; background: #e8f8ed; }
.visual-dialog-footer { justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--line); }
.marker-highlight { border-radius: 3px; background: #d7f2e7; color: #245c49; }
.split-workspace { min-height: 810px; padding: 17px; }
.workspace-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.workspace-toolbar > div:first-child { display: grid; gap: 5px; }
.workspace-toolbar .field-help { margin: 0; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.toolbar-actions .button, .workspace-footer .button { min-height: 30px; padding: 0 9px; font-size: 9px; }
.group-list { display: grid; align-content: start; gap: 8px; min-height: 630px; max-height: 75vh; overflow-y: auto; padding: 13px 2px; }
.empty-state { min-height: 350px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #8e97aa; text-align: center; }
.empty-state strong { color: #59637a; font-size: 12px; }
.empty-state > span:last-child { font-size: 10px; }
.empty-icon { width: 45px; height: 45px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 14px; color: var(--primary); background: var(--primary-soft); font-size: 22px; }
.small-empty { min-height: 55px; font-size: 9px; }
.group-row { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: grab; transition: border-color .12s, background .12s; }
.group-row:hover { border-color: #d0ccef; }
.group-row.is-selected { border-color: #aba4eb; background: #faf9ff; box-shadow: 0 0 0 2px #6254dc10; }
.group-select { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; border: 0; color: inherit; background: transparent; text-align: left; }
.group-select input { accent-color: var(--primary); }
.group-index { width: 26px; height: 26px; display: grid; flex: 0 0 26px; place-items: center; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 700; }
.group-copy { min-width: 0; display: grid; gap: 2px; }
.group-copy strong { overflow: hidden; color: #364159; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.group-copy small { color: #9299aa; font-size: 9px; }
.group-snippet { max-width: 210px; overflow: hidden; color: #858da0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.group-row .group-menu { border: 0; color: #9299aa; background: transparent; font-size: 15px; }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid var(--line); color: #9299aa; font-size: 9px; }
.workspace-footer > div { display: flex; gap: 4px; }

input[type=file]::file-selector-button{ 
  font: inherit; 
  min-height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid #e1defa;
  color: var(--primary);
  background: var(--btn-bg); 
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  transition: .15s ease;
}

input[type=file]::file-selector-button:hover{ 
  border-color: var(--btn-brd-hover);
  background: var(--btn-bg-hover);
 }


.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding: 17px 0 21px; border-top: 1px solid var(--line); color: #9299aa; font-size: 10px; }
.site-footer a { color: var(--primary); }

body.dark {
  color-scheme: dark;
  --page: #121521;
  --surface: #1b2030;
  --surface-soft: #22283a;
  --ink: #edf0fb;
  --muted: #9da6bd;
  --line: #30374b;
  --primary-soft: #2d5538;
  --shadow: 0 12px 35px #00000020;
  --btn-bg-hover: #243a24;
  --btn-brd-hover: #47604b;

  --orbit: #354338;
  --orbit2: #415a45;
  --btn-bg: #1e2f1e;
}
body.dark .site-header { background: var(--surface); }
body.dark .hero { border-color: var(--line); background: linear-gradient(112deg, #1d301b 2%, #1b2030 49%, #27462a 100%); }
body.dark .hero-description, body.dark .hero-points, body.dark .panel-heading p:not(.eyebrow), body.dark .card-heading p, body.dark .field-block > label { color: #aab2c8; }
body.dark .art-card { border-color: var(--line); background: #252b3e; }
body.dark .art-lines { background: #3a4155; }
body.dark .drop-zone, body.dark .output-preview, body.dark .website-result, body.dark .visual-preview { border-color: var(--line); color: #b9c1d5; background: #171c2a; }
body.dark .visual-preview { border-color: var(--line); color: #b9c1d5; background: #171c2a; }
body.dark .visual-dialog { border-color: var(--line); color: var(--ink); background: var(--surface); }
body.dark .visual-marker-item { border-color: var(--line); color: var(--ink); background: #171c2a; }
body.dark .visual-marker-item.is-selected { border-color: #55ad76; background: #193628; }
body.dark .visual-split-marker { color: #b6f0c5; background: #234b35; }
body.dark .button-secondary { border-color: var(--orbit2); color: var(--color); background: var(--btn-bg); }
body.dark .button-quiet, body.dark input[type=text], body.dark input[type=url], body.dark input[type=number], body.dark select, body.dark textarea { border-color: var(--line); color: var(--ink); background: #171c2a; }
body.dark .file-chip, body.dark .source-row, body.dark .group-row { border-color: var(--line); color: #bdc5d8; background: #1b2030; }
body.dark .source-row.is-selected, body.dark .group-row.is-selected { border-color: #7770bb; background: #26243e; }
body.dark .group-copy strong { color: #e4e8f5; }
body.dark .info-note { border-color: #3f3a68; background: #24223b; }
body.dark .info-note p { color: #b1b8cc; }
body.dark .status-banner[data-type=error] { border-color: #5b3e48; color: #ffaaaa; background: #33242c; }
body.dark .status-banner:not([data-type=error]) { border-color: #315746; color: #9fe0bf; background: #1c3029; }

@media (max-width: 900px) {
  .page-shell { padding-right: 18px; padding-left: 18px; }
  .hero { padding: 29px 35px; }
  .hero-art { transform: scale(.85); transform-origin: center right; margin-left: 4px; }
  .tab-button { padding: 0 12px; }
  .split-layout { grid-template-columns: minmax(270px, 320px) minmax(0, 1fr); }
  .split-workspace { padding: 13px; }
  .group-snippet { display: none; }
}
@media (max-width: 700px) {
  .site-header { height: 62px; padding: 0 17px; }
  .domain-label { display: none; }
  .page-shell { padding: 15px 13px 0; }
  .hero { min-height: 0; padding: 25px 22px; }
  .hero-art { position: absolute; right: -58px; bottom: -34px; opacity: .23; transform: scale(.82); }
  .hero-copy { max-width: 100%; }
  .hero-description { max-width: 440px; font-size: 12px; }
  .hero-points { gap: 9px 14px; font-size: 10px; }
  .tabs { margin-top: 14px; }
  .tab-button { min-height: 40px; padding: 0 11px; font-size: 10px; }
  .tab-panel { padding-top: 23px; }
  .panel-heading { gap: 10px; }
  .panel-heading h2 { font-size: 21px; }
  .panel-heading .heading-badge { display: none; }
  .workspace-grid, .youtube-layout, .website-grid, .feature-tools-grid { grid-template-columns: 1fr; }
  .vtt-card { margin-top: 0; }
  .vtt-preview { min-height: 300px; }
  .controls-card { padding: 16px; }
  .website-result { min-height: 300px; }
  .split-layout { grid-template-columns: 1fr; }
  .split-workspace { min-height: 500px; }
  .group-list { min-height: 350px; max-height: 60vh; }
  .workspace-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { justify-content: flex-start; }
  .site-footer { flex-wrap: wrap; font-size: 9px; }
}
@media (max-width: 420px) {
  .hero { padding: 22px 17px; }
  .hero-points { display: grid; grid-template-columns: 1fr 1fr; }
  .card-heading { margin-bottom: 15px; }
  .action-row .button { flex: 1; }
  .action-row .button-primary { margin-left: 0; }
  .two-fields { gap: 7px; }
  .workspace-footer { align-items: flex-start; flex-direction: column; }
}
