:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-soft: #f1f5f9;
  --line: #d9e2ec;
  --line-strong: #b7c5d3;
  --text: #17202a;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --blue: #2563eb;
  --rose: #be123c;
  --amber: #b45309;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter",
    "Pretendard",
    "Noto Sans KR",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(180px, 620px) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #17202a;
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.search-wrap svg {
  width: 18px;
  color: var(--muted);
  flex: 0 0 auto;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.top-links {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
}

.top-links a {
  padding: 8px 10px;
  border-radius: 6px;
}

.top-links a:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.quick-tools {
  display: flex;
  gap: 8px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 12px 22px 0;
  overflow-x: auto;
}

.quick-tools a {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.quick-tools a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.layout,
.main,
.workspace,
.library,
.sidebar,
.tool-box,
.dropzone,
.tool-card {
  min-width: 0;
}

.workspace,
.library,
.sidebar {
  width: 100%;
  max-width: 100%;
}

input[type="file"] {
  max-width: 100%;
}

.sidebar {
  position: sticky;
  top: 82px;
  align-self: start;
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.sidebar-title,
.eyebrow {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.category-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.category-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.category-button:hover,
.category-button.active {
  border-color: var(--line);
  background: var(--panel-soft);
}

.category-button span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.side-note {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  background: #eef2ff;
  color: #253161;
  font-size: 13px;
}

.side-note p {
  margin: 6px 0 0;
}

.tool-desc,
.side-note,
.status,
.tool-card p,
.preview-box,
.result-box {
  overflow-wrap: anywhere;
}

.main {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.workspace,
.library {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.workspace {
  padding: 22px;
}

.workspace-head {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
}

.workspace-head h1 {
  margin: 4px 0 8px;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: 0;
}

.tool-desc {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
}

.privacy-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid #99f6e4;
  border-radius: var(--radius);
  background: #ecfeff;
  color: #0f766e;
  font-size: 13px;
  font-weight: 700;
}

.privacy-badge svg,
.icon-button svg,
.btn svg {
  width: 18px;
  height: 18px;
}

.ad-slot {
  display: grid;
  min-height: 86px;
  place-items: center;
  margin: 18px 0;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 10px, #f1f5f9 10px, #f1f5f9 20px);
  color: var(--muted);
  font-size: 13px;
}

.ad-slot.ad-loaded {
  border: 0;
  background: transparent;
}

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

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

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

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

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.check-row {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  outline: 0;
}

.field input,
.field select {
  min-height: 42px;
  padding: 9px 10px;
}

.field textarea {
  min-height: 180px;
  padding: 11px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
}

.btn {
  padding: 9px 13px;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.btn.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.btn:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

.btn.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.icon-button {
  width: 40px;
  padding: 0;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
}

.status.good {
  color: var(--accent-strong);
}

.status.bad {
  color: var(--rose);
}

.result-box,
.preview-box,
.table-wrap {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.result-box {
  min-height: 110px;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
}

.preview-box {
  padding: 16px;
}

.preview-box h1,
.preview-box h2,
.preview-box h3 {
  margin-top: 0.7em;
}

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

.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.metric strong,
.metric span {
  display: block;
}

.metric strong {
  font-size: 22px;
  line-height: 1.1;
}

.metric span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.swatch {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.dropzone {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 148px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fbfdff;
  text-align: center;
}

.dropzone svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.dropzone input {
  width: min(100%, 360px);
}

.image-preview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.image-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
}

.qr-output {
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.library {
  padding: 18px;
}

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

.section-heading h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.tool-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.tool-card:hover,
.tool-card.active {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.1);
}

.tool-card .card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.tool-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tool-card .tag {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.related-tools {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.related-head {
  display: flex;
  justify-content: space-between;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

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

.related-link {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.related-link:hover {
  border-color: var(--accent);
  background: #f0fdfa;
}

.related-link strong {
  font-size: 14px;
  line-height: 1.3;
}

.related-link span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

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

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

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

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 16px;
  }

  .top-links {
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .quick-tools {
    padding: 10px 14px 0;
  }

  .main {
    order: 1;
  }

  .sidebar {
    order: 2;
    position: static;
    max-height: none;
  }

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

  .workspace-head {
    flex-direction: column;
  }

  .form-grid,
  .form-grid.three,
  .check-grid {
    grid-template-columns: 1fr;
  }

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

  .image-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .layout {
    padding: 10px;
  }

  .workspace {
    padding: 14px;
  }

  .library,
  .sidebar {
    padding: 14px;
  }

  .workspace-head h1 {
    font-size: 24px;
  }

  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }

  .dropzone {
    padding: 16px 10px;
  }

  .category-list,
  .tool-grid,
  .related-grid,
  .metric-grid,
  .swatches {
    grid-template-columns: 1fr;
  }

  .actions {
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}
