:root {
  --bg: #eef3ea;
  --bg-accent: #dce9de;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --line: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.24);
  --text: #153021;
  --muted: #59705f;
  --accent: #1f6f4a;
  --accent-strong: #114d31;
  --accent-soft: #dcefe1;
  --success: #0a8a52;
  --error: #c84b31;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.09);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: "Avenir Next", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 28%),
    linear-gradient(145deg, var(--bg) 0%, #f7faf4 48%, var(--bg-accent) 100%);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.36) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.36) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  opacity: 0.35;
}

.app-shell {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.app-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

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

.footer-contact a:hover {
  text-decoration: underline;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 20px 30px;
  min-height: 148px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(51, 65, 85, 0.92)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
  color: #f5fbf4;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-width: 720px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.78;
}

.hero h1 {
  font-size: clamp(1.2rem, 2vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.hero-description {
  margin-top: 8px;
  max-width: 580px;
  color: rgba(245, 251, 244, 0.84);
  font-size: 0.94rem;
}

.hero-description-muted {
  color: rgba(245, 251, 244, 0.58);
}

.hero-badge {
  min-width: 180px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.hero-badge span {
  display: inline-flex;
  align-items: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
}

.back-link {
  display: inline-flex;
  margin-bottom: 12px;
  color: rgba(245, 251, 244, 0.92);
  text-decoration: none;
}

.page-layout {
  display: grid;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

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

.qr-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
}

.json-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
}

.finance-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
}

.math-layout {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
}

.business-layout {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
}

.color-converter-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.crypto-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.json-table-layout {
  grid-template-columns: 1fr;
}

.text-cleaner-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.url-query-layout {
  grid-template-columns: 1fr;
}

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

.side-panel-stack {
  display: grid;
  gap: 24px;
  align-self: start;
}

.panel {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.section-heading p {
  margin-top: 6px;
  color: var(--muted);
}

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

.menu-card {
  position: relative;
  min-height: 104px;
  padding: 13px 14px;
  border-radius: 20px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(226, 232, 240, 0.95));
  border: 1px solid rgba(30, 41, 59, 0.14);
  box-shadow: 0 14px 35px rgba(30, 41, 59, 0.1);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.menu-card:hover {
  transform: translateY(-4px);
  border-color: rgba(30, 41, 59, 0.28);
  box-shadow: 0 20px 40px rgba(30, 41, 59, 0.14);
}

.menu-card-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 100%;
  text-decoration: none;
  color: inherit;
  padding-right: 34px;
}

.menu-card-favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: rgba(15, 23, 42, 0.38);
  box-shadow: 0 8px 20px rgba(30, 41, 59, 0.12);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.menu-card-favorite:hover {
  transform: scale(1.04);
  background: rgba(255, 255, 255, 0.96);
  color: rgba(15, 23, 42, 0.58);
}

.menu-card-favorite.active {
  background: rgba(255, 242, 204, 0.96);
  color: #a56a00;
}

.menu-card-favorite span {
  font-size: 0.95rem;
  line-height: 1;
}

.menu-card-index {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.menu-card strong {
  font-size: clamp(0.95rem, 1.5vw, 1.2rem);
  letter-spacing: -0.04em;
}

.menu-card-description {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.tab-btn,
.btn,
.download-btn {
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tab-btn {
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-weight: 700;
}

.tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(17, 77, 49, 0.18);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.sub-panel {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
}

.sub-panel h3 {
  margin-bottom: 12px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group-full {
  grid-column: 1 / -1;
}

.form-group label,
.url-result-card label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.label-meta {
  margin-left: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: -0.01em;
}

.form-group input:disabled,
.form-group textarea:disabled {
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted);
  cursor: not-allowed;
}

.form-inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.form-label-row label {
  margin-bottom: 0;
}

.segmented-control-sm .segmented-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-sm {
  width: 100px;
  padding: 4px 0;
  font-size: 0.78rem;
  line-height: 1.4;
  border-radius: 6px;
  font-weight: 600;
  margin-top: 0;
  flex-shrink: 0;
}

.btn-pocket {
  width: auto;
  padding: 4px 10px;
  font-size: 0.72rem;
  line-height: 1.3;
  border-radius: 5px;
  font-weight: 600;
  margin: 0 0 0 auto;
  flex-shrink: 0;
}

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

.form-group input,
.form-group select,
.form-group textarea,
.url-result-card textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.url-result-card textarea:focus {
  outline: none;
  border-color: rgba(30, 41, 59, 0.45);
  box-shadow: 0 0 0 4px rgba(30, 41, 59, 0.12);
}

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

.section-heading-compact {
  margin-top: 8px;
  margin-bottom: 12px;
}

.section-heading-compact h3 {
  font-size: 1rem;
}

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

.param-guide {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(226, 232, 240, 0.45);
  color: var(--text);
}

.param-guide p + p {
  margin-top: 6px;
}

.template-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.template-toolbar-inline {
  margin-bottom: 0;
}

.template-status {
  margin: -6px 0 18px;
  color: var(--muted);
}

.template-status strong {
  color: var(--text);
}

.template-btn {
  width: auto;
  min-width: 160px;
  margin-top: 0;
}

.template-panel {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.template-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.template-panel-header span {
  color: var(--muted);
  font-size: 0.92rem;
}

.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.template-item-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.template-item {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.38);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.template-item:hover {
  transform: translateY(-1px);
  background: rgba(226, 232, 240, 0.7);
  border-color: rgba(30, 41, 59, 0.24);
}

.template-item.is-active {
  background: rgba(30, 41, 59, 0.14);
  border-color: rgba(30, 41, 59, 0.3);
}

.template-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.template-delete-btn:hover {
  background: rgba(200, 75, 49, 0.08);
  color: var(--error);
  border-color: rgba(200, 75, 49, 0.22);
}

.template-empty {
  color: var(--muted);
}

.param-row {
  display: grid;
  gap: 8px;
  --param-indent: 0px;
}

.param-row > .sub-param-list {
  --parent-indent: var(--param-indent);
}

.param-main-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 10px;
  align-items: center;
}

.param-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-left: var(--param-indent);
}

.param-action-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.param-row input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  color: var(--text);
}

.param-row input:focus {
  outline: none;
  border-color: rgba(30, 41, 59, 0.45);
  box-shadow: 0 0 0 4px rgba(30, 41, 59, 0.12);
}

.param-url-mode,
.param-sibling-add,
.param-sub-add,
.param-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  min-height: 46px;
  padding: 0 10px;
  cursor: pointer;
}

.param-url-mode.active {
  background: var(--accent);
  color: #ffffff;
}

.param-sub-add,
.param-sibling-add,
.param-remove {
  font-size: 0.92rem;
}

.param-remove {
  color: var(--muted);
}

.sub-param-list {
  display: grid;
  gap: 10px;
  position: relative;
  padding-top: 10px;
}

.sub-param-list::before {
  content: "";
  position: absolute;
  inset: 0 0 0 calc(var(--parent-indent, 0px) + 14px);
  border-left: 3px solid rgba(30, 41, 59, 0.22);
  border-radius: var(--radius-md);
  background: rgba(226, 232, 240, 0.2);
  pointer-events: none;
}

.sub-param-list > .param-row {
  gap: 6px;
  --param-indent: calc(var(--parent-indent, 0px) + 28px);
}

.sub-param-list > .param-row > .param-main-row {
  position: relative;
  z-index: 1;
}

.param-actions {
  margin: 4px 0 18px;
}

.csv-info {
  margin-bottom: 18px;
  padding: 16px;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(226, 232, 240, 0.62);
}

.csv-info pre {
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
}

.logo-upload {
  position: relative;
  margin-bottom: 16px;
}

#logoFile,
#logoFileCsv {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.logo-upload span {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.8);
}

.logo-preview,
.preview-container {
  min-height: 120px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.logo-preview img {
  max-width: 100%;
  max-height: 110px;
}

.logo-percent-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.logo-percent-row input {
  flex: 1;
}

.logo-preview-inline {
  flex: 0 0 72px;
  min-height: 0;
  min-width: 72px;
  height: 52px;
  padding: 6px;
  border: none;
  background: transparent;
}

.logo-preview-inline img {
  max-height: 100%;
}

.preview-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.preview-container.has-content img {
  max-width: 100%;
  height: auto;
}

.placeholder {
  color: var(--muted);
}

.btn,
.download-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 700;
  font: inherit;
}

.btn:hover,
.download-btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
}

.btn-secondary {
  margin-top: 16px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
}

.btn-success {
  margin-top: 20px;
  background: linear-gradient(135deg, #1f8f5c, #126943);
  color: #ffffff;
}

.results-section {
  margin-top: 0;
}

.results-summary {
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(226, 232, 240, 0.62);
  color: var(--text);
}

.results-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.result-item {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
}

.result-item img,
.result-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 180px;
  border-radius: 16px;
  background: rgba(226, 232, 240, 0.7);
}

.result-item img {
  object-fit: contain;
}

.label {
  margin: 14px 0 10px;
  font-weight: 700;
}

.download-btn {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
}

.url-result-card textarea {
  resize: vertical;
}

.json-editor {
  min-height: 420px;
  resize: vertical;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  line-height: 1.55;
}

.url-query-input {
  min-height: 110px;
}

.json-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.json-action-row .btn {
  width: auto;
  min-width: 120px;
}

.base64-mode-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-card {
  display: grid;
  gap: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--muted);
  font-weight: 700;
}

.status-badge.success {
  background: rgba(10, 138, 82, 0.12);
  color: var(--success);
}

.status-badge.error {
  background: rgba(200, 75, 49, 0.12);
  color: var(--error);
}

.status-copy-btn {
  margin-top: 4px;
}

.status-meta {
  display: grid;
  gap: 10px;
}

.status-meta-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.status-meta-item strong {
  display: block;
  margin-bottom: 4px;
}

.status-output {
  min-height: 280px;
  resize: vertical;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  line-height: 1.55;
}

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

.query-item {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  margin-left: calc(var(--query-depth, 0) * 20px);
}

.query-item-header {
  font-size: 0.92rem;
  font-weight: 700;
}

.query-item-grid {
  display: grid;
  gap: 8px;
}

.query-item-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.query-item-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.query-item-value {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.88rem;
  line-height: 1.5;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.toggle-row input {
  width: auto;
}

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

.duplicate-item {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(200, 75, 49, 0.18);
  background: rgba(200, 75, 49, 0.06);
}

.duplicate-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.duplicate-item-header strong {
  overflow-wrap: anywhere;
}

.duplicate-count {
  color: var(--error);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.duplicate-meta {
  display: grid;
  gap: 6px;
}

.duplicate-meta code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.86rem;
}

.text-diff-layout {
  grid-template-columns: 1fr;
}

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

.text-diff-input {
  min-height: 260px;
}

.text-cleaner-input,
.text-cleaner-output {
  min-height: 280px;
}

.jwt-output-grid {
  display: grid;
  gap: 16px;
}

.crypto-section {
  display: grid;
  gap: 18px;
}

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

.crypto-output {
  min-height: 220px;
}

.crypto-section .json-editor:not(.crypto-key-input) {
  min-height: 210px;
}

.crypto-key-input,
.crypto-key-output {
  min-height: 180px;
}

.crypto-inline-note {
  color: var(--muted);
  font-size: 0.84rem;
}

.crypto-advanced-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.crypto-advanced-panel summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  list-style: none;
}

.crypto-advanced-panel summary::-webkit-details-marker {
  display: none;
}

.crypto-advanced-panel summary::after {
  content: "펼치기";
  float: right;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.crypto-advanced-panel[open] summary::after {
  content: "접기";
}

.crypto-advanced-body {
  padding: 0 16px 16px;
}

.color-picker-block {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.color-picker-input {
  width: 100%;
  height: 72px;
  padding: 6px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-input::-webkit-color-swatch {
  border: 0;
  border-radius: 12px;
}

.color-picker-input::-moz-color-swatch {
  border: 0;
  border-radius: 12px;
}

.color-picker-meta {
  display: grid;
  gap: 4px;
}

.color-picker-meta span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.color-preview-card {
  display: grid;
  gap: 16px;
}

.color-preview-swatch {
  min-height: 180px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.color-preview-values {
  display: grid;
  gap: 12px;
}

.timestamp-output-grid {
  display: grid;
  gap: 12px;
}

.image-base64-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  text-align: center;
  object-fit: contain;
}

.image-base64-preview.hidden {
  display: none;
}

.image-base64-output {
  min-height: 260px;
}

.color-preview-values .btn-sm {
  width: 22px;
  min-width: 22px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.color-preview-values .btn-sm:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jwt-output {
  min-height: 220px;
}

.json-table-input {
  min-height: 180px;
}

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

.diff-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.diff-row code {
  display: block;
  overflow-wrap: anywhere;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  line-height: 1.5;
}

.diff-sign {
  font-weight: 700;
  text-align: center;
}

.diff-row.added {
  border-color: rgba(10, 138, 82, 0.22);
  background: rgba(10, 138, 82, 0.08);
}

.diff-row.added .diff-sign {
  color: var(--success);
}

.diff-row.removed {
  border-color: rgba(200, 75, 49, 0.22);
  background: rgba(200, 75, 49, 0.08);
}

.diff-row.removed .diff-sign {
  color: var(--error);
}

.diff-row.same {
  background: rgba(255, 255, 255, 0.7);
}

.diff-row.same .diff-sign {
  color: var(--muted);
}

.finance-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.category-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.finance-switch-btn {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.finance-switch-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(30, 41, 59, 0.3);
  box-shadow: 0 16px 30px rgba(30, 41, 59, 0.08);
}

.finance-switch-btn.active {
  border-color: rgba(30, 41, 59, 0.36);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(226, 232, 240, 0.92));
  box-shadow: 0 18px 34px rgba(30, 41, 59, 0.1);
}

.finance-switch-btn strong {
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.finance-switch-btn span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.category-switch-btn {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.category-switch-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(30, 41, 59, 0.3);
  box-shadow: 0 16px 30px rgba(30, 41, 59, 0.08);
}

.category-switch-btn.active {
  border-color: rgba(30, 41, 59, 0.36);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(226, 232, 240, 0.92));
  box-shadow: 0 18px 34px rgba(30, 41, 59, 0.1);
}

.category-switch-btn strong {
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.category-switch-btn span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.segmented-btn {
  width: auto;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--muted);
}

.segmented-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(17, 77, 49, 0.18);
}

.hint-card {
  margin-bottom: 22px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(226, 232, 240, 0.52);
  color: var(--text);
}

.hint-card p + p {
  margin-top: 6px;
}

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

.result-hero-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.result-hero-value {
  font-size: clamp(1.8rem, 2vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.result-hero-description {
  color: var(--muted);
}

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

.metric-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.14rem;
  letter-spacing: -0.03em;
}

.finance-bars {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.finance-bar-row {
  display: grid;
  gap: 8px;
}

.finance-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.finance-bar-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.finance-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.42), rgba(30, 41, 59, 0.92));
}

.finance-summary-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.finance-summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.finance-summary-item span {
  color: var(--muted);
}

.finance-summary-item strong {
  text-align: right;
  letter-spacing: -0.02em;
}

.finance-empty-state {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(226, 232, 240, 0.4);
  color: var(--muted);
}

.detail-panel {
  margin-top: 22px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.detail-title {
  margin-bottom: 12px;
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.detail-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
}

.schedule-panel {
  margin-top: 24px;
}

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

.schedule-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.schedule-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.schedule-table th,
.schedule-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: right;
  font-size: 0.9rem;
  white-space: nowrap;
}

.schedule-table th:first-child,
.schedule-table td:first-child {
  text-align: left;
}

.schedule-table thead th {
  position: sticky;
  top: 0;
  background: #f4f8f1;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.schedule-table tbody tr:last-child td {
  border-bottom: none;
}

.schedule-table tbody tr:nth-child(even) {
  background: rgba(226, 232, 240, 0.2);
}

.table-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 18px 0 12px;
  padding: 0 2px;
}

.tree-head-copy {
  display: grid;
  gap: 4px;
}

.table-preview-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.tree-control-row .btn {
  width: auto;
  margin-top: 0;
  padding: 8px 14px;
}

.json-tree-card {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid rgba(30, 41, 59, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
}

.json-tree-empty {
  color: var(--muted);
  text-align: center;
}

.json-tree-node,
.json-tree-leaf {
  margin-left: calc(var(--tree-depth, 0) * 14px);
}

.json-tree-node + .json-tree-node,
.json-tree-node + .json-tree-leaf,
.json-tree-leaf + .json-tree-node,
.json-tree-leaf + .json-tree-leaf {
  margin-top: 4px;
}

.json-tree-node summary,
.json-tree-leaf {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 14px;
  background: rgba(244, 248, 241, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.json-tree-node summary {
  cursor: pointer;
  list-style: none;
}

.json-tree-node summary::-webkit-details-marker {
  display: none;
}

.json-tree-node summary::before {
  content: '▾';
  margin-right: 3px;
  color: var(--muted);
  flex: 0 0 auto;
}

.json-tree-node:not([open]) summary::before {
  content: '▸';
}

.json-tree-children {
  margin-top: 4px;
}

.json-tree-key {
  color: rgba(15, 23, 42, 0.92);
  font-weight: 700;
  white-space: nowrap;
}

.json-tree-type,
.json-tree-value {
  margin-left: auto;
  color: var(--muted);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.84rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.json-tree-type {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.08);
}

.data-table-wrap {
  overflow: auto;
  border: 1px solid rgba(30, 41, 59, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.55;
  vertical-align: top;
  white-space: nowrap;
}

.data-table td {
  max-width: 320px;
  overflow-wrap: anywhere;
  white-space: normal;
  background: rgba(255, 255, 255, 0.92);
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e6f1e4;
  color: rgba(15, 23, 42, 0.82);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.98);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(226, 232, 240, 0.2);
}

.data-table tbody tr:nth-child(even) td {
  background: rgba(243, 248, 241, 0.96);
}

.data-table-empty {
  color: var(--muted);
  text-align: center;
}

.preview-panel {
  overflow: hidden;
}

.compact-group input {
  max-width: 220px;
}

.alert {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 31, 22, 0.18);
}

.alert.success {
  background: var(--success);
}

.alert.error {
  background: var(--error);
}

.alert.info {
  background: var(--accent);
}

.spinner {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none;
}

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

@media (max-width: 960px) {
  .hero {
    align-items: center;
    min-height: 0;
  }

  .template-toolbar,
  .template-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .template-btn {
    width: 100%;
  }

  .qr-layout,
  .json-layout,
  .finance-layout,
  .math-layout,
  .business-layout,
  .color-converter-layout,
  .crypto-layout,
  .json-table-layout,
  .text-cleaner-layout,
  .finance-switcher,
  .category-switcher,
  .text-diff-grid,
  .url-query-layout,
  .url-layout,
  .menu-grid,
  .form-grid,
  .metric-grid,
  .param-main-row,
  .param-row {
    grid-template-columns: 1fr;
  }

  .hero-badge {
    justify-content: flex-end;
    flex-shrink: 0;
    margin-left: auto;
  }

  .finance-summary-item,
  .schedule-head,
  .finance-bar-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .color-picker-block {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 20px 14px 40px;
  }

  .hero,
  .panel {
    padding: 18px;
  }

  .menu-card {
    min-height: 120px;
    border-radius: 24px;
  }
}

.visit-counter {
  font-size: 0.85em;
  opacity: 0.65;
}
/* === Language Switcher (top-bar, above hero) === */
.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 12px;
}
.lang-switcher {
  position: relative;
}
.lang-switcher > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.lang-switcher > summary::-webkit-details-marker { display: none; }
.lang-switcher > summary::marker { content: ''; }
.lang-switcher > summary:hover { background: rgba(255, 255, 255, 1); border-color: rgba(15, 23, 42, 0.2); }
.lang-switcher[open] > summary { background: #fff; border-color: rgba(15, 23, 42, 0.25); }
.lang-switcher-globe { display: inline-flex; align-items: center; color: #475569; }
.lang-switcher-arrow { font-size: 0.7em; opacity: 0.6; }
.lang-switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  z-index: 100;
}
.lang-switcher-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: #334155;
  font-size: 0.85rem;
  transition: background-color 0.15s ease;
}
.lang-switcher-item:hover { background: #f1f5f9; }
.lang-switcher-item.active { background: #2563eb; color: #fff; }
@media (max-width: 640px) {
  .top-bar { margin-bottom: 8px; }
  .lang-switcher > summary { padding: 5px 8px; font-size: 0.72rem; }
}

/* === Top-bar: brand + lang switcher === */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.top-bar-brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
}
.top-bar-brand-tld {
  font-size: 0.78em;
  font-weight: 600;
  color: #64748b;
}
.top-bar-brand:hover { color: #2563eb; }

/* === Reduced hero height === */
.hero {
  min-height: 0 !important;
  padding: 14px 20px !important;
}
.hero h1 {
  font-size: clamp(1.05rem, 1.6vw, 1.5rem) !important;
  margin: 0 !important;
}
.hero-description {
  margin-top: 4px !important;
  font-size: 0.85rem !important;
}
.hero-description-muted {
  font-size: 0.78rem !important;
}
.hero-badge { min-width: 0 !important; }
.hero-badge span {
  padding: 6px 12px !important;
  font-size: 0.78rem !important;
}
.back-link {
  font-size: 0.8rem !important;
  margin-bottom: 4px !important;
  display: inline-block;
}
@media (max-width: 640px) {
  .top-bar-brand { font-size: 0.95rem; }
  .hero { padding: 12px 16px !important; }
}

/* === Top-bar brand — bigger, centered, with logo === */
.top-bar {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  gap: 12px;
}
.top-bar-spacer { display: block; }
.top-bar > details { justify-self: end; }
.top-bar-brand {
  justify-self: center;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px;
}
.top-bar-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
}
.top-bar-brand-tld {
  font-size: 0.7em !important;
}
@media (max-width: 640px) {
  .top-bar-brand { font-size: 1.2rem !important; }
  .top-bar-logo { width: 24px; height: 24px; }
}

/* === Hero rounding halved === */
.hero {
  border-radius: calc(var(--radius-xl) / 2) !important;
}

/* === Identity: Slate + Accent (Apple/Stripe style) === */
.hero {
  background:
    linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #334155 100%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 220px at 110% -20%, rgba(96, 165, 250, 0.18), transparent 60%),
    radial-gradient(600px 200px at -10% 120%, rgba(99, 102, 241, 0.14), transparent 60%);
  pointer-events: none;
}
.hero-copy, .hero-badge { position: relative; z-index: 1; }
.hero h1 { color: #f8fafc !important; }
.hero-description { color: rgba(248, 250, 252, 0.78) !important; }
.hero-description-muted { color: rgba(148, 163, 184, 0.72) !important; }
.hero-badge span {
  background: rgba(148, 163, 184, 0.12) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  color: #e2e8f0 !important;
}
.back-link { color: rgba(226, 232, 240, 0.9) !important; }

/* === Identity: Slate palette tokens === */
:root {
  --bg: #f1f5f9 !important;
  --bg-accent: #e2e8f0 !important;
  --panel: rgba(255, 255, 255, 0.92) !important;
  --panel-strong: #ffffff !important;
  --line: rgba(15, 23, 42, 0.10) !important;
  --line-strong: rgba(15, 23, 42, 0.20) !important;
  --text: #0f172a !important;
  --muted: #64748b !important;
  --accent: #1e293b !important;
  --accent-strong: #0f172a !important;
  --accent-soft: #e2e8f0 !important;
  --success: #0e9f6e !important;
  --error: #dc2626 !important;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08) !important;
}
body {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 28%),
    linear-gradient(145deg, #f8fafc 0%, #eef2f7 48%, #e2e8f0 100%) !important;
}
body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.45) 1px, transparent 1px) !important;
}

/* === Buttons: unified compact height === */
.btn,
.download-btn {
  padding: 9px 18px !important;
  font-size: 0.92rem !important;
  line-height: 1.2 !important;
  width: auto !important;
  min-width: 120px;
}
.btn-primary,
.btn-secondary,
.btn-success { margin-top: 12px !important; }
