/* 全体のスタイル */
body {
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  color: #333;
  text-align: center;
  margin: 0;
  padding: 20px;
}

h1 {
  color: #4a90e2;
  font-size: 2em;
}

h2 {
  color: #4a90e2;
  font-size: 1.5em;
  margin-top: 30px;
}

.howto {
  max-width: 720px;
  margin: 0 auto 24px;
  text-align: left;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  padding: 16px 20px;
}

.howto h2 {
  margin-top: 0;
  font-size: 1.25em;
}

.howto ol {
  margin: 0 0 12px;
  padding-left: 1.25em;
}

.howto li {
  margin-bottom: 0.5em;
  line-height: 1.45;
}

.howto p {
  margin: 0;
  line-height: 1.45;
  color: #555;
}

.howto a {
  color: #4a90e2;
}

.import-panel {
  max-width: 1200px;
  margin: 0 auto 24px;
  text-align: left;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  padding: 16px 20px;
}

.import-panel h2 {
  margin-top: 0;
  font-size: 1.25em;
}

.import-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas:
    "query-label query-label query-label"
    "query mode search"
    "mode-label mode-label mode-label";
  gap: 8px 12px;
  align-items: center;
}

.import-search-label {
  grid-area: query-label;
  margin: 0;
  font-size: 0.95em;
  color: #555;
}

.import-mode-label {
  display: none;
}

#importQuery {
  grid-area: query;
  width: 100%;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
  box-sizing: border-box;
}

#importQuery:focus,
#importMode:focus {
  border-color: #4a90e2;
  outline: none;
}

#importMode {
  grid-area: mode;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
  background: #fff;
}

#importSearchBtn {
  grid-area: search;
  background-color: #4a90e2;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.05em;
}

#importSearchBtn:hover:not(:disabled) {
  background-color: #357ab7;
}

#importSearchBtn:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 700px) {
  .import-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "query-label"
      "query"
      "mode"
      "search";
  }
}

.import-status {
  margin: 12px 0 0;
  color: #555;
  line-height: 1.4;
  min-height: 1.4em;
}

.import-status.is-error {
  color: #b00020;
}

.import-status.is-ok {
  color: #1b6e3a;
}

.import-matches {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.import-matches li button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  cursor: pointer;
  font-size: 1em;
  color: #333;
}

.import-matches li button:hover {
  border-color: #4a90e2;
  background: #f0f7ff;
}

.import-matches .match-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.85em;
  color: #777;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* フォームのスタイル */
form {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-start;
}

/* Keep each label+input together across columns */
form .field {
  display: flex;
  flex-direction: column;
  width: calc(33.33% - 14px);
  min-width: 200px;
  box-sizing: border-box;
  text-align: left;
}

form .field label {
  display: block;
  margin-bottom: 5px;
  font-size: 1.05em;
  color: #555;
}

form .field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  margin-top: 5px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
}

form .field input:focus {
  border-color: #4a90e2;
  outline: none;
}

form button {
  background-color: #4a90e2;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.1em;
  margin-top: 15px;
  width: 100%;
}

form button:hover {
  background-color: #357ab7;
}

/* キャンバスのスタイル */
canvas {
  margin-top: 12px;
  border: 1px solid #000;
  background-color: #ffffff;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.axis-legend {
  max-width: 500px;
  margin: 8px auto 0;
  font-size: 0.95em;
  color: #555;
  line-height: 1.4;
}

/* 結果の表示 */
#result {
  margin-top: 20px;
  font-size: 1.6em;
  color: red;
  font-weight: bold;
  line-height: 1.4;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

#result .result-desc {
  display: block;
  margin-top: 10px;
  font-size: 0.65em;
  font-weight: normal;
  color: #444;
  line-height: 1.45;
}

.site-footer {
  max-width: 720px;
  margin: 40px auto 10px;
  padding-top: 16px;
  border-top: 1px solid #ddd;
  font-size: 0.9em;
  color: #666;
  line-height: 1.5;
}

.site-footer a {
  color: #4a90e2;
}

@media (max-width: 700px) {
  form .field {
    width: 100%;
    min-width: 0;
  }
}
