* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fb;
  color: #1d2738;
}

.hidden {
  display: none !important;
}

.landing-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.landing-panel {
  width: min(860px, 100%);
  text-align: center;
}

.landing-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.landing-subtitle {
  margin: 0 0 2rem;
  color: #5a6d8d;
}

.mode-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.mode-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: 12px;
  background: #2f64e2;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(18, 30, 53, 0.15);
}

.mode-button:hover,
.mode-button:focus-visible {
  background: #2553c2;
}

.app-header {
  width: min(960px, 92%);
  margin: 1rem auto 0;
}

.back-button {
  background: #4a5d7a;
  margin-bottom: 0.75rem;
}

.container {
  width: min(960px, 92%);
  margin: 2rem auto 3rem;
}

h1 {
  margin-bottom: 0.5rem;
}

h2 {
  margin-top: 0;
}

.subtitle {
  margin-top: 0;
  color: #4a5d7a;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(18, 30, 53, 0.1);
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

textarea,
input,
select,
button {
  font: inherit;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid #c9d4e6;
  border-radius: 8px;
  padding: 0.65rem;
}

textarea:focus,
input:focus,
select:focus {
  outline: 2px solid #7ba6ff;
  border-color: #7ba6ff;
}

.help-text {
  margin: 0.45rem 0 0;
  color: #5e6f89;
  font-size: 0.92rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.refresh-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.refresh-actions {
  display: flex;
  align-items: flex-end;
}

.feed-status-error {
  color: #c22626;
}

.keyword-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 0.8rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

button {
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  background: #2f64e2;
  color: #fff;
  cursor: pointer;
}

button[type="reset"] {
  background: #5f6b7e;
}

button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.error-text {
  color: #c22626;
  margin: 0;
  min-height: 1.25rem;
}

.results-card {
  min-height: 140px;
}

.results-list {
  margin: 0;
  padding-left: 1.2rem;
}

.results-list li {
  margin-bottom: 0.7rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-match {
  background: #dff6e6;
  color: #0f6b2f;
}

.status-no-match {
  background: #e9edf6;
  color: #3c4e6b;
}

.status-error {
  background: #ffe6e6;
  color: #9f1d1d;
}

.result-query {
  margin-top: 0.2rem;
  color: #586e8f;
  font-size: 0.9rem;
  word-break: break-word;
}

.result-error-detail {
  color: #a12b2b;
}

@media (max-width: 800px) {
  .mode-buttons {
    grid-template-columns: 1fr;
  }

  .keyword-grid {
    grid-template-columns: 1fr;
  }

  .refresh-grid {
    grid-template-columns: 1fr;
  }
}
