@import url("https://fonts.googleapis.com/css2?family=Merriweather:wght@700;900&family=Noto+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #251d18;
  --text: #2d241e;
  --muted: #5f554d;
  --line: #d8c0a4;
  --panel: #fffaf1;
  --card: #fffdf8;
  --accent: #b53726;
  --accent-2: #0f6d5a;
  --accent-3: #c57f1f;
  --danger: #9f1d2f;
  --shadow: 0 18px 42px rgba(74, 48, 25, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, #f9e2bc 0, transparent 36%),
    radial-gradient(circle at 86% 74%, #efcf9f 0, transparent 30%),
    linear-gradient(135deg, #f7e8cd, #f1ddbe 44%, #f8efe0);
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(90, 62, 38, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 62, 38, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at center, black 20%, transparent 84%);
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1440px, 96vw);
  margin: 16px auto;
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 14px;
}

.glass {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 251, 243, 0.92)),
    var(--panel);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.sidebar {
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 800;
}

.brand h1 {
  margin: 8px 0;
  color: var(--ink);
  font-family: "Merriweather", serif;
  font-size: clamp(1.7rem, 1.1rem + 1.5vw, 2.2rem);
  line-height: 1.2;
}

.brand p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.auth-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--card);
  display: grid;
  gap: 10px;
}

.auth-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-head h3 {
  margin: 0;
  font-size: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #d5b898;
  background: #fff2df;
  color: #8f4d1a;
  font-size: 0.8rem;
  font-weight: 800;
}

.muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-grid {
  display: grid;
  gap: 8px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.line-btn {
  width: 100%;
  border: 1px solid #cca67b;
  background: #fff;
  color: #7f4210;
}

.folder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.folder-head p {
  margin: 0;
  font-weight: 800;
  color: #3a3029;
}

.profile-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.profile-list button {
  width: 100%;
  text-align: left;
  border: 1px solid #d1b08c;
  background: #fffcf7;
  color: #211913;
  font-weight: 800;
  border-radius: 12px;
  padding: 10px 11px;
  transition: all 0.16s ease;
}

.profile-list button:hover {
  border-color: #b97233;
  transform: translateX(1px);
}

.profile-list button.active {
  border-color: var(--accent);
  background: linear-gradient(120deg, #fff4ec, #fde8df);
  color: #7b1d13;
}

.main {
  display: grid;
  align-content: start;
  gap: 12px;
}

.topbar {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.topbar h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-family: "Merriweather", serif;
  font-size: clamp(1.8rem, 1.35rem + 1vw, 2.3rem);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-btn {
  border: 1px solid #ccb08f;
  background: #fff;
  color: #352c25;
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 0.93rem;
  font-weight: 800;
}

.tab-btn.active {
  border-color: #1e1814;
  background: linear-gradient(120deg, #352c24, #1f1914);
  color: #fff;
}

.panel {
  display: none;
  padding: 16px;
}

.panel.active {
  display: block;
  animation: rise 220ms ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: "Merriweather", serif;
  font-size: 1.55rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-grid label {
  display: grid;
  gap: 6px;
}

.form-grid span {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

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

input,
select,
textarea {
  border: 1px solid #d3b795;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  line-height: 1.55;
  background: #fffdf9;
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 11px;
  padding: 11px 14px;
  background: linear-gradient(102deg, #b6312f, #cf6430);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button.ghost {
  border: 1px solid #ddc3c3;
  background: #fff;
  color: var(--danger);
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analysis-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.card {
  border: 1px solid #d3b996;
  border-radius: 13px;
  background: #fff;
  padding: 12px;
}

.card.wide {
  grid-column: 1 / -1;
}

.card h4 {
  margin: 0 0 9px;
  color: var(--accent-2);
  font-family: "Merriweather", serif;
  font-size: 1.17rem;
}

.card p,
.card li {
  line-height: 1.68;
}

.plain-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.qa-form {
  display: grid;
  gap: 10px;
}

.qa-search-shell {
  border: 1px solid #b48d64;
  border-radius: 16px;
  padding: 14px;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 238, 201, 0.45), transparent 40%),
    linear-gradient(130deg, rgba(255, 250, 238, 0.98), rgba(253, 242, 224, 0.95));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 12px 28px rgba(106, 68, 29, 0.12);
}

.qa-field-label {
  color: #7d4c21;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 800;
}

#question-input {
  border-radius: 12px;
  border: 1px solid #c8a884;
  min-height: 115px;
  font-size: 1.03rem;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #534943;
  font-weight: 600;
}

.qa-form button[type="submit"] {
  width: 100%;
  border: 1px solid #a85d1d;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(110deg, #b73924, #c77e1e);
  box-shadow: 0 8px 22px rgba(156, 83, 19, 0.24);
}

.qa-history {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.qa-item {
  border: 1px solid #d0b18b;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.qa-item h4 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 1.4rem;
  font-family: "Merriweather", serif;
}

.qa-item p,
.qa-item li,
.qa-item td,
.qa-item th {
  line-height: 1.72;
}

.qa-item strong {
  color: #6f250f;
}

.answer-box {
  border-left: 4px solid #d49a57;
  border-radius: 11px;
  background: #fff9ef;
  padding: 12px;
  margin-bottom: 10px;
}

.answer-box > strong {
  display: inline-block;
  font-size: 1.16rem;
  margin-bottom: 4px;
}

.report-grid {
  display: grid;
  gap: 10px;
}

.report-grid article h5,
.feng-box h5 {
  margin: 2px 0 6px;
  color: #3e3329;
  font-family: "Merriweather", serif;
  font-size: 1.15rem;
}

.mini-title {
  margin: 4px 0;
  color: #7d4f27;
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid #e1cdb4;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8ecdb;
  color: #3e3125;
}

.feng-box {
  border: 1px solid #d3b693;
  border-radius: 12px;
  padding: 10px;
  background: #fffcf5;
}

.warn-list li {
  color: #6e2f1e;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row .chip {
  border-color: #bfd0ed;
  background: #f3f8ff;
  color: #214681;
}

.source-list {
  margin: 6px 0 0;
  padding-left: 20px;
  color: #544941;
}

.calendar-list {
  display: grid;
  gap: 10px;
}

.event-item {
  border: 1px solid #d2b895;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.event-item h4 {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-family: "Merriweather", serif;
}

.event-item a {
  color: var(--accent);
  font-weight: 800;
}

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

@media (max-width: 760px) {
  html {
    font-size: 16px;
  }
  .form-grid,
  .analysis-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
