:root {
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --border: #c9c9c9;
  --accent: #1a1a1a;
  --warn-bg: #fff6e0;
  --warn-border: #e0c060;
  --error-bg: #fdecec;
  --error-border: #e08080;
  --bg: #f2f2f0;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

#app {
  width: 40em;
  max-width: 100%;
}

h1 {
  font-size: 22px;
  margin: 0 0 20px;
}

#dropzone {
  background: var(--panel);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

#dropzone:hover,
#dropzone:focus-visible,
#dropzone.dragover {
  border-color: var(--accent);
  background: #fafafa;
  outline: none;
}

#dropzone-label {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

#file-name {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}

#file-name:empty {
  display: none;
}

#bleed-calc {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
  padding: 12px 14px 14px;
  background: var(--panel);
}

#bleed-calc summary {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
}

#bleed-calc[open] summary {
  margin-bottom: 8px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 7px 2px;
}

.setting-row select {
  width: 160px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--panel);
  color: var(--ink);
}

.setting-row input {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  text-align: right;
}

#bleed-calc-output {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

#bleed-calc-output p {
  margin: 4px 0;
}

#bleed-out-full-pt {
  background: #ffff00;
  padding: 1px 4px;
  border-radius: 3px;
}

.copy-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: inherit;
  font-family: inherit;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
}

.copy-link:hover {
  color: var(--muted);
}

#format-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  font-size: 14px;
  font-weight: 600;
}

#format-select-row select {
  flex: 1;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  background: var(--panel);
  color: var(--ink);
}

#format-select-row option:disabled {
  color: #b5b5b5;
}

#bleed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 2px;
  font-size: 13px;
  color: var(--muted);
}

#bleed-row input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#cutmarks-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 2px;
  font-size: 13px;
  color: var(--muted);
}

#cutmarks-row[hidden] {
  display: none;
}

#cutmarks-row input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#creep-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 2px;
  font-size: 13px;
  color: var(--muted);
}

#creep-row[hidden] {
  display: none;
}

#creep-row input {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  text-align: right;
}

#make-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.spinner {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

#make-btn:disabled {
  background: #b5b5b5;
  cursor: not-allowed;
}

#make-btn[hidden] {
  display: none;
}

#messages {
  margin-top: 14px;
}

.msg {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.msg-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
}

.msg-warning {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
}

.override-text {
  margin: 0 0 10px;
}

.override-btn {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.msg-warning ul,
.msg-error ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

#downloads {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#downloads[hidden] {
  display: none;
}

.download-btn {
  display: block;
  text-align: center;
  padding: 14px;
  border-radius: 10px;
  background: #1e7d3c;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.download-btn-secondary {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
}

#print-direct-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.3;
}

