:root {
  color-scheme: light;
  --bg: #eef2f7;
  --bg-accent: radial-gradient(circle at top left, rgba(99, 102, 241, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(53, 181, 106, 0.12), transparent 26%),
    linear-gradient(180deg, #f7f9fc 0%, #edf2f7 100%);
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-muted: rgba(232, 237, 246, 0.8);
  --border: rgba(34, 52, 84, 0.12);
  --text: #0f1729;
  --muted: #56647d;
  --shadow-1: 0 20px 48px rgba(24, 38, 62, 0.08);
  --shadow-2: 0 18px 36px rgba(16, 30, 58, 0.12);
  --sky: #4ab7ff;
  --yellow: #f5c64b;
  --red: #ef5a5a;
  --blue: #4f46e5;
  --green: #10b981;
  --accent: #6366f1;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1322;
  --bg-accent: radial-gradient(circle at top left, rgba(99, 102, 241, 0.24), transparent 34%),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.14), transparent 28%),
    linear-gradient(180deg, #101929 0%, #0b1322 100%);
  --surface: rgba(14, 22, 38, 0.78);
  --surface-strong: rgba(16, 26, 45, 0.95);
  --surface-muted: rgba(19, 31, 54, 0.82);
  --border: rgba(145, 170, 220, 0.16);
  --text: #edf3ff;
  --muted: #aab9d7;
  --shadow-1: 0 24px 54px rgba(0, 0, 0, 0.38);
  --shadow-2: 0 20px 44px rgba(0, 0, 0, 0.5);
  --accent: #818cf8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", sans-serif;
  background: var(--bg-accent);
  color: var(--text);
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

button,
select,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* App Shell Layout */
.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template-rows: minmax(70px, 9svh) 1fr;
  padding: clamp(0.9rem, 1.8vw, 1.5rem);
  gap: clamp(0.9rem, 1.8vw, 1.3rem);
}

.top-strip,
.workspace,
.tab-panel,
.converter-layout {
  min-width: 0;
}

/* Header strip */
.top-strip {
  position: relative;
  z-index: 300;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-1);
  padding: clamp(0.38rem, 0.84vw, 0.52rem);
}

.top-strip-inner {
  height: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

/* App Menu dropdown */
.app-menu {
  position: relative;
  z-index: 320;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: 0 12px 24px rgba(21, 34, 59, 0.08);
  font-weight: 760;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.app-brand-mark {
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.08));
  color: var(--accent);
}

.app-brand-icon {
  width: 1rem;
  height: 1rem;
}

.app-brand-caret {
  width: 0.5rem;
  height: 0.5rem;
  margin-left: 0.2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.app-menu-toggle[aria-expanded="true"] .app-brand-caret {
  transform: rotate(225deg) translate(-0.04rem, -0.04rem);
}

.app-main-menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  z-index: 1000;
  width: min(20rem, calc(100vw - 2rem));
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(18px);
  animation: slideMenuDown 0.2s ease;
}

@keyframes slideMenuDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-main-menu-list {
  display: grid;
  gap: 0.3rem;
}

.app-main-menu-separator {
  height: 1px;
  margin: 0.4rem 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.app-main-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.2s, background-color 0.2s, transform 0.15s;
}

.app-main-menu-item:hover,
.app-main-menu-item:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.24);
  background: rgba(99, 102, 241, 0.08);
}

.app-main-menu-item.is-active {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.12);
}

.app-main-menu-icon-wrap {
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
}

.app-main-menu-icon {
  width: 0.95rem;
  height: 0.95rem;
}

/* Step Navigation */
.step-nav {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.45rem, 0.8vw, 0.65rem);
}

.step-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  padding: 0.4rem clamp(0.5rem, 1vw, 0.8rem);
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.step-sequence {
  min-width: 0.9rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  opacity: 0.65;
}

.step-button:hover,
.step-button:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: var(--border);
  background: var(--surface-strong);
  box-shadow: 0 12px 24px rgba(21, 34, 59, 0.06);
}

.step-button.is-active {
  background: var(--surface-strong);
  border-color: var(--border);
  box-shadow: var(--shadow-2);
}

.step-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}

.step-badge-sky {
  background: linear-gradient(135deg, #818cf8, #4f46e5);
}

.step-badge-yellow {
  background: linear-gradient(135deg, #fbbf24, #d97706);
}

.step-badge-green {
  background: linear-gradient(135deg, #34d399, #059669);
}

.step-icon {
  width: 1rem;
  height: 1rem;
}

.step-label {
  font-size: clamp(0.72rem, 0.76vw, 0.84rem);
  font-weight: 700;
}

.step-count-badge {
  position: absolute;
  right: -0.25rem;
  top: -0.25rem;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.3rem;
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(255,255,255,0.2);
}

/* Actions */
.top-strip-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.top-strip-action {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: 0 8px 16px rgba(21, 34, 59, 0.04);
  transition: transform 180ms ease, border-color 180ms ease;
}

.top-strip-action:hover,
.top-strip-action:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.35);
}

.top-strip-action-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.theme-icon {
  grid-area: 1 / 1;
  width: 1.1rem;
  height: 1.1rem;
  transition: opacity 180ms, transform 180ms;
}

.theme-icon-sun { opacity: 0; transform: scale(0.8) rotate(-15deg); }
.theme-icon-moon { opacity: 1; transform: scale(1) rotate(0); }

html[data-theme="dark"] .theme-icon-sun { opacity: 1; transform: scale(1) rotate(0); }
html[data-theme="dark"] .theme-icon-moon { opacity: 0; transform: scale(0.8) rotate(15deg); }

/* Workspace Box */
.workspace {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 32px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  height: 100%;
}

.tab-panel {
  display: none;
  height: 100%;
  padding: clamp(1rem, 2vw, 1.5rem);
  overflow-y: auto;
}

.tab-panel.is-active {
  display: block;
}

/* Layouts inside panels */
.converter-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 3fr;
  gap: clamp(1rem, 2vw, 1.5rem);
  height: 100%;
  align-items: stretch;
}

.converter-layout.single-layout {
  grid-template-columns: 1fr;
}

.card-surface {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-2);
  padding: 1.25rem;
}

.converter-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.sidebar-header {
  margin-bottom: 1.2rem;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.field-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* Size select checkboxes */
.size-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.col-span-2 {
  grid-column: span 2;
}

.size-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.size-checkbox-wrapper:hover {
  border-color: rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.04);
}

.size-checkbox-wrapper input {
  display: none;
}

.custom-checkbox {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: inline-block;
  position: relative;
  transition: background-color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.size-checkbox-wrapper input:checked + .custom-checkbox {
  background-color: var(--accent);
  border-color: var(--accent);
}

.size-checkbox-wrapper input:checked + .custom-checkbox::after {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.1rem;
  width: 0.3rem;
  height: 0.55rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  font-size: 0.82rem;
  font-weight: 600;
}

/* Sliders */
.slider-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.slider-value {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
}

#padding-slider {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  outline: none;
  -webkit-appearance: none;
}

#padding-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.1s;
}

#padding-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Toggle Switch Checkbox */
.toggle-checkbox-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.4rem;
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  cursor: pointer;
}

.toggle-wrapper input {
  display: none;
}

.custom-switch {
  order: 2;
  position: relative;
  width: 2.4rem;
  height: 1.35rem;
  background-color: var(--border);
  border-radius: 99px;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.custom-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-wrapper input:checked + .custom-switch {
  background-color: var(--accent);
}

.toggle-wrapper input:checked + .custom-switch::after {
  transform: translateX(16px);
}

.toggle-label {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Content Panel upload area */
.converter-content {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.5rem);
  height: 100%;
  min-height: 0;
}

/* Drag and Drop Zone */
.dropzone-wrapper {
  border: 2px dashed var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--surface-strong), var(--surface-muted));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  cursor: pointer;
  min-height: 220px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

html[data-theme="dark"] .dropzone-wrapper {
  background: linear-gradient(180deg, rgba(16, 26, 45, 0.7), rgba(18, 30, 52, 0.4));
}

.dropzone-wrapper:hover,
.dropzone-wrapper.is-drag-over {
  border-color: var(--accent);
  box-shadow: 0 18px 36px rgba(99, 102, 241, 0.12);
  transform: translateY(-2px);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 32rem;
}

.dropzone-icon-wrap {
  width: 4rem;
  height: 4rem;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.dropzone-icon-wrap.yellow-accent {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}

.dropzone-icon {
  width: 2rem;
  height: 2rem;
}

.dropzone-inner h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 750;
}

.dropzone-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Results panel */
.results-container {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  flex: 1 1 auto;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.results-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.results-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.results-grid {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 0.85rem;
  padding-right: 0.25rem;
}

/* Result Cards */
.result-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-strong);
  box-shadow: 0 8px 24px rgba(16, 30, 58, 0.04);
  transition: transform 0.18s, border-color 0.18s;
  animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.28);
}

.result-preview-box {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 18px;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.result-preview-image {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  display: block;
}

.result-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.result-filename {
  font-size: 0.98rem;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-metadata {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.res-pill {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.7rem;
}

.badge-res-active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.2);
}

.result-actions {
  display: flex;
  gap: 0.5rem;
}

/* Button UI */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: transform 0.15s, opacity 0.15s, background-color 0.15s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 90%, white);
}

.btn-success {
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.15);
}

.btn-success:hover {
  background: color-mix(in srgb, var(--green) 90%, white);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  color: var(--text);
}

.btn-secondary:hover {
  border-color: rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.05);
}

.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 8px 16px rgba(239, 90, 90, 0.15);
}

.btn-danger:hover {
  background: #d64f4f;
}

.btn-icon-svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.btn-compact {
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  font-size: 0.78rem;
}

/* Settings styling */
.settings-layout {
  display: flex;
  justify-content: center;
  width: 100%;
}

.settings-card {
  width: min(100%, 48rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-section h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.section-desc {
  margin: 0 0 1.25rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

.settings-control-group {
  display: grid;
  gap: 0.95rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.settings-row.vertical {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.settings-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.settings-copy strong {
  font-size: 0.92rem;
  font-weight: 750;
}

.settings-copy span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
}

.settings-action-block {
  display: flex;
  align-items: center;
}

.gap-2 {
  gap: 0.5rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.form-select {
  min-height: 2.6rem;
  padding: 0.45rem 1.8rem 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-strong);
  font-size: 0.85rem;
  font-weight: 650;
  outline: none;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--accent);
}

.zoom-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#zoom-slider {
  width: 7.5rem;
  outline: none;
}

.zoom-badge {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  border-radius: 8px;
}

.settings-divider {
  height: 1px;
  background: var(--border);
}

/* Help modal */
.help-dialog {
  width: min(92vw, 42rem);
  border: none;
  padding: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.help-dialog::backdrop {
  background: rgba(10, 16, 27, 0.55);
  backdrop-filter: blur(5px);
}

.help-dialog-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.help-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.help-dialog-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.help-dialog-brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(99,102,241,0.2), rgba(99,102,241,0.08));
  color: var(--accent);
  flex-shrink: 0;
}

.help-dialog-brand-icon {
  width: 1.2rem;
  height: 1.2rem;
}

.help-dialog-brand-copy {
  display: grid;
  gap: 0.2rem;
  line-height: 1.35;
}

.help-dialog-brand-copy strong {
  font-size: 0.95rem;
  font-weight: 800;
}

.help-dialog-brand-copy span {
  font-size: 0.82rem;
  color: var(--muted);
}

.help-dialog-brand-copy a {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.help-dialog-brand-copy a:hover {
  text-decoration: underline;
}

.help-dialog-update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 650;
  transition: border-color 0.15s, background-color 0.15s;
}

.tool-button:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.05);
}

.tool-button-prominent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tool-button-prominent:hover {
  background: color-mix(in srgb, var(--accent) 90%, white);
}

.help-dialog-close {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, background-color 0.15s;
}

.help-dialog-close:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.05);
}

.help-dialog-body {
  padding: 1.25rem;
  max-height: 60vh;
  overflow-y: auto;
}

.help-dialog-body p {
  margin: 0 0 0.85rem;
  line-height: 1.55;
  font-size: 0.88rem;
}

.help-dialog-steps {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.55rem;
  font-size: 0.86rem;
  line-height: 1.5;
}

.help-dialog-shortcuts-title {
  margin: 1rem 0 0.55rem;
  font-weight: 800;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.help-dialog-shortcuts {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.84rem;
  line-height: 1.5;
}

/* Stepper Tutorial Dialog */
.tutorial-dialog {
  width: min(94vw, 36rem);
}

.tutorial-dialog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.tutorial-image-row {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(99, 102, 241, 0.02);
  border-bottom: 1px solid var(--border);
}

.tutorial-slide-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-controls-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
}

.tutorial-nav-button {
  min-width: 6.5rem;
  justify-content: center;
}

.tutorial-checkbox-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}

.tutorial-checkbox-label input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

/* Update Modal Layout */
.update-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.update-check-status {
  margin-bottom: 0.8rem;
  font-weight: 800;
  font-size: 0.92rem;
}

.update-check-status[data-status="running"] { color: var(--accent); }
.update-check-status[data-status="success"] { color: var(--green); }
.update-check-status[data-status="error"] { color: var(--red); }
.update-check-status[data-status="warning"] { color: var(--yellow); }

.update-check-log {
  margin: 0;
  min-height: 10rem;
  max-height: 18rem;
  overflow: auto;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #0f172a;
  color: #f1f5f9;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Snackbar (Notice) */
.snackbar {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 1000;
  min-width: 18rem;
  max-width: 90vw;
  padding: 0.9rem 1.4rem;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  font-weight: 650;
  font-size: 0.86rem;
  line-height: 1.4;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.snackbar.is-visible {
  transform: translateX(-50%) translateY(0);
}

/* Responsive details */
@media (max-width: 768px) {
  .converter-layout {
    grid-template-columns: 1fr;
  }
  .app-shell {
    grid-template-rows: auto 1fr;
  }
  .step-button .step-label {
    display: none;
  }
  .step-button {
    justify-content: center;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}
