:root {
  --bg: #f4efe4;
  --bg-muted: #eceff6;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --surface-soft: #f8f6f0;
  --line: rgba(27, 34, 52, 0.12);
  --line-strong: rgba(27, 34, 52, 0.18);
  --text: #182033;
  --subtext: #5f677b;
  --accent: #0f6e68;
  --accent-strong: #0c5753;
  --accent-soft: rgba(15, 110, 104, 0.1);
  --navy: #21314f;
  --warning: #b45309;
  --danger: #c2410c;
  --success: #15803d;
  --shadow-lg: 0 28px 80px rgba(24, 32, 51, 0.12);
  --shadow-md: 0 14px 34px rgba(24, 32, 51, 0.08);
  --radius-2xl: 30px;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

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

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

body {
  color: var(--text);
  font-family: "Pretendard Variable", "SUIT Variable", "Pretendard", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(15, 110, 104, 0.15), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(33, 49, 79, 0.16), transparent 22%),
    linear-gradient(180deg, #e8edf6 0%, #f3efe7 34%, #f4efe4 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

img {
  max-width: 100%;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 110, 104, 0.24);
  outline-offset: 2px;
}

.app-shell {
  width: min(1560px, calc(100% - 40px));
  margin: 24px auto 40px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
}

.app-rail,
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
}

.app-rail,
.card {
  border-radius: var(--radius-2xl);
}

.app-rail {
  position: sticky;
  top: 20px;
  align-self: start;
  padding: 26px 22px;
  display: grid;
  gap: 20px;
}

.app-rail__eyebrow,
.panel-heading__eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  line-height: 1.4;
  font-weight: 800;
  color: var(--accent);
}

.app-rail__brand {
  display: grid;
  gap: 8px;
}

.app-rail__title {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.app-rail__description,
.panel-heading__desc,
.form-section__head span,
.tool-nav__hint,
.helper-text,
.status-message,
.empty-state,
.section-head span,
.upload-dropzone__copy,
.info-card p {
  margin: 0;
  color: var(--subtext);
  line-height: 1.7;
}

.app-rail__note {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(27, 34, 52, 0.08);
  background: linear-gradient(180deg, rgba(239, 243, 250, 0.86), rgba(248, 250, 253, 0.86));
}

.app-rail__note strong {
  font-size: 15px;
  font-weight: 800;
}

.app-rail__note p {
  margin: 0;
  color: var(--subtext);
  line-height: 1.75;
}

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

.tool-nav__button {
  width: 100%;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(27, 34, 52, 0.04);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.tool-nav__button:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 110, 104, 0.24);
  box-shadow: var(--shadow-md);
}

.tool-nav__button.is-active {
  background: linear-gradient(135deg, rgba(15, 110, 104, 0.14), rgba(33, 49, 79, 0.14));
  border-color: rgba(15, 110, 104, 0.28);
  box-shadow: var(--shadow-md);
}

.tool-nav__label {
  font-size: 18px;
  font-weight: 800;
}

.app-main {
  display: grid;
  min-width: 0;
}

.shell__panel-host {
  min-height: 0;
}

.tool-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.tool-panel.is-active {
  animation: panel-enter 0.18s ease;
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tool-layout {
  display: grid;
  gap: 22px;
}

.tool-layout--editor {
  grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
}

.card {
  padding: 24px;
}

.tool-pane--controls {
  position: sticky;
  top: 20px;
  align-self: start;
}

.tool-pane--workspace {
  min-height: 0;
}

.thumb-tool .tool-pane--workspace {
  position: sticky;
  top: 20px;
  align-self: start;
  height: fit-content;
  z-index: 1;
}

.panel-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel-heading {
  display: grid;
  gap: 14px;
}

.panel-heading__title {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.18;
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(27, 34, 52, 0.08);
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.status-badge--accent {
  background: rgba(15, 110, 104, 0.1);
  border-color: rgba(15, 110, 104, 0.12);
  color: var(--accent-strong);
}

.form-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(250, 248, 243, 0.78));
  border: 1px solid rgba(27, 34, 52, 0.06);
}

.form-section__head {
  display: grid;
  gap: 4px;
}

.form-section__head strong,
.section-head strong,
.info-card strong {
  font-size: 16px;
  font-weight: 800;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 800;
}

input[type="file"],
input[type="number"],
input[type="text"],
textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

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

input:focus,
textarea:focus {
  border-color: rgba(15, 110, 104, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 110, 104, 0.1);
}

textarea {
  min-height: 220px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.6;
}

.upload-dropzone {
  position: relative;
  display: grid;
  gap: 10px;
  justify-items: center;
  min-height: 150px;
  padding: 24px;
  border-radius: 22px;
  border: 2px dashed rgba(15, 110, 104, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(229, 242, 240, 0.84));
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  transform: translateY(-1px);
  border-color: rgba(15, 110, 104, 0.44);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(220, 241, 238, 0.88));
}

.upload-dropzone__title {
  font-size: 18px;
  font-weight: 800;
}

.input-hidden {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  cursor: pointer;
}

.chip-toggle {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.chip-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(27, 34, 52, 0.1);
  background: rgba(255, 255, 255, 0.8);
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.chip-button:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 110, 104, 0.25);
}

.chip-button.is-active {
  background: rgba(15, 110, 104, 0.12);
  border-color: rgba(15, 110, 104, 0.18);
  color: var(--accent-strong);
}

.value-readout {
  font-size: 14px;
  font-weight: 700;
  color: var(--subtext);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.btn--primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  border-color: rgba(27, 34, 52, 0.1);
}

.helper-text {
  font-size: 14px;
}

.status-message {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 110, 104, 0.08);
  border: 1px solid rgba(15, 110, 104, 0.12);
}

.status-message[data-tone="success"] {
  color: var(--success);
  background: rgba(21, 128, 61, 0.08);
  border-color: rgba(21, 128, 61, 0.12);
}

.status-message[data-tone="warning"] {
  color: var(--warning);
  background: rgba(180, 83, 9, 0.08);
  border-color: rgba(180, 83, 9, 0.12);
}

.status-message[data-tone="error"] {
  color: var(--danger);
  background: rgba(194, 65, 12, 0.08);
  border-color: rgba(194, 65, 12, 0.12);
}

.empty-state {
  padding: 64px 20px;
  text-align: center;
  border-radius: 22px;
  border: 1px dashed rgba(27, 34, 52, 0.16);
  background: rgba(255, 255, 255, 0.58);
}

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

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

.info-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(27, 34, 52, 0.06);
  display: grid;
  gap: 8px;
}

.thumb-tool__preview-shell {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(33, 49, 79, 0.06), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(27, 34, 52, 0.08);
}

.thumb-tool__stage {
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(233, 238, 245, 0.94), rgba(220, 227, 239, 0.94)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.32) 0,
      rgba(255, 255, 255, 0.32) 1px,
      transparent 1px,
      transparent 32px
    );
}

.thumb-tool__preview-frame {
  position: relative;
  width: 100%;
  min-height: 320px;
  overflow: hidden;
  border-radius: 24px;
  background: #152132;
  cursor: grab;
  user-select: none;
}

.thumb-tool__preview-frame:active {
  cursor: grabbing;
}

.thumb-tool__preview-image {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  transform-origin: center center;
  pointer-events: none;
  will-change: transform, width, height;
}

.thumb-tool__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.74);
  text-align: center;
  line-height: 1.7;
}

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

.image-tool__card {
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.image-tool__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 433 / 613;
  overflow: hidden;
  background: #e8ecf3;
}

.image-tool__frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.image-tool__body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.image-tool__name {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
  word-break: break-all;
}

.image-tool__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-tool__chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 110, 104, 0.08);
  color: #36505a;
  font-size: 13px;
}

.image-tool__remove {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--danger);
  font-weight: 800;
  padding: 14px;
  cursor: pointer;
}

.image-tool__remove:hover {
  background: rgba(194, 65, 12, 0.05);
}

.naming-preview {
  display: grid;
  gap: 10px;
}

.naming-preview__row {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(27, 34, 52, 0.06);
}

.naming-preview__row strong {
  font-size: 13px;
  color: var(--accent-strong);
}

.naming-preview__row span {
  word-break: break-all;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

.html-tool__result {
  display: grid;
  gap: 16px;
}

.html-tool__slide-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.html-tool__slide-tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(27, 34, 52, 0.1);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.html-tool__slide-tab.is-active {
  border-color: rgba(15, 110, 104, 0.22);
  background: rgba(15, 110, 104, 0.12);
  color: var(--accent-strong);
}

.html-tool__slide-panels {
  display: grid;
}

.html-tool__slide-panel {
  display: none;
  gap: 14px;
}

.html-tool__slide-panel.is-active {
  display: grid;
}

.html-tool__html-box {
  min-height: 220px;
}

.html-tool__preview-box {
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  max-height: 560px;
  overflow: auto;
}

.html-tool__image-names {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.html-tool__image-names-head {
  display: grid;
  gap: 4px;
}

.html-tool__image-names-head strong {
  font-size: 15px;
}

.html-tool__image-names-head span {
  color: var(--subtext);
  font-size: 13px;
}

.html-tool__image-name-list {
  min-height: 72px;
  resize: vertical;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.55;
}

.html-tool__copy-names {
  justify-self: start;
}

.html-tool__preview-box .editer_culture_preview,
.html-tool__preview-box #editer_culture {
  display: grid;
  gap: 18px;
}

.html-tool__preview-box .culture_section {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  padding: 20px;
  border: 1px solid rgba(27, 34, 52, 0.08);
  border-radius: 20px;
  background: #ffffff;
}

.html-tool__preview-box .thumbs img {
  display: block;
  width: 100%;
  max-width: 220px;
  border-radius: 14px;
  background: #eef2f7;
}

.html-tool__preview-box .culture_tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.html-tool__preview-box .culture_tag.book {
  background: #2563eb;
}

.html-tool__preview-box .culture_tag.show {
  background: #0f766e;
}

.html-tool__preview-box .culture_tag.show02 {
  background: #d97706;
}

.html-tool__preview-box .tit {
  margin: 12px 0 8px;
  font-size: 28px;
  line-height: 1.35;
}

.html-tool__preview-box .subtit {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.7;
  color: #4b5563;
}

.html-tool__preview-box .info_detail {
  display: grid;
  gap: 8px;
}

.html-tool__preview-box .info_detail dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  margin: 0;
}

.html-tool__preview-box .info_detail dt {
  font-weight: 800;
}

.html-tool__preview-box .info_detail dd {
  margin: 0;
}

.html-tool__preview-box .assistant {
  margin: 4px 0 0;
}

.html-tool__preview-box .btn-group {
  margin-top: 10px;
}

.html-tool__preview-box .btn_view_detail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  text-decoration: none;
  background: var(--navy);
  color: #ffffff;
  font-weight: 800;
}

@media (max-width: 1120px) {
  .app-shell,
  .tool-layout--editor {
    grid-template-columns: 1fr;
  }

  .app-rail {
    position: static;
  }

  .tool-pane--controls,
  .tool-pane--workspace,
  .thumb-tool .tool-pane--workspace {
    position: static;
  }
}

@media (max-width: 960px) {
  .app-shell {
    width: min(100%, calc(100% - 24px));
    margin: 12px auto 24px;
  }

  .tool-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .tool-nav__button {
    width: auto;
    min-width: 160px;
    flex: 0 0 auto;
  }

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

  .info-grid--two,
  .html-tool__preview-box .culture_section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-rail,
  .card {
    padding: 18px;
  }

  .field-grid--two,
  .image-tool__grid,
  .html-tool__preview-box .info_detail dl {
    grid-template-columns: 1fr;
  }

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

  .btn {
    width: 100%;
  }

  .thumb-tool__preview-frame {
    min-height: 240px;
  }
}
