:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #d8dde6;
  --text: #1f2937;
  --muted: #667085;
  --accent: #1f5fbf;
  --accent-dark: #174a94;
  --danger-bg: #fff7ed;
  --danger-line: #fed7aa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.app-header {
  padding: 18px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.app-header h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.app-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 16px;
  padding: 16px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.subtext {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.row {
  display: grid;
  grid-template-columns: 115px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.file-row {
  grid-template-columns: 80px 1fr;
}

label {
  font-size: 14px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

button,
.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

button:hover,
.file-label:hover {
  border-color: var(--accent);
}

button.primary {
  width: 100%;
  margin-top: 10px;
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

button.primary:hover {
  background: var(--accent-dark);
}

.file-label input {
  display: none;
}

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

.button-grid.two {
  grid-template-columns: 1fr 1fr;
}

.status-box {
  padding: 10px;
  border-radius: 8px;
  background: #eef4ff;
  border: 1px solid #c7d7fe;
  font-size: 14px;
}

.warning {
  background: var(--danger-bg);
  border-color: var(--danger-line);
}

.warning p {
  margin: 8px 0 0;
  line-height: 1.55;
  font-size: 13px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.canvas-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
}

#footCanvas {
  display: block;
  max-width: 100%;
  background: #fafafa;
  border: 1px dashed #b8c0cc;
  border-radius: 8px;
}

.log-area {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.log-area h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

#logText {
  margin: 0;
  min-height: 110px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

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