/* Tool-specific reset + styles (cream/ink palette, matching existing site) */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: #f7f3ea;
  color: #1c1a17;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: 1rem;
  line-height: 1.6;
}
.ad { text-align: center; margin: 1rem auto; min-height: 60px; }
.back-link { display: inline-block; font-size: 0.9rem; color: #6f695f; text-decoration: none; margin-bottom: 0.75rem; }
.back-link:hover { color: #1c1a17; }
main { max-width: 960px; margin: 0 auto; padding: 2rem 0; }
h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.subtitle { color: #6f695f; font-size: 0.95rem; margin-bottom: 1.5rem; }
.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar button, .file-label {
  padding: 0.5rem 0.9rem; font-size: 0.9rem; font-weight: 500;
  border: 1px solid #ddd; border-radius: 6px; cursor: pointer; background: #fff; font-family: inherit; color: #1c1a17;
}
.toolbar button:hover { background: #f0edea; }
.btn-primary { background: #1c1a17; color: #f7f3ea; border-color: #1c1a17; }
.btn-primary:hover { background: #2d2a25; }
.file-label { display: inline-flex; align-items: center; }
.file-label input[type="file"] { display: none; }
.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pane label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.4rem; }
.pane textarea {
  width: 100%; min-height: 280px; padding: 0.75rem; font-size: 0.85rem; border: 1px solid #ddd;
  border-radius: 6px; background: #fff; font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace; color: #1c1a17; resize: vertical;
}
.pane textarea[readonly] { background: #faf9f6; }
.pane .count { font-size: 0.75rem; color: #6f695f; margin-top: 0.35rem; }
.options { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.options label { display: flex; align-items: center; cursor: pointer; font-weight: 500; }
.options input[type="checkbox"] { margin-right: 0.4rem; }
.actions { display: flex; gap: 0.75rem; margin-top: 0.75rem; flex-wrap: wrap; }
.actions button {
  padding: 0.5rem 0.9rem; font-size: 0.9rem; font-weight: 500;
  border: 1px solid #ddd; border-radius: 6px; cursor: pointer; background: #fff; font-family: inherit; color: #1c1a17;
}
.actions button:hover { background: #f0edea; }
.result { text-align: center; margin: 1.5rem 0; padding: 1.25rem; background: #fff; border-radius: 10px; border: 1px solid #eee; }
.result.hidden { display: none; }
.field { margin-bottom: 1.25rem; }
label.field-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.4rem; }
input[type="url"], input[type="text"], input[type="tel"], input[type="email"], input[type="number"], input[type="datetime-local"], textarea, select {
  width: 100%; padding: 0.6rem 0.8rem; font-size: 1rem; border: 1px solid #ddd;
  border-radius: 6px; background: #fff; font-family: inherit;
}
textarea { resize: vertical; }
input[type="checkbox"] { margin-right: 0.4rem; }
.error-banner {
  margin-top: 1rem; padding: 0.75rem 1rem; background: #fdecea; color: #5a1a1a; border: 1px solid #f5c6c6; border-radius: 6px; font-size: 0.9rem;
}
.error-banner.hidden { display: none; }
.preview {
  width: 100%; min-height: 280px; padding: 0.75rem; font-size: 0.9rem; border: 1px solid #ddd;
  border-radius: 6px; background: #fff; overflow: auto;
}
.preview img { max-width: 100%; }
.tips h2 { font-size: 1.25rem; font-weight: 600; margin: 2rem 0 1rem; }
.tips dl dt { font-weight: 600; margin: 1rem 0 0.3rem; font-size: 0.95rem; }
.tips dl dd { color: #6f695f; font-size: 0.9rem; margin-bottom: 0.5rem; }
footer { text-align: center; margin-top: 2rem; font-size: 0.8rem; color: #6f695f; }

/* Color palette */
.controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 1.25rem; }
.controls .field { margin-bottom: 0; flex: 1; min-width: 160px; }
.color-input-wrap { display: flex; align-items: center; gap: 0.5rem; }
.color-input-wrap input[type="color"] { width: 48px; height: 40px; padding: 0; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; margin-bottom: 1.5rem; }
.swatch {
  position: relative; border-radius: 8px; padding: 0.6rem; cursor: pointer; min-height: 110px;
  display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid #eee;
}
.swatch .hex { font-size: 0.85rem; font-weight: 700; font-family: 'SF Mono', Consolas, monospace; }
.swatch .rgb { font-size: 0.7rem; opacity: 0.9; font-family: 'SF Mono', Consolas, monospace; }
.swatch .lock {
  position: absolute; top: 0.4rem; right: 0.4rem; width: 26px; height: 26px; border: none; border-radius: 6px;
  background: rgba(0,0,0,0.32); color: #fff; cursor: pointer; font-size: 0.85rem; line-height: 1;
}
.swatch.locked .lock { background: rgba(0,0,0,0.75); }
.contrast-box {
  padding: 1rem; background: #fff; border: 1px solid #eee; border-radius: 10px; margin-bottom: 1.5rem;
}
.contrast-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.contrast-row .field { margin-bottom: 0; flex: 1; min-width: 140px; }
.contrast-result { font-size: 0.95rem; margin-top: 0.75rem; }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; color: #fff; margin-left: 0.4rem; }
.badge.pass { background: #2f6f44; }
.badge.fail { background: #b04a4a; }
.copy-hint { font-size: 0.75rem; color: #6f695f; margin-top: 0.4rem; }

@media (max-width: 600px) {
  body { padding: 0.75rem; }
  main { padding: 1rem 0; }
  h1 { font-size: 1.35rem; margin-bottom: 0.35rem; }
  .subtitle { font-size: 0.85rem; margin-bottom: 0.75rem; }
  .toolbar { gap: 0.4rem; }
  .panes { grid-template-columns: 1fr; }
  .pane textarea { min-height: 200px; }
  .palette { grid-template-columns: repeat(2, 1fr); }
  .actions { flex-wrap: wrap; }
  .tips h2 { margin: 1.25rem 0 0.6rem; font-size: 1.1rem; }
  .tips dl dt { margin: 0.75rem 0 0.2rem; font-size: 0.9rem; }
  .tips dl dd { font-size: 0.85rem; margin-bottom: 0.4rem; }
  footer { margin-top: 1.25rem; }
}
