* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  background: #f4f5f7;
  color: #222;
  line-height: 1.5;
}

header {
  background: #1a2540;
  color: #fff;
  padding: 18px 24px;
}
header h1 { margin: 0; font-size: 20px; }
header .sub { margin: 4px 0 0; font-size: 12px; opacity: 0.7; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #d8dbe1;
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab {
  appearance: none;
  background: transparent;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab[aria-current="true"] {
  color: #1a2540;
  border-bottom-color: #1a2540;
  font-weight: 600;
}

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.panel[hidden] { display: none; }
@media (max-width: 740px) {
  .panel { grid-template-columns: 1fr; }
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}

label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #555;
  gap: 4px;
}
input[type="text"], input[type="date"] {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #cdd2dc;
  border-radius: 8px;
  background: #fafbfc;
}
input:focus { outline: 2px solid #4a6cf7; outline-offset: 0; border-color: #4a6cf7; background: #fff; }

.actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}
button[type=submit] {
  appearance: none;
  background: #1a2540;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
button[type=submit]:disabled { opacity: 0.5; cursor: progress; }
.download {
  font-size: 13px;
  color: #4a6cf7;
  text-decoration: none;
  border: 1px solid #4a6cf7;
  padding: 9px 16px;
  border-radius: 8px;
}
.download:hover { background: #eef2ff; }

.preview {
  background: #f4f5f7;
  border: 1px dashed #cdd2dc;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
}
.preview .placeholder {
  color: #888;
  font-size: 13px;
  text-align: center;
}
.preview img.result {
  max-width: 100%;
  max-height: 720px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
