:root {
  --bg: #ff8a00;
  --bg2: #ffb457;
  --card: rgba(255, 255, 255, 0.92);
  --text: #1b1b1b;
  --muted: rgba(0, 0, 0, 0.6);
  --btn: #1b1b1b;
  --btnText: #ffffff;
  --btn2: rgba(0, 0, 0, 0.08);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% 10%, var(--bg2), var(--bg)),
    radial-gradient(1200px 600px at 80% 80%, #ffd08a, var(--bg));
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.header {
  color: #fff;
  margin-bottom: 18px;
}

.title {
  margin: 0;
  font-size: 44px;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 10px 0 0;
  opacity: 0.95;
}

.card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.file {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file input {
  display: none;
}

.fileBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  font-weight: 700;
}

.fileName {
  font-size: 14px;
  color: var(--muted);
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--btn);
  color: var(--btnText);
  cursor: pointer;
  font-weight: 800;
}

.btn.secondary {
  background: #fff;
  color: var(--text);
}

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

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

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

.panel {
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.panelTitle {
  font-weight: 900;
  margin-bottom: 8px;
}

.prompt {
  width: 100%;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 10px;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
}

.canvasWrap {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  overflow: hidden;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview {
  max-width: 100%;
  max-height: 360px;
  display: block;
}

.hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.status {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}

code {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
}
