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

body {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

header {
  text-align: center;
  padding: 48px 0 32px;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  margin-top: 8px;
  font-size: 15px;
  color: #6e6e73;
}

.section {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

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

.setting-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-label {
  font-size: 14px;
  color: #3d3d3f;
  white-space: nowrap;
}

.setting-select {
  padding: 8px 12px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.add-card-btn {
  padding: 10px 18px;
  background: #0071e3;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.add-card-btn:hover { background: #0077ed; }

/* Card list */
.card-list { display: flex; flex-direction: column; gap: 12px; }

.empty-state {
  text-align: center;
  padding: 40px 0;
  color: #b0b0b5;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Card item */
.card-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e5e5ea;
  border-radius: 12px;
  background: #fafafa;
}

.card-num {
  font-size: 12px;
  font-weight: 700;
  color: #bbb;
  min-width: 16px;
  padding-top: 6px;
  text-align: center;
  flex-shrink: 0;
}

.card-thumb {
  border-radius: 6px;
  border: 1px solid #e5e5ea;
  flex-shrink: 0;
  display: block;
  width: 80px;
  height: auto;
  background: #f0f0f0;
}

.card-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.card-title-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  background: #fff;
}
.card-title-input:focus { border-color: #0071e3; }

.card-body-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  line-height: 1.5;
  background: #fff;
}
.card-body-input:focus { border-color: #0071e3; }

/* Controls bar */
.card-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 12px;
  background: #f2f2f7;
  border-radius: 10px;
}

.ctrl-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-group-label {
  font-size: 10px;
  font-weight: 700;
  color: #aeaeb2;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.ctrl-divider {
  width: 1px;
  height: 32px;
  background: #d2d2d7;
  flex-shrink: 0;
}

/* Color swatch */
.swatch-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.swatch-label span {
  font-size: 10px;
  color: #8e8e93;
  white-space: nowrap;
  line-height: 1;
}

.swatch-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.1);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  flex-shrink: 0;
  transition: box-shadow 0.15s;
}

.swatch-wrap:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.25); }

.color-input {
  width: 200%;
  height: 200%;
  border: none;
  padding: 0;
  cursor: pointer;
  display: block;
  margin: -50%;
  opacity: 0.01;
}

/* Image button */
.ctrl-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid #d2d2d7;
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  color: #3d3d3f;
  transition: background 0.12s, border-color 0.12s;
}
.ctrl-btn:hover { background: #f0f0f5; }
.ctrl-btn.active {
  background: #e8f0fe;
  border-color: #0071e3;
  color: #0071e3;
}

.ctrl-btn.icon-only {
  padding: 5px 7px;
  color: #e53935;
  border-color: #ffd2d2;
  background: #fff5f5;
}
.ctrl-btn.icon-only:hover { background: #ffeaea; }

/* Alignment buttons */
.align-group {
  display: flex;
  border: 1px solid #d2d2d7;
  border-radius: 7px;
  overflow: hidden;
}

.align-btn {
  width: 32px;
  height: 28px;
  border: none;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8e8e93;
  transition: background 0.12s, color 0.12s;
  border-right: 1px solid #e5e5ea;
}
.align-btn:last-child { border-right: none; }
.align-btn:hover { background: #f0f0f5; color: #3d3d3f; }
.align-btn.active { background: #e8f0fe; color: #0071e3; }

/* Card actions */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.order-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #d2d2d7;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.order-btn:disabled { opacity: 0.3; cursor: default; }
.order-btn:not(:disabled):hover { background: #f5f5f7; }

.card-delete {
  width: 28px;
  height: 28px;
  border: 1px solid #ffd2d2;
  border-radius: 6px;
  background: #fff5f5;
  color: #e53935;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}
.card-delete:hover { background: #ffeaea; }

/* Generate */
.generate-section {
  display: flex;
  justify-content: center;
  padding: 8px 0 24px;
}

.generate-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  background: #1d1d1f;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.generate-btn:hover:not(:disabled) { background: #2d2d2f; }
.generate-btn:disabled { opacity: 0.4; cursor: not-allowed; }

footer {
  text-align: center;
  padding: 24px 0 16px;
  font-size: 13px;
  color: #888;
}
