:root {
  color-scheme: light;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  color: #213547;
  background: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.hero {
  padding: 48px 24px 64px;
  color: #fff;
  background: linear-gradient(135deg, #2458a6, #268c9a);
}

.hero h1 {
  max-width: 960px;
  margin: 8px auto;
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.hero p {
  max-width: 960px;
  margin: 8px auto;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  opacity: 0.85;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: -32px auto 48px;
  padding: 0 20px;
}

.panel {
  padding: 24px;
  border: 1px solid #e0e7ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgb(24 58 94 / 9%);
}

h2 {
  margin-top: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

select,
button,
textarea {
  border: 1px solid #c5d2df;
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

select,
textarea {
  padding: 10px;
}

textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.6;
}

.filters label {
  min-width: 140px;
}

.guide,
.note {
  color: #5c6d7d;
}

.study-chat {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e7edf4;
}

.chat-form {
  display: grid;
  gap: 12px;
}

.chat-form button {
  justify-self: start;
}

.chat-answer {
  margin-top: 8px;
}

.chat-answer p {
  margin: 0;
  padding: 16px;
  border-radius: 12px;
  background: #f5f8fb;
  line-height: 1.7;
}

.history-tools {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #e0e7ef;
  border-radius: 14px;
  background: #fbfdff;
}

.history-tools h3,
.report-tools h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.history-tools p,
.report-tools p {
  margin: 0 0 12px;
  color: #5c6d7d;
  font-size: 0.92rem;
}

.report-tools {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #e0e7ef;
  border-radius: 14px;
  background: #fbfdff;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.import-label {
  display: inline-flex;
  align-items: center;
  min-width: auto;
  padding: 10px 16px;
  border: 1px solid #c5d2df;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 400;
}

.import-label input {
  display: none;
}

.subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  padding: 10px 16px;
  cursor: pointer;
  transition: 0.18s ease;
}

button:hover:not(:disabled) {
  border-color: #246da8;
  color: #185d99;
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.status {
  min-height: 28px;
  margin-top: 20px;
  color: #246070;
}

.status.error {
  color: #b42318;
}

.quiz {
  margin-top: 8px;
}

.unit {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 99px;
  color: #175a70;
  background: #e8f7f7;
  font-size: 0.85rem;
  font-weight: 700;
}

.choices {
  display: grid;
  gap: 10px;
}

.choice {
  text-align: left;
}

.choice.correct {
  border-color: #178447;
  color: #126737;
  background: #effbf3;
}

.choice.incorrect {
  border-color: #cc3d32;
  color: #a1251c;
  background: #fff2f1;
}

.result {
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  background: #f5f8fb;
}

.links ul {
  padding-left: 20px;
}

.links li {
  margin: 14px 0;
}

.links li p {
  margin: 4px 0 0;
  color: #5c6d7d;
  font-size: 0.92rem;
  line-height: 1.55;
}

a {
  color: #1765a3;
}

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

  .hero {
    padding-top: 36px;
  }
}
