:root {
  --bg: #f4f7fb;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-strong: #ffffff;
  --surface-soft: #f8fafc;
  --text: #141821;
  --muted: #647084;
  --line: #dfe6ef;
  --line-strong: #c6d0dd;
  --primary: #2457d6;
  --primary-strong: #183fa1;
  --accent: #d46d2f;
  --accent-soft: #fff0e7;
  --focus: #1f7cf1;
  --success: #27805f;
  --warning: #a35324;
  --shadow: 0 20px 42px rgba(20, 24, 33, 0.09);
  --shadow-soft: 0 12px 28px rgba(20, 24, 33, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, #fbfcff 0%, var(--bg) 55%, #eef3f8 100%);
  font-family:
    "Malgun Gothic",
    "Apple SD Gothic Neo",
    system-ui,
    sans-serif;
}

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

button,
input,
select,
textarea {
  border-radius: 8px;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  padding: 0 16px;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

button:hover:not(:disabled) {
  border-color: #9fb2a4;
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 124, 241, 0.24);
  outline-offset: 1px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.68;
  padding: 16px;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

input::placeholder,
textarea::placeholder {
  color: #87948e;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.document-page {
  width: min(100% - 32px, 920px);
  margin: 0 auto;
  padding: 34px 0 44px;
  display: grid;
  gap: 18px;
}

.document-panel {
  display: grid;
  gap: 22px;
  border: 1px solid rgba(223, 230, 239, 0.98);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  padding: clamp(24px, 4vw, 42px);
}

.document-panel .eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.document-panel h1 {
  color: #171b26;
  font-size: clamp(1.8rem, 4vw, 2.55rem);
  line-height: 1.18;
}

.document-panel section {
  display: grid;
  gap: 10px;
  border-top: 1px solid #edf1f6;
  padding-top: 20px;
}

.document-panel section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.document-panel h2 {
  color: #202633;
  font-size: 1.08rem;
  line-height: 1.35;
}

.document-panel p {
  color: #4f5a69;
  font-size: 0.98rem;
  line-height: 1.82;
}

.document-panel > p:last-child a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid #dfe6ef;
  border-radius: 999px;
  background: #f8fafc;
  color: #202633;
  font-weight: 800;
  padding: 0 14px;
  text-decoration: none;
}

.document-updated {
  color: var(--muted) !important;
  font-size: 0.88rem !important;
}

.site-layout {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.content-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.app-shell {
  display: grid;
  gap: 18px;
}

.ad-slot {
  display: none;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
}

.ad-slot:not(:empty) {
  display: block;
}

.ad-band:not(:empty) {
  min-height: 90px;
}

.ad-rail:not(:empty) {
  min-height: 280px;
}

.ad-slot > ins {
  display: block;
  width: 100%;
}

@media (min-width: 1520px) {
  .site-layout:has(.ad-rail:not(:empty)) {
    width: min(1720px, calc(100% - 28px));
    grid-template-columns: minmax(130px, 180px) minmax(0, 1420px) minmax(130px, 180px);
  }

  .site-layout:has(.ad-rail:not(:empty)) .ad-rail {
    position: sticky;
    top: 16px;
  }
}

.platform-hero,
.panel,
.tool-sidebar {
  border: 1px solid rgba(223, 230, 239, 0.98);
  box-shadow: var(--shadow);
}

.platform-hero,
.panel {
  background: var(--surface);
}

.platform-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: 8px;
  padding: 20px 22px;
}

.hero-copy {
  display: grid;
  gap: 8px;
  max-width: 820px;
}

.hero-copy h1 {
  font-size: clamp(1.85rem, 3vw, 2.6rem);
  line-height: 1.08;
}

.hero-copy p:last-child {
  color: #33423d;
  line-height: 1.7;
}

.hero-meta {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.platform-hero .hero-meta .status-group {
  display: none;
}

.status-pill,
.record-pill,
.mini-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  background: #edf2ed;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.record-pill.active {
  background: var(--accent-soft);
  color: var(--warning);
}

.secondary-action {
  border-color: #b8c5bd;
  background: #f7faf8;
}

label.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid #b8c5bd;
  border-radius: 8px;
  background: #f7faf8;
  color: var(--text);
  cursor: pointer;
  padding: 0 16px;
}

label.secondary-action:hover {
  border-color: #9fb2a4;
  transform: translateY(-1px);
}

.primary-action {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}

.primary-action:hover:not(:disabled) {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.danger-action {
  border-color: #c87a5b;
  background: #fff3ee;
  color: #8d3d1d;
}

.platform-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
}

body[data-page="home"] .site-layout,
body.home-mode .site-layout {
  width: min(1180px, calc(100% - 32px));
}

body[data-page="home"] .platform-grid,
body.home-mode .platform-grid {
  grid-template-columns: minmax(0, 1fr);
}

body[data-page="home"] .tool-sidebar,
body.home-mode .tool-sidebar,
body[data-page="home"] .info-grid,
body.home-mode .info-grid,
body[data-page="home"] .platform-hero .status-group,
body.home-mode .platform-hero .status-group {
  display: none;
}

body[data-page="home"] .platform-hero,
body.home-mode .platform-hero {
  align-items: center;
  min-height: 118px;
  border-left: 4px solid var(--primary);
}

body[data-page="home"] .hero-copy,
body.home-mode .hero-copy {
  max-width: 880px;
}

.tool-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 18px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 800;
  color: #31403a;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row button,
.tool-link,
.tool-launch-card,
.home-category-links a {
  --category-accent: #6f7b86;
  --category-ink: #3f4a56;
  --category-soft: #f4f6f8;
  --category-border: #dde4ec;
}

.chip-row button[data-category="음성"],
.tool-link[data-category="음성"],
.tool-launch-card[data-category="음성"],
.home-category-links a[data-category="음성"] {
  --category-accent: #0f8a78;
  --category-ink: #0d6659;
  --category-soft: #e8f7f4;
  --category-border: #b9e3db;
}

.chip-row button[data-category="영상"],
.tool-link[data-category="영상"],
.tool-launch-card[data-category="영상"],
.home-category-links a[data-category="영상"] {
  --category-accent: #c64f42;
  --category-ink: #9f3d34;
  --category-soft: #fff0ee;
  --category-border: #f4c7c1;
}

.chip-row button[data-category="텍스트"],
.tool-link[data-category="텍스트"],
.tool-launch-card[data-category="텍스트"],
.home-category-links a[data-category="텍스트"] {
  --category-accent: #2563c9;
  --category-ink: #1f4f9f;
  --category-soft: #eef5ff;
  --category-border: #c9dcff;
}

.chip-row button[data-category="이미지"],
.tool-link[data-category="이미지"],
.tool-launch-card[data-category="이미지"],
.home-category-links a[data-category="이미지"] {
  --category-accent: #b15b12;
  --category-ink: #8e470e;
  --category-soft: #fff6e8;
  --category-border: #f3d4aa;
}

.chip-row button[data-category="PDF"],
.tool-link[data-category="PDF"],
.tool-launch-card[data-category="PDF"],
.home-category-links a[data-category="PDF"] {
  --category-accent: #6750c9;
  --category-ink: #5140a0;
  --category-soft: #f1eeff;
  --category-border: #d6cffc;
}

.chip-row button[data-category="자막"],
.tool-link[data-category="자막"],
.tool-launch-card[data-category="자막"],
.home-category-links a[data-category="자막"] {
  --category-accent: #1f8a52;
  --category-ink: #17683e;
  --category-soft: #effaf3;
  --category-border: #c6e9d1;
}

.chip-row button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border-color: var(--category-border);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, var(--category-soft) 100%);
  color: var(--category-ink);
  padding: 0 13px;
  font-size: 0.85rem;
  font-weight: 800;
}

.chip-row button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--category-accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.72);
  flex: 0 0 auto;
}

.chip-row button small {
  color: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  opacity: 0.72;
}

.chip-row button.is-active {
  border-color: var(--category-accent);
  background: var(--category-accent);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(20, 24, 33, 0.1);
}

.chip-row button.is-active::before {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.tool-list {
  display: grid;
  gap: 10px;
}

.tool-link {
  position: relative;
  display: grid;
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--category-border);
  border-radius: 8px;
  background: linear-gradient(90deg, var(--category-soft) 0, #ffffff 36%);
  color: inherit;
  text-decoration: none;
  padding: 14px 14px 14px 16px;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.tool-link::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--category-accent);
}

.tool-link:hover,
.tool-link.is-active {
  border-color: var(--category-accent);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.tool-link.is-active {
  background: linear-gradient(90deg, var(--category-soft) 0, #ffffff 48%);
}

.tool-link-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-link-category {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid var(--category-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--category-ink);
  font-size: 0.75rem;
  font-weight: 900;
  padding: 0 9px;
}

.tool-link strong {
  font-size: 0.96rem;
}

.tool-link p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.tool-link-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-link-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #566372;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0 10px;
}

.workspace-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.panel {
  border-radius: 8px;
}

.overview-panel,
.workspace-panel,
.guide-panel,
.related-panel {
  padding: 18px;
}

.overview-panel {
  display: grid;
  gap: 18px;
}

.overview-header {
  display: grid;
  gap: 8px;
}

.overview-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
}

.overview-header p {
  color: #32413b;
  line-height: 1.75;
}

.overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mini-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfdfb;
  padding: 14px;
}

.mini-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.mini-card strong {
  font-size: 1rem;
}

.workspace-panel {
  min-width: 0;
}

.tool-workspace {
  display: grid;
  gap: 16px;
}

body[data-page="home"] .overview-panel,
body.home-mode .overview-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-color: #1e2a3a;
  background: #182233;
  color: #ffffff;
  padding: 18px 20px;
}

body[data-page="home"] .overview-header p,
body.home-mode .overview-header p {
  color: #d7e0ec;
}

body[data-page="home"] .overview-header .eyebrow,
body.home-mode .overview-header .eyebrow {
  color: #9bb7ff;
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
}

.home-metrics span {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 72px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
}

.home-metrics strong {
  font-size: 1.2rem;
  line-height: 1;
}

.home-metrics small {
  color: #bdc9d8;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

body[data-page="home"] .workspace-panel,
body.home-mode .workspace-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

body[data-page="home"] .tool-workspace,
body.home-mode .tool-workspace {
  gap: 24px;
}

.home-tool-section {
  display: grid;
  gap: 12px;
}

.home-tool-section + .home-tool-section {
  padding-top: 10px;
  border-top: 1px solid rgba(198, 208, 221, 0.86);
}

.home-section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.home-section-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.home-section-copy {
  display: grid;
  gap: 3px;
}

.home-section-copy h2 {
  font-size: 1.08rem;
}

.home-section-copy p:last-child {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.home-section-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 10px;
}

.tool-launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.tool-launch-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 11px;
  min-height: 194px;
  overflow: hidden;
  border: 1px solid var(--category-border);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, var(--category-soft) 140%);
  color: inherit;
  text-decoration: none;
  padding: 16px;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

.tool-launch-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--category-accent);
}

.tool-launch-card:hover {
  border-color: var(--category-accent);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.tool-launch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tool-launch-card strong {
  font-size: 1rem;
  line-height: 1.45;
}

.tool-launch-card p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.62;
}

.tool-launch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(36, 87, 214, 0.14);
  border-radius: 8px;
  background: #edf3ff;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0;
}

.tool-launch-card[data-category="텍스트"] .tool-launch-icon {
  border-color: rgba(39, 128, 95, 0.18);
  background: #eaf7f1;
  color: #1f6f51;
}

.tool-launch-card[data-category="이미지"] .tool-launch-icon {
  border-color: rgba(212, 109, 47, 0.2);
  background: #fff0e7;
  color: #a35324;
}

.tool-launch-card[data-category="PDF"] .tool-launch-icon {
  border-color: rgba(111, 91, 210, 0.2);
  background: #f0edff;
  color: #5745b8;
}

.tool-launch-card[data-category="자막"] .tool-launch-icon {
  border-color: rgba(18, 111, 153, 0.2);
  background: #e8f6fb;
  color: #126f99;
}

.tool-launch-card[data-category] .tool-launch-icon {
  border-color: var(--category-border);
  background: var(--category-soft);
  color: var(--category-ink);
}

.tool-launch-action {
  align-self: end;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 900;
}

.tool-launch-action::after {
  content: " >";
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading h2 {
  font-size: 1.05rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.guide-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.guide-list li {
  color: #31413b;
  line-height: 1.65;
}

.guide-list strong,
.guide-list span {
  display: block;
}

.guide-list span {
  color: var(--muted);
}

.tool-detail-accordion {
  overflow: hidden;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  background: #ffffff;
  margin-top: 16px;
}

.tool-detail-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #242936;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
  padding: 14px 16px;
}

.tool-detail-accordion summary::-webkit-details-marker {
  display: none;
}

.tool-detail-accordion summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f2f4f7;
  color: #667085;
  font-weight: 900;
}

.tool-detail-accordion[open] summary::after {
  content: "-";
}

.tool-detail-accordion summary small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-left: auto;
}

.tool-detail-body {
  display: grid;
  gap: 16px;
  border-top: 1px solid #eef1f5;
  padding: 16px;
}

.tool-detail-body h3 {
  color: #20242d;
  font-size: 0.98rem;
  margin-bottom: 10px;
}

.tool-scenario-list {
  display: grid;
  gap: 10px;
}

.tool-scenario-card {
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #fbfcff;
  padding: 12px;
}

.tool-scenario-card h3 {
  color: #242936;
  font-size: 0.94rem;
  margin: 0 0 6px;
}

.tool-scenario-card p {
  color: #5f6876;
  font-size: 0.9rem;
  line-height: 1.65;
}

.tool-scenario-check {
  border-top: 1px solid #edf1f6;
  margin-top: 10px;
  padding-top: 10px;
}

.tool-scenario-check strong {
  color: #303846;
  font-weight: 900;
}

.related-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related-tools a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafcf9;
  color: var(--text);
  font-weight: 800;
  padding: 0 14px;
  text-decoration: none;
}

.privacy-note {
  color: var(--muted);
  line-height: 1.65;
  margin-top: 14px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 4px 0 2px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

.footer-brand {
  color: var(--text);
  font-weight: 800;
}

.footer-contact {
  color: #4f5968;
  font-weight: 700;
}

.document-footer {
  margin: 0 auto;
  max-width: 920px;
  padding: 0 10px;
}

.privacy-assurance {
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #f8fbff;
  color: #243043;
  font-weight: 700;
  line-height: 1.7;
  padding: 14px;
}

.tool-section {
  display: grid;
  gap: 16px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tool-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack {
  display: grid;
  gap: 16px;
}

.editor-card,
.result-card,
.input-card,
.action-card,
.stats-card,
.preview-card,
.upload-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfdfc;
  padding: 16px;
}

.editor-card textarea,
.result-card textarea,
.input-card textarea {
  min-height: 240px;
}

.field,
.field-group {
  display: grid;
  gap: 8px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #33423d;
  font-size: 0.9rem;
  font-weight: 800;
}

.check-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.split-editors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfdfb;
  padding: 14px;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.stat-card strong {
  font-size: 1.12rem;
}

.result-tabs {
  display: grid;
  gap: 12px;
}

.result-board {
  display: grid;
  gap: 12px;
}

.result-board textarea {
  min-height: 180px;
}

.upload-box {
  display: grid;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #f9fbf9;
  padding: 16px;
}

.upload-box.is-dragging {
  border-color: var(--accent);
  background: #fff7f3;
  box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.12);
}

.subtitle-drop-zone,
.background-drop-zone {
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.subtitle-drop-zone.is-dragging,
.background-drop-zone.is-dragging {
  border-color: var(--accent);
  background: #fff7f3;
  box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.12);
}

.upload-box p {
  color: var(--muted);
  line-height: 1.6;
}

.audio-preview {
  width: 100%;
}

.audio-tool-intro {
  max-width: 720px;
  margin-top: 6px;
}

.tool-title-with-beta {
  display: inline-block;
  white-space: nowrap;
}

.tool-beta-label {
  color: #e5322d;
  display: inline;
  font-size: 0.72em;
  font-weight: 900;
  margin-left: 0;
  white-space: nowrap;
}

.tool-launch-card .tool-beta-label {
  color: #e5322d;
  display: inline;
  font-size: 0.78em;
}

.audio-file-tool .field-grid.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.audio-editor-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: start;
}

.audio-waveform-card,
.audio-edit-actions-card {
  align-content: start;
}

.audio-waveform-frame {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #f8fbff;
}

.audio-waveform-frame:focus {
  border-color: #e5322d;
  box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.14);
  outline: none;
}

.audio-waveform-frame::-webkit-scrollbar {
  height: 10px;
}

.audio-waveform-frame::-webkit-scrollbar-track {
  background: #edf2f8;
}

.audio-waveform-frame::-webkit-scrollbar-thumb {
  border: 2px solid #edf2f8;
  border-radius: 999px;
  background: #a8b3c7;
}

.audio-waveform-canvas {
  display: block;
  width: 100%;
  min-width: 100%;
  height: 240px;
  touch-action: none;
  cursor: crosshair;
}

.audio-editor-readout {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: #4f5a69;
  font-size: 0.9rem;
  font-weight: 800;
}

.audio-edit-actions-card .notice-card {
  margin-top: 2px;
}

.audio-break-option {
  margin-top: 2px;
}

.audio-processing-indicator {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid #ffd5d2;
  border-radius: 8px;
  background: #fff8f7;
  color: #6d322e;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.5;
  padding: 11px 12px;
}

.audio-processing-indicator::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: audio-processing-track 1.25s ease-in-out infinite;
}

.audio-processing-indicator[hidden] {
  display: none;
}

.audio-processing-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid #ffd6d3;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: audio-processing-spin 0.8s linear infinite;
}

@keyframes audio-processing-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes audio-processing-track {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.notice-card {
  display: grid;
  gap: 6px;
  border: 1px solid #f1d8d5;
  border-radius: 8px;
  background: #fff8f7;
  color: #5b3431;
  line-height: 1.62;
  padding: 14px 16px;
}

.notice-card strong {
  color: #2b2323;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.file-item span:last-child {
  color: var(--muted);
  font-size: 0.88rem;
}

.canvas-frame,
.image-frame,
.qr-frame,
.diff-frame {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.canvas-frame canvas,
.image-frame img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.qr-frame {
  display: grid;
  place-items: center;
  min-height: 280px;
}

.qr-frame svg {
  width: min(100%, 260px);
  height: auto;
}

.qr-options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.qr-color-field input[type="color"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 5px;
  cursor: pointer;
}

.qr-designer-frame {
  min-height: 380px;
  background:
    radial-gradient(circle at 20% 18%, rgba(229, 50, 45, 0.08), transparent 32%),
    linear-gradient(180deg, #fbfcff 0%, #f5f8fc 100%);
}

.qr-preview-shell {
  width: min(100%, 320px);
  max-width: 100%;
  border: 1px solid #e1e7f0;
  border-radius: 18px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(30, 41, 59, 0.1);
}

.qr-preview-shell svg {
  display: block;
  width: 100%;
  height: auto;
}

.qr-paste-box {
  min-height: 132px;
  border: 2px dashed #9db1c9;
  background: #ffffff;
  color: #1d2630;
  font-weight: 800;
  line-height: 1.7;
  resize: vertical;
  padding: 18px;
}

.qr-paste-box::placeholder {
  color: #526173;
  opacity: 1;
}

.qr-paste-box:focus {
  border-color: var(--primary);
  background: #fbfdff;
  box-shadow: 0 0 0 4px rgba(36, 87, 214, 0.12);
}

.qr-reader-drop.is-dragging {
  border-color: var(--primary);
  background: #fff5f4;
}

.qr-reader-frame {
  display: grid;
  place-items: center;
  min-height: 280px;
}

.qr-reader-frame canvas {
  max-height: 420px;
}

.qr-result-link {
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #1d2630;
  font-weight: 800;
  line-height: 1.6;
  padding: 12px 14px;
}

@media (max-width: 680px) {
  .qr-options-grid {
    grid-template-columns: 1fr;
  }

  .qr-designer-frame {
    min-height: 320px;
  }

  .qr-preview-shell {
    padding: 12px;
    border-radius: 14px;
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.gallery-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.gallery-item canvas {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #eef2ee;
}

.permission-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  padding: 16px;
  box-shadow: 0 8px 20px rgba(23, 27, 38, 0.045);
}

.permission-card h3 {
  margin: 0;
  color: #1f2430;
  font-size: 1.02rem;
}

.permission-card p {
  margin: 4px 0 0;
  color: #5e6877;
  font-size: 0.9rem;
  line-height: 1.55;
}

.permission-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.permission-guide {
  grid-column: 1 / -1;
  border-top: 1px solid #e8edf4;
  color: #3b4453;
  font-size: 0.9rem;
  line-height: 1.6;
  padding-top: 12px;
}

.permission-guide strong {
  display: block;
  margin-bottom: 6px;
  color: #202733;
}

.permission-guide ol {
  margin: 0;
  padding-left: 20px;
}

.permission-guide li + li {
  margin-top: 4px;
}

.webcam-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 16px;
  align-items: start;
}

.webcam-preview-card,
.webcam-control-card,
.webcam-result-card {
  min-width: 0;
}

.webcam-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid #182033;
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 18%, rgba(229, 50, 45, 0.18), transparent 28%),
    linear-gradient(135deg, #0b1020 0%, #151b2d 100%);
}

.webcam-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
}

.webcam-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  color: #d8deea;
  padding: 24px;
  text-align: center;
}

.webcam-placeholder strong {
  color: #ffffff;
  font-size: 1rem;
}

.webcam-placeholder span {
  color: #aeb8c8;
  font-size: 0.88rem;
  line-height: 1.55;
}

.recording-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #d92f2a;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 0 10px;
  box-shadow: 0 8px 18px rgba(217, 47, 42, 0.24);
}

.range-grid {
  display: grid;
  gap: 12px;
}

.range-grid label {
  display: grid;
  gap: 8px;
  color: #303746;
  font-size: 0.9rem;
  font-weight: 800;
}

.range-grid label span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.range-grid output {
  color: var(--muted);
  font-weight: 800;
}

.range-grid input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.background-effect-card {
  display: grid;
  gap: 12px;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.compact-heading {
  min-height: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.background-options {
  align-items: end;
}

.background-options input[type="color"] {
  min-height: 42px;
  padding: 4px;
  cursor: pointer;
}

.background-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.background-drop-zone {
  border: 1px dashed transparent;
  border-radius: 8px;
  margin: -8px;
  padding: 8px;
}

.background-upload-row input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.background-file-label {
  min-height: 42px;
}

.webcam-result-card video {
  display: block;
  width: 100%;
  max-height: 520px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #101828;
}

.diff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.diff-pane {
  display: grid;
  gap: 10px;
}

.diff-output {
  overflow: auto;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.diff-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  border-radius: 6px;
  padding: 6px 8px;
}

.diff-row + .diff-row {
  margin-top: 4px;
}

.diff-row code {
  white-space: pre-wrap;
  font-family: Consolas, "Malgun Gothic", monospace;
  font-size: 0.85rem;
}

.diff-row.is-add {
  background: #eaf7ef;
}

.diff-row.is-remove {
  background: #fff0ea;
}

.diff-row.is-equal {
  background: #f7f8f7;
}

.subtitle-textarea {
  min-height: 300px;
  font-family: Consolas, "Malgun Gothic", monospace;
  font-size: 0.9rem;
}

.tool-note {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #16201d;
  color: #ffffff;
  box-shadow: var(--shadow);
  line-height: 1.55;
  padding: 12px 14px;
  font-weight: 800;
}

.selection-copy {
  position: fixed;
  z-index: 25;
  min-height: 34px;
  border-color: #23302d;
  border-radius: 999px;
  background: #16201d;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(22, 32, 29, 0.25);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 0 14px;
}

.selection-copy:hover:not(:disabled) {
  background: #24332f;
}

.help-dialog {
  width: min(520px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0;
}

.help-dialog::backdrop {
  background: rgba(14, 22, 20, 0.42);
}

.help-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(22, 32, 29, 0.22);
  padding: 20px;
}

.help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.help-trigger,
.help-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
}

.help-close {
  font-weight: 900;
}

.help-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.help-steps li {
  line-height: 1.65;
}

.help-steps strong,
.help-steps span {
  display: block;
}

.help-steps span {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.meter {
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(8, 8px);
  align-items: end;
  gap: 5px;
  width: 112px;
  height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.meter span {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
  opacity: 0.34;
}

.meter.listening span {
  animation: levelPulse 0.84s ease-in-out infinite;
}

.meter.listening span:nth-child(2n) {
  animation-delay: 0.12s;
}

.meter.listening span:nth-child(3n) {
  animation-delay: 0.24s;
}

@keyframes levelPulse {
  0%,
  100% {
    height: 8px;
    opacity: 0.34;
  }
  50% {
    height: 30px;
    opacity: 0.96;
  }
}

@media (max-width: 1180px) {
  .platform-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .tool-launch-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-grid.compact,
  .overview-hero-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .platform-hero,
  .platform-grid,
  body[data-page="home"] .overview-panel,
  body.home-mode .overview-panel,
  .tool-grid,
  .split-editors,
  .info-grid,
  .diff-grid,
  .field-row,
  .field-row.three {
    grid-template-columns: 1fr;
  }

  .platform-hero,
  .hero-meta {
    align-items: flex-start;
  }

  .platform-hero {
    flex-direction: column;
  }

  .status-group {
    justify-content: flex-start;
  }

  .hero-meta {
    justify-items: start;
  }

  .tool-launch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-layout {
    width: min(100% - 18px, 1420px);
    padding: 10px 0 24px;
  }

  .platform-hero,
  .tool-sidebar,
  .overview-panel,
  .workspace-panel,
  .guide-panel,
  .related-panel {
    padding: 16px;
  }

  .overview-hero-grid,
  .tool-launch-grid,
  .tool-grid.compact,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .home-metrics,
  .home-section-head {
    grid-template-columns: 1fr;
  }

  .home-metrics span,
  .home-section-mark,
  .home-section-count {
    justify-self: start;
  }

  .action-row {
    flex-direction: column;
  }

  .action-row button {
    width: 100%;
  }

  body[data-page="home"] .site-layout,
  body.home-mode .site-layout {
    width: min(100% - 18px, 1240px);
  }

  .tool-launch-card {
    min-height: 0;
  }
}

/* Commercial UI refresh */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #fafafa;
  --text: #1f1f28;
  --muted: #6b6f7a;
  --line: #e5e7eb;
  --line-strong: #cfd3da;
  --primary: #e5322d;
  --primary-strong: #c92520;
  --accent: #2b62d9;
  --accent-soft: #eef3ff;
  --shadow: 0 14px 34px rgba(31, 31, 40, 0.08);
  --shadow-soft: 0 10px 24px rgba(31, 31, 40, 0.07);
}

body {
  background: var(--bg);
  font-family:
    "Pretendard Variable",
    Pretendard,
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.site-layout,
body[data-page="home"] .site-layout,
body.home-mode .site-layout,
body.tool-mode .site-layout {
  width: min(1180px, calc(100% - 40px));
  padding: 16px 0 36px;
}

.content-column,
.app-shell {
  gap: 14px;
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(31, 31, 40, 0.06);
  padding: 0 14px;
  backdrop-filter: blur(14px);
}

.brand-home {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 900;
}

.brand-name {
  font-size: 1rem;
  letter-spacing: 0;
}

.brand-subname {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

.topbar-links {
  display: contents;
}

.topbar-search {
  grid-column: 2;
  justify-self: center;
  width: 100%;
  max-width: 280px;
  min-width: 0;
}

.topbar-policy-links {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  justify-self: end;
}

.topbar-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f7f9fc;
  color: #20242d;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 15px;
}

.topbar-search input::placeholder {
  color: #8b96a7;
  opacity: 0.68;
}

.topbar-search input:focus {
  border-color: var(--primary);
  background: #ffffff;
}

.topbar-policy-links a,
.topbar-favorite {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3d414b;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  padding: 0 11px;
}

.topbar-favorite {
  gap: 5px;
  cursor: pointer;
}

.topbar-favorite span[aria-hidden="true"] {
  color: #f5a400;
  font-size: 0.98rem;
  line-height: 1;
}

.topbar-policy-links a:hover,
.topbar-favorite:hover {
  background: #f2f3f5;
}

.topbar-favorite:focus-visible,
.hero-copy h1.is-reloadable:focus-visible {
  outline: 3px solid rgba(43, 98, 217, 0.28);
  outline-offset: 3px;
}

.platform-hero,
.panel,
.tool-sidebar {
  border: 1px solid var(--line);
  box-shadow: none;
}

.platform-hero {
  border: 0;
  background: transparent;
  padding: 26px 6px 12px;
  box-shadow: none;
}

body[data-page="home"] .platform-hero,
body.home-mode .platform-hero {
  min-height: 0;
  border-left: 0;
  justify-content: center;
  text-align: center;
  padding: 34px 12px 20px;
}

body.tool-mode .platform-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  padding: 22px 6px 8px;
}

.hero-copy {
  max-width: 760px;
}

body[data-page="home"] .hero-copy,
body.home-mode .hero-copy {
  justify-items: center;
  max-width: 820px;
}

.hero-copy h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy h1.is-reloadable {
  width: fit-content;
  max-width: 100%;
  border-radius: 8px;
  cursor: pointer;
}

.hero-copy h1.is-reloadable:hover {
  color: var(--primary-strong);
}

body.tool-mode .hero-copy h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.hero-copy p:last-child {
  color: #4f5562;
  font-size: 1.02rem;
  line-height: 1.75;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 900;
}

.hero-meta {
  align-self: start;
}

.platform-hero .secondary-action {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
  font-weight: 900;
  padding: 0;
}

.tool-sidebar,
body[data-page="home"] .tool-sidebar,
body.home-mode .tool-sidebar,
body.tool-mode .tool-sidebar {
  display: none;
}

.platform-grid,
body[data-page="home"] .platform-grid,
body.home-mode .platform-grid,
body.tool-mode .platform-grid {
  grid-template-columns: minmax(0, 1fr);
}

body.tool-mode .workspace-stack {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

body.tool-mode .overview-panel {
  display: none;
}

body[data-page="home"] .overview-panel,
body.home-mode .overview-panel {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
  gap: 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 0 8px;
  box-shadow: none;
}

body[data-page="home"] .overview-header,
body.home-mode .overview-header {
  max-width: 760px;
}

body[data-page="home"] .overview-header p,
body.home-mode .overview-header p {
  color: #555b66;
}

body[data-page="home"] .overview-header .eyebrow,
body.home-mode .overview-header .eyebrow {
  color: var(--primary);
}

.home-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.home-metrics span {
  min-width: 96px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.home-metrics small {
  color: var(--muted);
}

.workspace-panel,
body[data-page="home"] .workspace-panel,
body.home-mode .workspace-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

body.tool-mode .workspace-panel {
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 20px;
}

.home-tool-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.home-tool-section + .home-tool-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.home-section-head {
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 4px;
}

.home-section-mark {
  width: 46px;
  height: 46px;
  background: #fff1f0;
  color: var(--primary);
  border-color: #ffd1ce;
}

.home-section-copy h2 {
  font-size: 1.15rem;
}

.home-section-count {
  background: #f8f8fa;
}

.tool-launch-grid {
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 14px;
}

.tool-launch-card {
  min-height: 184px;
  border-color: var(--category-border);
  background: linear-gradient(180deg, #ffffff 0%, var(--category-soft) 150%);
  padding: 18px;
}

.tool-launch-card:hover {
  border-color: var(--category-accent);
  box-shadow: 0 16px 30px rgba(20, 24, 33, 0.1);
}

.tool-launch-icon {
  width: 48px;
  height: 48px;
  border: 0;
  background: #fff1f0;
  color: var(--primary);
}

.tool-launch-card[data-category="텍스트"] .tool-launch-icon,
.tool-launch-card[data-category="이미지"] .tool-launch-icon,
.tool-launch-card[data-category="PDF"] .tool-launch-icon,
.tool-launch-card[data-category="자막"] .tool-launch-icon {
  border: 0;
}

.tool-launch-card[data-category="텍스트"] .tool-launch-icon {
  background: #eef7ff;
  color: #2563c9;
}

.tool-launch-card[data-category="이미지"] .tool-launch-icon {
  background: #fff6e8;
  color: #b15b12;
}

.tool-launch-card[data-category="PDF"] .tool-launch-icon {
  background: #fff1f0;
  color: var(--primary);
}

.tool-launch-card[data-category="자막"] .tool-launch-icon {
  background: #effaf3;
  color: #1f8a52;
}

.tool-launch-card[data-category] .tool-launch-icon {
  background: var(--category-soft);
  color: var(--category-ink);
}

.tool-launch-action {
  color: var(--primary);
}

.info-grid {
  margin-top: 14px;
}

body.tool-mode .info-grid {
  max-width: 1080px;
  width: 100%;
  margin: 16px auto 0;
}

.guide-panel,
.related-panel {
  background: #ffffff;
  box-shadow: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

@media (max-width: 760px) {
  .site-layout,
  body[data-page="home"] .site-layout,
  body.home-mode .site-layout,
  body.tool-mode .site-layout {
    width: min(100% - 18px, 1180px);
    padding-top: 10px;
  }

  .site-topbar {
    position: static;
    align-items: center;
    grid-template-columns: 1fr;
    height: auto;
    padding: 12px;
  }

  .brand-home {
    grid-column: 1;
    justify-self: start;
  }

  .topbar-search {
    grid-column: 1;
    justify-self: center;
    width: min(100%, 280px);
    max-width: 280px;
  }

  .topbar-policy-links {
    grid-column: 1;
    justify-self: center;
    justify-content: center;
    flex-wrap: wrap;
  }

  body.tool-mode .platform-hero {
    grid-template-columns: 1fr;
  }

  .home-section-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .home-section-count {
    grid-column: 1 / -1;
    justify-self: start;
  }

  body.tool-mode .workspace-panel {
    padding: 14px;
  }
}

/* Wide desktop workspace and product-grade polish */
body {
  background:
    linear-gradient(180deg, #ffffff 0%, #f6f7f9 360px, #f4f5f7 100%);
}

.site-layout,
body[data-page="home"] .site-layout,
body.home-mode .site-layout,
body.tool-mode .site-layout {
  width: min(1500px, calc(100% - 56px));
}

body.tool-mode .site-layout {
  width: min(1680px, calc(100% - 64px));
}

.site-topbar {
  min-height: 64px;
  border-color: #e7e9ef;
  box-shadow: 0 12px 30px rgba(23, 27, 38, 0.07);
  padding: 0 18px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  font-size: 1.02rem;
}

.brand-name {
  font-size: 1.05rem;
}

.brand-subname {
  font-size: 0.8rem;
}

.platform-hero .secondary-action {
  width: auto;
  min-width: 0;
  min-height: 40px;
  border-radius: 8px;
  background: #ffffff;
  color: #343945;
  font-size: 0.88rem;
  line-height: 1;
  white-space: nowrap;
  padding: 0 14px;
}

.platform-hero .secondary-action::before {
  content: "i";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  border-radius: 50%;
  background: #fff1f0;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
}

body.tool-mode .platform-hero,
body.tool-mode .workspace-stack,
body.tool-mode .info-grid {
  width: 100%;
  max-width: 1560px;
}

body.tool-mode .platform-hero {
  margin: 0 auto;
  padding: 30px 4px 16px;
}

body.tool-mode .hero-copy {
  max-width: 1040px;
}

body.tool-mode .hero-copy h1 {
  font-size: clamp(2.05rem, 3vw, 3rem);
}

body.tool-mode .workspace-panel {
  border-color: #e4e7ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(23, 27, 38, 0.09);
  padding: 28px;
}

.tool-workspace,
.tool-section,
.stack {
  gap: 20px;
}

.section-heading {
  align-items: flex-end;
  border-bottom: 1px solid #eceff4;
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.section-heading h2 {
  font-size: 1.18rem;
}

.editor-card,
.result-card,
.input-card,
.action-card,
.stats-card,
.preview-card,
.upload-card {
  border-color: #e5e8ef;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(23, 27, 38, 0.04);
  padding: 18px;
}

.action-row {
  gap: 10px;
}

.action-row button,
label.secondary-action {
  min-height: 44px;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 900;
}

.action-row button:first-child {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(229, 50, 45, 0.18);
}

.action-row button:first-child:hover:not(:disabled) {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.upload-box,
.canvas-frame,
.image-frame,
.qr-frame,
.diff-frame {
  border-color: #e2e6ee;
  background: #fbfcfe;
}

body[data-page="home"] .platform-hero,
body.home-mode .platform-hero {
  padding: 46px 12px 28px;
}

body[data-page="home"] .hero-copy h1,
body.home-mode .hero-copy h1 {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
}

.home-tool-section {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 26px 0 12px;
}

.home-tool-section + .home-tool-section {
  border-top: 1px solid #e5e8ef;
  padding-top: 30px;
}

.home-section-head {
  margin-bottom: 12px;
}

.home-section-mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
}

.home-section-copy h2 {
  font-size: 1.28rem;
}

.tool-launch-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tool-launch-card {
  position: relative;
  min-height: 218px;
  border-color: var(--category-border);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, var(--category-soft) 145%);
  padding: 20px;
  overflow: hidden;
}

.tool-launch-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--category-accent);
  opacity: 0.9;
  transition: opacity 0.16s ease;
}

.tool-launch-card:hover::before {
  opacity: 1;
}

.tool-launch-card:hover {
  border-color: var(--category-accent);
  box-shadow: 0 18px 38px rgba(31, 31, 40, 0.11);
}

.tool-launch-icon {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  font-size: 0.92rem;
}

.tool-launch-card strong {
  font-size: 1.07rem;
}

.tool-launch-card p {
  font-size: 0.92rem;
}

.tool-launch-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  border-radius: 999px;
  background: #fff1f0;
  color: var(--primary);
  padding: 0 12px;
}

.tool-launch-action::after {
  content: "";
}

.tool-seo-panel {
  display: grid;
  gap: 14px;
  border-color: #e5e8ef;
  background: #ffffff;
  box-shadow: none;
}

.tool-seo-panel h2 {
  font-size: 1.14rem;
}

.tool-seo-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.tool-seo-panel ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool-seo-panel li {
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: #fbfcfe;
  color: #414753;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.55;
  padding: 12px;
}

.category-mode .tool-sidebar {
  display: none;
}

.category-mode .platform-grid {
  grid-template-columns: minmax(0, 1fr);
}

.category-mode .workspace-stack {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.category-mode .overview-panel {
  display: block;
}

.category-mode .workspace-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.category-mode .info-grid {
  grid-template-columns: minmax(0, 1fr);
}

.category-overview {
  display: grid;
  gap: 12px;
  max-width: 920px;
}

.category-overview h2 {
  color: #20242d;
  font-size: clamp(1.55rem, 3vw, 2.18rem);
  line-height: 1.18;
  margin-top: 6px;
}

.category-overview p {
  color: #4f5867;
  line-height: 1.72;
  margin-top: 8px;
}

.category-tool-section {
  display: grid;
  gap: 14px;
  border-top: 1px solid #d8e1ec;
  padding-top: 18px;
}

.category-tool-section .tool-launch-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.category-tool-section .tool-launch-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  border-color: var(--category-border);
  background: linear-gradient(90deg, #ffffff 0%, var(--category-soft) 170%);
  box-shadow: 0 8px 20px rgba(23, 27, 38, 0.045);
  padding: 16px 18px;
}

.category-tool-section .tool-launch-card::before {
  inset: 0 auto 0 0;
  width: 4px;
  height: auto;
  background: var(--category-accent);
  opacity: 0.9;
}

.category-tool-section .tool-launch-icon {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 8px;
  font-size: 1.3rem;
}

.category-tool-section .tool-launch-body {
  gap: 4px;
}

.category-tool-section .tool-launch-body strong {
  font-size: 1rem;
  line-height: 1.3;
}

.category-tool-section .tool-launch-body span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.category-tool-section .tool-launch-arrow {
  align-self: center;
}

.category-seo-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 18px;
}

.category-seo-panel h2 {
  color: #20242d;
  font-size: 1.08rem;
}

.category-seo-panel p {
  color: #5f6876;
  line-height: 1.68;
}

.static-content-panel {
  width: 100%;
  max-width: 1240px;
  margin: 16px auto 0;
  background: #ffffff;
  box-shadow: none;
  padding: 0;
}

.static-content-details {
  display: block;
}

.static-content-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
  padding: 16px 18px;
}

.static-content-details summary::-webkit-details-marker {
  display: none;
}

.static-content-details h2 {
  color: #20242d;
  font-size: 1.18rem;
  line-height: 1.35;
}

.static-content-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #e2e7ef;
  border-radius: 8px;
  color: #596273;
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
  padding: 0 11px;
}

.static-content-details[open] .static-content-toggle {
  border-color: #f0c9c6;
  background: #fff5f4;
  color: var(--primary);
}

.static-content-details[open] .static-content-toggle::before {
  content: "접기";
}

.static-content-details[open] .static-content-toggle {
  font-size: 0;
}

.static-content-details[open] .static-content-toggle::before {
  font-size: 0.84rem;
}

.static-content-article {
  display: grid;
  gap: 16px;
  border-top: 1px solid #eceff4;
  padding: 18px;
}

.static-content-body {
  display: grid;
  gap: 20px;
}

.static-content-body p {
  display: grid;
  gap: 5px;
  margin: 0;
  color: #31413b;
  font-size: 0.96rem;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.static-content-body span {
  display: block;
}

.static-content-notes {
  display: grid;
  gap: 10px;
  margin-top: 2px;
  border-left: 3px solid #d33b35;
  background: #fbfcfe;
  padding: 14px 16px;
}

.static-content-notes h3 {
  color: #252b35;
  font-size: 0.98rem;
  line-height: 1.42;
}

.static-content-notes ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: #515b69;
  font-size: 0.94rem;
  line-height: 1.65;
}

@media (max-width: 760px) {
  .static-content-panel {
    margin-top: 14px;
  }

  .static-content-details summary {
    align-items: flex-start;
    flex-direction: column;
    padding: 15px 16px;
  }

  .static-content-article {
    padding: 16px;
  }

  .static-content-body p {
    font-size: 0.94rem;
    line-height: 1.66;
  }

  .field-grid.compact-grid {
    grid-template-columns: 1fr;
  }
}

.seo-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seo-keywords span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: #f4f6f9;
  color: #555c69;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0 11px;
}

@media (min-width: 1180px) {
  .tool-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
  }

  .tool-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .editor-card textarea,
  .result-card textarea,
  .input-card textarea {
    min-height: clamp(420px, 48vh, 680px);
  }

  .result-board textarea {
    min-height: clamp(360px, 42vh, 620px);
  }

  .split-editors textarea,
  .diff-output {
    min-height: clamp(420px, 48vh, 650px);
  }

  .subtitle-textarea {
    min-height: clamp(520px, 58vh, 780px);
  }

  .upload-box {
    min-height: 220px;
    align-content: center;
  }
}

@media (max-width: 940px) {
  .tool-seo-panel ul {
    grid-template-columns: 1fr;
  }

  .home-category-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .audio-editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-layout,
  body[data-page="home"] .site-layout,
  body.home-mode .site-layout,
  body.tool-mode .site-layout {
    width: min(100% - 18px, 1180px);
  }

  .platform-hero .secondary-action {
    min-height: 38px;
  }

  .tool-launch-grid {
    grid-template-columns: 1fr;
  }

  .document-page {
    width: min(100% - 18px, 920px);
    padding: 18px 0 30px;
  }

  .document-panel {
    gap: 18px;
    padding: 22px 18px;
  }

  .category-overview {
    grid-template-columns: minmax(0, 1fr);
  }

  .audio-waveform-canvas {
    height: 190px;
  }

}

/* App launcher redesign: less copy, stronger visual recognition */
body[data-page="home"] .overview-panel,
body.home-mode .overview-panel {
  margin-top: 6px;
}

.home-divider {
  width: 100%;
  max-width: 1500px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #cfd8e5 16%, #cfd8e5 84%, transparent 100%);
}

.home-divider-after-categories {
  margin-top: 2px;
}

.home-category-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 1500px;
}

.home-category-links a {
  position: relative;
  display: grid;
  gap: 4px;
  overflow: hidden;
  min-height: 72px;
  border: 1px solid var(--category-border);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, var(--category-soft) 150%);
  color: #20242d;
  padding: 13px 14px;
  text-decoration: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.home-category-links a::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--category-accent);
}

.home-category-links a:hover {
  border-color: var(--category-accent);
  box-shadow: 0 12px 26px rgba(23, 27, 38, 0.08);
  transform: translateY(-1px);
}

.home-category-links span {
  color: var(--category-ink);
  font-size: 0.75rem;
  font-weight: 900;
}

.home-category-links strong {
  font-size: 0.94rem;
  line-height: 1.25;
}

.home-directory {
  padding-top: 18px;
}

.home-directory .tool-launch-grid {
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 16px;
}

.home-directory .tool-launch-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 15px;
  min-height: 132px;
  border: 1px solid var(--category-border);
  border-radius: 8px;
  background: linear-gradient(90deg, #ffffff 0%, var(--category-soft) 155%);
  box-shadow: 0 10px 24px rgba(23, 27, 38, 0.045);
  padding: 18px;
}

.home-directory .tool-launch-card::before {
  display: block;
  inset: 0 auto 0 0;
  width: 4px;
  height: auto;
  background: var(--category-accent);
  opacity: 0.9;
}

.home-directory .tool-launch-card:hover {
  border-color: var(--category-accent);
  box-shadow: 0 16px 34px rgba(23, 27, 38, 0.1);
  transform: translateY(-2px);
}

.home-directory .tool-launch-icon {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 8px;
  font-size: 1.5rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.tool-launch-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tool-launch-body strong {
  color: #20242d;
  font-size: 1rem;
  line-height: 1.35;
}

.tool-launch-body .tool-title-with-beta {
  display: inline-block;
  overflow: visible;
  color: #20242d;
  white-space: nowrap;
  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
}

.tool-launch-body .tool-title-with-beta .tool-beta-label {
  color: #e5322d;
}

.tool-launch-body span {
  display: -webkit-box;
  overflow: hidden;
  color: #666d79;
  font-size: 0.88rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tool-launch-arrow {
  color: #a1a8b3;
  font-size: 1.35rem;
  font-weight: 900;
}

.tool-launch-card[data-tone="red"] .tool-launch-icon {
  background: #fff1f0;
  color: #e5322d;
}

.tool-launch-card[data-tone="blue"] .tool-launch-icon {
  background: #eef5ff;
  color: #2563eb;
}

.tool-launch-card[data-tone="green"],
.tool-launch-card[data-tone="emerald"] {
  --tone-color: #148a5b;
}

.tool-launch-card[data-tone="green"] .tool-launch-icon,
.tool-launch-card[data-tone="emerald"] .tool-launch-icon {
  background: #eaf8f1;
  color: #148a5b;
}

.tool-launch-card[data-tone="orange"] .tool-launch-icon,
.tool-launch-card[data-tone="amber"] .tool-launch-icon,
.tool-launch-card[data-tone="yellow"] .tool-launch-icon {
  background: #fff6e8;
  color: #b45f06;
}

.tool-launch-card[data-tone="violet"] .tool-launch-icon,
.tool-launch-card[data-tone="purple"] .tool-launch-icon,
.tool-launch-card[data-tone="indigo"] .tool-launch-icon {
  background: #f2efff;
  color: #6552d9;
}

.tool-launch-card[data-tone="cyan"] .tool-launch-icon,
.tool-launch-card[data-tone="teal"] .tool-launch-icon {
  background: #e9f8fb;
  color: #0f7b8b;
}

.tool-launch-card[data-tone="pink"] .tool-launch-icon {
  background: #fff0f6;
  color: #c72d73;
}

.tool-launch-card[data-tone="slate"] .tool-launch-icon {
  background: #f1f4f8;
  color: #465364;
}

.tool-launch-card[data-category] .tool-launch-icon {
  background: var(--category-soft);
  color: var(--category-ink);
}

body.home-mode .platform-hero .hero-meta,
body[data-page="home"] .platform-hero .hero-meta {
  display: none;
}

body.home-mode .hero-copy h1,
body[data-page="home"] .hero-copy h1 {
  font-size: clamp(2.35rem, 5vw, 4.2rem);
}

body.home-mode .hero-copy p:last-child,
body[data-page="home"] .hero-copy p:last-child {
  max-width: 700px;
}

.home-directory .tool-launch-card[hidden] {
  display: none;
}

body.tool-mode .hero-copy .eyebrow {
  color: #6b7280;
}

@media (max-width: 560px) {
  .home-directory .tool-launch-card,
  .category-tool-section .tool-launch-card {
    grid-template-columns: 50px minmax(0, 1fr) 16px;
  }
}

/* Detail tool refinement */
body.tool-mode .site-layout {
  width: min(1420px, calc(100% - 56px));
}

body.tool-mode .platform-hero,
body.tool-mode .workspace-stack,
body.tool-mode .info-grid {
  max-width: 1240px;
}

body.tool-mode .platform-hero {
  padding: 24px 2px 10px;
}

body.tool-mode .hero-copy {
  max-width: 900px;
}

body.tool-mode .hero-copy h1 {
  font-size: clamp(1.9rem, 2.5vw, 2.65rem);
}

body.tool-mode .workspace-stack {
  gap: 14px;
}

body.tool-mode .workspace-panel {
  border-color: #e6e9ef;
  box-shadow: 0 14px 36px rgba(23, 27, 38, 0.07);
  padding: 22px;
}

body.tool-mode .tool-workspace,
body.tool-mode .tool-section,
body.tool-mode .stack {
  gap: 16px;
}

body.tool-mode .tool-grid,
body.tool-mode .split-editors,
body.tool-mode .diff-grid {
  gap: 14px;
}

body.tool-mode .editor-card,
body.tool-mode .result-card,
body.tool-mode .input-card,
body.tool-mode .action-card,
body.tool-mode .stats-card,
body.tool-mode .preview-card,
body.tool-mode .upload-card {
  gap: 14px;
  border-color: #e7ebf1;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: 0 8px 20px rgba(23, 27, 38, 0.045);
  padding: 18px;
}

body.tool-mode .action-card {
  align-content: start;
}

body.tool-mode .section-heading {
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

body.tool-mode .compact-heading {
  min-height: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

body.tool-mode .section-heading h2 {
  color: #1f2430;
  font-size: 1.08rem;
}

body.tool-mode .tool-note {
  color: #6a7280;
  font-size: 0.88rem;
}

body.tool-mode textarea,
body.tool-mode input,
body.tool-mode select {
  border-color: #dfe5ee;
  background: #fbfcff;
}

body.tool-mode textarea {
  line-height: 1.62;
}

body.tool-mode textarea:focus,
body.tool-mode input:focus,
body.tool-mode select:focus {
  border-color: rgba(229, 50, 45, 0.55);
  box-shadow: 0 0 0 4px rgba(229, 50, 45, 0.09);
}

body.tool-mode .action-row {
  gap: 8px;
}

body.tool-mode .action-row button,
body.tool-mode label.secondary-action {
  min-height: 42px;
  padding-inline: 14px;
}

body.tool-mode .upload-box {
  min-height: 180px;
  border-color: #d9e0eb;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 253, 0.94)),
    repeating-linear-gradient(135deg, rgba(229, 50, 45, 0.05) 0 8px, transparent 8px 16px);
}

body.tool-mode .canvas-frame,
body.tool-mode .image-frame,
body.tool-mode .qr-frame,
body.tool-mode .diff-frame,
body.tool-mode .diff-output {
  border-color: #e4e9f1;
  background: #f9fbfe;
}

body.tool-mode .qr-designer-frame {
  background:
    radial-gradient(circle at 20% 18%, rgba(229, 50, 45, 0.08), transparent 32%),
    linear-gradient(180deg, #fbfcff 0%, #f5f8fc 100%);
}

body.tool-mode .qr-preview-shell {
  border-color: #e1e7f0;
  background: #ffffff;
}

body.tool-mode .stat-card,
body.tool-mode .file-item,
body.tool-mode .gallery-item {
  border-color: #e5eaf2;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(23, 27, 38, 0.035);
}

body.tool-mode .stat-card strong {
  color: #1f2430;
  font-size: 1.22rem;
}

body.tool-mode .check-row {
  gap: 9px;
}

body.tool-mode .check-item {
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #ffffff;
  color: #303746;
  padding: 9px 10px;
}

body.tool-mode .mode-btn {
  justify-content: center;
}

@media (min-width: 1180px) {
  body.tool-mode .tool-grid {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.86fr);
    gap: 16px;
  }

  body.tool-mode .split-editors,
  body.tool-mode .diff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  body.tool-mode .tool-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.tool-mode .editor-card textarea,
  body.tool-mode .result-card textarea,
  body.tool-mode .input-card textarea {
    min-height: clamp(360px, 42vh, 580px);
  }

  body.tool-mode .result-board textarea {
    min-height: clamp(320px, 38vh, 540px);
  }

  body.tool-mode .split-editors textarea,
  body.tool-mode .diff-output {
    min-height: clamp(360px, 42vh, 560px);
  }

  body.tool-mode .subtitle-textarea {
    min-height: clamp(440px, 50vh, 680px);
  }
}

@media (min-width: 761px) {
  .site-layout,
  body[data-page="home"] .site-layout,
  body.home-mode .site-layout {
    width: min(1200px, calc(100% - 56px));
  }

  body.tool-mode .site-layout {
    width: min(1136px, calc(100% - 56px));
  }

  body.tool-mode .platform-hero,
  body.tool-mode .workspace-stack,
  body.tool-mode .info-grid {
    max-width: 992px;
  }

  body[data-page="home"] .platform-hero,
  body.home-mode .platform-hero {
    padding: 37px 10px 22px;
  }

  body[data-page="home"] .hero-copy,
  body.home-mode .hero-copy {
    max-width: 656px;
  }

  body[data-page="home"] .hero-copy h1,
  body.home-mode .hero-copy h1 {
    font-size: clamp(1.88rem, 4vw, 3.36rem);
  }

  body[data-page="home"] .hero-copy p:last-child,
  body.home-mode .hero-copy p:last-child {
    max-width: 560px;
  }

  .home-directory .tool-launch-grid {
    grid-template-columns: repeat(auto-fill, minmax(202px, 1fr));
    gap: 13px;
  }

  .home-directory .tool-launch-card {
    grid-template-columns: 46px minmax(0, 1fr) 14px;
    gap: 12px;
    min-height: 106px;
    padding: 14px;
  }

  .home-directory .tool-launch-icon {
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
  }

  .tool-launch-body {
    gap: 5px;
  }

  .tool-launch-body strong {
    font-size: 0.8rem;
  }

  .tool-launch-body span {
    font-size: 0.7rem;
  }

  body.tool-mode .platform-hero {
    padding: 19px 2px 8px;
  }

  body.tool-mode .hero-copy {
    max-width: 720px;
  }

  body.tool-mode .hero-copy h1 {
    font-size: clamp(1.52rem, 2vw, 2.12rem);
  }

  body.tool-mode .workspace-panel {
    padding: 18px;
  }

  body.tool-mode .editor-card,
  body.tool-mode .result-card,
  body.tool-mode .input-card,
  body.tool-mode .action-card,
  body.tool-mode .stats-card,
  body.tool-mode .preview-card,
  body.tool-mode .upload-card {
    gap: 11px;
    padding: 14px;
  }

  body.tool-mode .section-heading {
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  body.tool-mode .section-heading h2 {
    font-size: 0.86rem;
  }

  body.tool-mode .tool-note {
    font-size: 0.7rem;
  }
}

@media (max-width: 760px) {
  body.tool-mode .site-layout {
    width: min(100% - 18px, 1180px);
  }

  body.tool-mode .workspace-panel {
    padding: 16px;
  }
}

@media (max-width: 980px) {
  .webcam-grid {
    grid-template-columns: 1fr;
  }

  .permission-card {
    grid-template-columns: 1fr;
  }

  .permission-actions {
    justify-content: flex-start;
  }
}

/* Interaction polish: quieter panels, clearer controls */
.tool-seo-panel {
  display: none;
}

body.tool-mode .workspace-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 255, 0.98));
}

body.tool-mode .editor-card,
body.tool-mode .result-card,
body.tool-mode .input-card,
body.tool-mode .action-card,
body.tool-mode .stats-card,
body.tool-mode .preview-card,
body.tool-mode .upload-card {
  border-color: #e1e7f0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 26px rgba(26, 31, 43, 0.045);
}

body.tool-mode .section-heading {
  min-height: 44px;
}

body.tool-mode button,
body.tool-mode label.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  letter-spacing: 0;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

body.tool-mode button:not(.primary-action),
body.tool-mode label.secondary-action {
  border-color: #dce3ed;
  background: #ffffff;
  color: #313947;
  box-shadow: 0 1px 2px rgba(26, 31, 43, 0.04);
}

body.tool-mode button:not(.primary-action):hover:not(:disabled),
body.tool-mode label.secondary-action:hover {
  border-color: #cbd5e2;
  background: #f7f9fc;
  box-shadow: 0 8px 18px rgba(26, 31, 43, 0.08);
  transform: translateY(-1px);
}

body.tool-mode .primary-action {
  border-color: #d82f2a;
  background: linear-gradient(180deg, #f0443f 0%, #d92f2a 100%);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(229, 50, 45, 0.18);
}

body.tool-mode .primary-action:hover:not(:disabled) {
  border-color: #c72722;
  background: linear-gradient(180deg, #e53934 0%, #c92722 100%);
  box-shadow: 0 12px 22px rgba(229, 50, 45, 0.24);
  transform: translateY(-1px);
}

body.tool-mode button::before,
body.tool-mode label.secondary-action::before {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
}

body.tool-mode button:not(.primary-action)::before,
body.tool-mode label.secondary-action::before {
  background: #eef2f7;
  color: #566173;
}

body.tool-mode .primary-action::before {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

body.tool-mode .primary-action::before {
  content: "→";
}

body.tool-mode #startBtn::before {
  content: "●";
}

body.tool-mode #startCameraBtn::before {
  content: "▶";
}

body.tool-mode #requestCameraPermissionBtn::before {
  content: "✓";
}

body.tool-mode #permissionGuideBtn::before {
  content: "?";
}

body.tool-mode .background-file-label::before {
  content: "+";
}

body.tool-mode #clearBackgroundImageBtn::before {
  content: "×";
}

body.tool-mode #stopCameraBtn::before {
  content: "×";
}

body.tool-mode #startRecordingBtn::before {
  content: "●";
}

body.tool-mode #pauseBtn::before {
  content: "Ⅱ";
}

body.tool-mode #pauseRecordingBtn::before {
  content: "Ⅱ";
}

body.tool-mode #stopBtn::before {
  content: "■";
}

body.tool-mode #stopRecordingBtn::before {
  content: "■";
}

body.tool-mode #clearBtn::before {
  content: "↺";
}

body.tool-mode #clearRecordingBtn::before {
  content: "↺";
}

body.tool-mode #copyBtn::before,
body.tool-mode .copy-block::before {
  content: "⧉";
}

body.tool-mode #downloadBtn::before,
body.tool-mode #downloadAllBtn::before,
body.tool-mode #downloadVideoBtn::before {
  content: "↓";
}

body.tool-mode #cleanBtn::before {
  content: "✓";
}

body.tool-mode #runBtn::before {
  content: "↔";
}

body.tool-mode #extractBtn::before {
  content: "@";
}

body.tool-mode #makeBtn::before,
body.tool-mode #makeScriptBtn::before {
  content: "+";
}

body.tool-mode #applyBtn::before,
body.tool-mode #convertBtn::before,
body.tool-mode #convertTableBtn::before {
  content: "↗";
}

body.tool-mode #compressBtn::before {
  content: "−";
}

body.tool-mode #mergeBtn::before {
  content: "∪";
}

body.tool-mode #splitBtn::before {
  content: "÷";
}

body.tool-mode #shiftBtn::before {
  content: "↔";
}

body.tool-mode #renderBtn::before {
  content: "□";
}

body.tool-mode label.secondary-action::before {
  content: "↑";
}

body.tool-mode .mode-btn::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #98a2b3;
}

body.tool-mode .mode-btn:hover::before {
  background: var(--primary);
}

body.tool-mode .check-item {
  box-shadow: 0 1px 2px rgba(26, 31, 43, 0.03);
}

body.tool-mode .check-item:hover {
  border-color: #d4dce8;
  background: #fbfcff;
}

body.tool-mode .field label {
  color: #3d4654;
}

body.tool-mode .upload-box label {
  font-size: 1rem;
}

body.tool-mode .toast button::before,
body.tool-mode .help-close::before {
  content: none;
}

body.tool-mode .info-grid {
  grid-template-columns: minmax(0, 1fr);
}

.markdown-tool .tool-grid {
  align-items: stretch;
}

.markdown-editor-card {
  align-content: stretch;
}

.markdown-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.markdown-toolbar button {
  min-height: 36px;
  font-size: 0.86rem;
  padding: 0 11px;
}

.markdown-textarea {
  font-family: Consolas, "Malgun Gothic", monospace;
}

.markdown-preview {
  overflow: auto;
  min-height: 360px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #ffffff;
  color: #232936;
  line-height: 1.72;
  padding: 18px;
}

.markdown-preview > * + * {
  margin-top: 14px;
}

.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
  line-height: 1.3;
}

.markdown-preview h2 {
  font-size: 1.45rem;
}

.markdown-preview h3 {
  font-size: 1.25rem;
}

.markdown-preview ul,
.markdown-preview ol {
  padding-left: 22px;
}

.markdown-preview blockquote {
  border-left: 4px solid #e5322d;
  background: #fff6f5;
  color: #4f5663;
  margin: 0;
  padding: 12px 14px;
}

.markdown-preview pre {
  overflow: auto;
  border-radius: 8px;
  background: #1f2430;
  color: #f8fafc;
  padding: 14px;
}

.markdown-preview code {
  border-radius: 6px;
  background: #eef2f7;
  color: #263241;
  font-family: Consolas, "Malgun Gothic", monospace;
  padding: 2px 5px;
}

.markdown-preview pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.markdown-preview table {
  width: 100%;
  border-collapse: collapse;
}

.markdown-preview th,
.markdown-preview td {
  border: 1px solid #e4e9f1;
  padding: 8px 10px;
  text-align: left;
}

.markdown-preview th {
  background: #f6f8fb;
}

.ai-table-preview {
  min-height: 180px;
  max-height: 460px;
  overflow: auto;
}

.ai-table-preview table {
  min-width: 560px;
}

.ai-table-copy-actions {
  justify-content: flex-end;
}

.ai-table-copy-actions button {
  min-width: 0;
  white-space: normal;
}

.ai-table-outputs textarea {
  min-height: 180px !important;
  font-family: Consolas, "Malgun Gothic", monospace;
  white-space: pre;
}

.spreadsheet-tool .field-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.spreadsheet-result-list {
  display: grid;
  gap: 10px;
}

.spreadsheet-result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.spreadsheet-result-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.spreadsheet-result-item button {
  min-width: 110px;
}

.spreadsheet-preview {
  min-height: 160px;
}

.spreadsheet-preview table {
  min-width: 520px;
}

.warning-note {
  color: var(--warning) !important;
}

body.tool-mode #convertSpreadsheetBtn::before {
  content: "⇄";
}

body.tool-mode #downloadZipBtn::before {
  content: "↓";
}

body.tool-mode #copyDocumentTableBtn::before,
body.tool-mode #copySpreadsheetTableBtn::before,
body.tool-mode #copyCsvTableBtn::before {
  content: "⧉";
}

body.tool-mode #downloadCsvTableBtn::before {
  content: "↓";
}

body.tool-mode #copyMarkdownBtn::before,
body.tool-mode #copyPlainBtn::before {
  content: "⧉";
}

body.tool-mode #downloadMarkdownBtn::before {
  content: "↓";
}

body.tool-mode .markdown-toolbar button::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #98a2b3;
}

/* Tool handoff dock and markdown editor hardening */
.quick-tool-dock {
  display: grid;
  gap: 10px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(23, 27, 38, 0.06);
  padding: 12px;
}

.quick-tool-dock[hidden] {
  display: none;
}

.quick-tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #232936;
  font-size: 0.88rem;
}

.quick-tool-head span {
  color: #667085;
  font-size: 0.78rem;
}

.quick-tool-strip {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
}

.quick-tool-icons {
  display: grid;
  grid-template-columns: repeat(10, minmax(42px, 1fr));
  gap: 8px;
  min-width: 0;
  will-change: transform, opacity;
}

.quick-tool-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #172033;
  text-align: center;
  text-decoration: none;
}

.quick-tool-icon,
.quick-tool-arrow {
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  border-radius: 8px;
}

.quick-tool-icon {
  display: grid;
  place-items: center;
  border: 1px solid #e3e8f0;
  background: #f8fafc;
  color: #172033;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.quick-tool-symbol {
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 1.68rem;
  font-weight: 800;
}

.quick-tool-label {
  display: block;
  min-width: 0;
  color: #4b5565;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-tool-item:hover .quick-tool-icon {
  transform: translateY(-1px);
  border-color: rgba(229, 50, 45, 0.3);
  background: #fff6f5;
  box-shadow: 0 10px 20px rgba(23, 27, 38, 0.08);
}

.quick-tool-item:hover .quick-tool-label {
  color: #172033;
}

.quick-tool-arrow {
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 1.35rem;
  font-weight: 800;
  background: #ffffff;
}

.quick-tool-arrow:disabled {
  cursor: not-allowed;
  color: #b8c0cc;
  background: #f5f7fa;
}

.quick-tool-icons.is-sliding-next {
  animation: quickToolSlideNext 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.quick-tool-icons.is-sliding-prev {
  animation: quickToolSlidePrev 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes quickToolSlideNext {
  from {
    opacity: 0.34;
    transform: translateX(22px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes quickToolSlidePrev {
  from {
    opacity: 0.34;
    transform: translateX(-22px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .quick-tool-icons.is-sliding-next,
  .quick-tool-icons.is-sliding-prev {
    animation: none;
  }
}

.markdown-editor-v2 .markdown-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.92fr);
  gap: 16px;
  align-items: stretch;
  height: clamp(560px, calc(100vh - 300px), 760px);
  min-height: 520px;
  max-height: 780px;
}

.markdown-editor-v2 .markdown-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  min-height: 0;
  overflow: hidden;
}

.markdown-editor-v2 .markdown-preview-pane {
  grid-template-rows: auto minmax(0, 1fr);
}

.markdown-pane-head {
  align-items: start;
  min-height: 0;
}

.markdown-editor-v2 .markdown-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 8px;
  max-height: 104px;
  overflow: auto;
  padding: 1px 1px 3px;
}

.markdown-editor-v2 .toolbar-group {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #f8fafc;
}

.markdown-editor-v2 .markdown-toolbar button {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  min-height: 32px;
  padding: 0 9px;
  border-color: transparent;
  background: transparent;
  color: #232936;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

body.tool-mode .markdown-editor-v2 .markdown-toolbar button::before {
  content: none;
}

.markdown-editor-v2 .markdown-toolbar button:hover {
  border-color: #dfe5ee;
  background: #ffffff;
}

.markdown-editor-v2 .markdown-textarea {
  height: 100%;
  min-height: 0 !important;
  max-height: none;
  resize: none;
  overflow: auto;
  font-family: Consolas, "SFMono-Regular", "Malgun Gothic", monospace;
  font-size: 0.95rem;
  line-height: 1.65;
}

.markdown-editor-v2 .markdown-preview {
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overflow-wrap: anywhere;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
  color: #172033;
  font-weight: 800;
  letter-spacing: 0;
}

.markdown-preview h1 {
  font-size: 1.7rem;
  line-height: 1.22;
}

.markdown-preview h4 {
  font-size: 1.08rem;
}

.markdown-preview h5,
.markdown-preview h6 {
  font-size: 0.98rem;
}

.markdown-preview .task-list {
  list-style: none;
  padding-left: 0;
}

.markdown-preview .task-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.markdown-preview hr {
  border: 0;
  border-top: 1px solid #dfe5ee;
  margin: 18px 0;
}

.markdown-preview del {
  color: #667085;
}

.markdown-viewer-tool {
  display: grid;
  gap: 16px;
}

.markdown-viewer-loader {
  display: grid;
  gap: 14px;
}

.markdown-viewer-upload {
  min-height: 132px;
}

.markdown-viewer-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
}

.markdown-viewer-controls label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 0.86rem;
  font-weight: 800;
}

.markdown-viewer-controls select,
.markdown-viewer-controls input[type="range"] {
  width: 100%;
}

.markdown-viewer-controls output {
  color: #667085;
  font-size: 0.78rem;
  font-weight: 700;
}

.markdown-viewer-stage {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  grid-template-areas: "outline reader";
  gap: 16px;
  align-items: start;
  justify-items: stretch;
}

.markdown-viewer-outline {
  grid-area: outline;
  position: sticky;
  top: 16px;
  justify-self: stretch;
  max-height: clamp(360px, 68vh, 760px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #f8fafc;
  text-align: left;
}

.markdown-viewer-outline h3 {
  margin: 0 0 10px;
  color: #172033;
  font-size: 0.95rem;
  text-align: left;
}

.markdown-viewer-outline-list {
  display: grid;
  gap: 4px;
  justify-items: stretch;
  text-align: left;
}

.markdown-viewer-outline-list button {
  --outline-indent: 0px;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 7px 8px 7px calc(8px + var(--outline-indent));
  border-color: transparent;
  background: transparent;
  color: #344054;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  transform: none;
}

.markdown-viewer-outline-list button[data-depth="0"] {
  color: #172033;
  font-size: 0.88rem;
  font-weight: 850;
}

.markdown-viewer-outline-list button[data-depth="1"] {
  --outline-indent: 22px;
  color: #344054;
  font-size: 0.83rem;
  font-weight: 760;
}

.markdown-viewer-outline-list button[data-depth="2"] {
  --outline-indent: 44px;
  color: #667085;
  font-size: 0.8rem;
  font-weight: 650;
}

.markdown-viewer-outline-list button:hover {
  border-color: #dfe5ee;
  background: #ffffff;
  transform: none;
}

.markdown-viewer-reader {
  grid-area: reader;
  min-height: clamp(520px, 72vh, 880px);
  background: #ffffff;
}

.markdown-viewer-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.markdown-viewer-preview {
  width: 100%;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 38px);
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  font-size: var(--markdown-viewer-font-size, 17px);
  line-height: var(--markdown-viewer-line-height, 1.7);
  overflow-wrap: break-word;
}

.markdown-viewer-preview h1 {
  font-size: 2rem;
}

.markdown-viewer-source {
  width: 100%;
  max-height: clamp(420px, 66vh, 840px);
  margin: 0 auto;
  padding: clamp(18px, 2.6vw, 30px);
  overflow: auto;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #101828;
  color: #f2f4f7;
  font-family: Consolas, "SFMono-Regular", "Malgun Gothic", monospace;
  font-size: calc(var(--markdown-viewer-font-size, 17px) - 2px);
  line-height: 1.68;
  white-space: pre-wrap;
}

.markdown-viewer-stage[data-mode="split"] .markdown-viewer-canvas {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.86fr);
}

.markdown-viewer-stage[data-mode="split"] .markdown-viewer-preview,
.markdown-viewer-stage[data-mode="split"] .markdown-viewer-source {
  width: 100%;
}

.markdown-viewer-stage[data-mode="source"] .markdown-viewer-preview {
  display: none;
}

.markdown-viewer-stage[data-mode="source"] .markdown-viewer-source {
  display: block;
}

.markdown-viewer-stage[data-theme="paper"] .markdown-viewer-reader {
  background: #f3efe6;
}

.markdown-viewer-stage[data-theme="paper"] .markdown-viewer-preview {
  border-color: #e0d6c5;
  background: #fffaf0;
}

.markdown-viewer-stage[data-theme="dark"] .markdown-viewer-reader,
.markdown-viewer-stage[data-theme="dark"] .markdown-viewer-preview {
  border-color: #2d3648;
  background: #111827;
  color: #e5e7eb;
}

.markdown-viewer-stage[data-theme="dark"] .markdown-preview h1,
.markdown-viewer-stage[data-theme="dark"] .markdown-preview h2,
.markdown-viewer-stage[data-theme="dark"] .markdown-preview h3,
.markdown-viewer-stage[data-theme="dark"] .markdown-preview h4,
.markdown-viewer-stage[data-theme="dark"] .markdown-preview h5,
.markdown-viewer-stage[data-theme="dark"] .markdown-preview h6 {
  color: #f9fafb;
}

.markdown-viewer-stage[data-theme="dark"] .markdown-preview blockquote,
.markdown-viewer-stage[data-theme="dark"] .markdown-preview table,
.markdown-viewer-stage[data-theme="dark"] .markdown-preview th,
.markdown-viewer-stage[data-theme="dark"] .markdown-preview td {
  border-color: #374151;
}

.markdown-viewer-stage[data-theme="dark"] .markdown-preview code {
  background: #1f2937;
  color: #f9fafb;
}

body.tool-mode .diff-output,
body.tool-mode .file-list {
  max-height: clamp(260px, 38vh, 520px);
  overflow: auto;
}

body.tool-mode .result-card textarea,
body.tool-mode .input-card textarea,
body.tool-mode .editor-card textarea,
body.tool-mode .subtitle-textarea {
  max-height: clamp(320px, 52vh, 720px);
  overflow: auto;
}

@media (max-width: 980px) {
  .quick-tool-icons {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
  }

  .markdown-editor-v2 .markdown-shell {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }

  .markdown-editor-v2 .markdown-pane {
    height: min(68vh, 520px);
    min-height: 420px;
  }

  .markdown-editor-v2 .markdown-preview-pane {
    height: min(68vh, 520px);
  }

  .markdown-viewer-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .markdown-viewer-stage,
  .markdown-viewer-stage[data-mode="split"] .markdown-viewer-canvas {
    grid-template-columns: 1fr;
  }

  .markdown-viewer-stage {
    grid-template-areas:
      "outline"
      "reader";
  }

  .markdown-viewer-outline {
    position: static;
    max-height: 220px;
  }
}

@media (max-width: 560px) {
  .home-category-links {
    grid-template-columns: 1fr;
  }

  .quick-tool-strip {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 6px;
  }

  .quick-tool-icons {
    grid-template-columns: repeat(5, minmax(34px, 1fr));
    gap: 6px;
  }

  .quick-tool-label {
    font-size: 0.68rem;
  }

  .quick-tool-symbol {
    font-size: 1.42rem;
  }

  .quick-tool-head {
    font-size: 0.82rem;
  }

  .spreadsheet-result-item {
    grid-template-columns: 1fr;
  }

  .spreadsheet-result-item button {
    width: 100%;
  }

  .markdown-viewer-controls {
    grid-template-columns: 1fr;
  }

  .markdown-viewer-preview,
  .markdown-viewer-source {
    padding: 16px;
  }
}
