:root {
  --background: #f6f1e8;
  --surface: #fffaf2;
  --surface-alt: #f0e6d8;
  --border: #d9ccba;
  --text: #1e1a16;
  --muted: #6c6154;
  --accent: #a7662f;
  --shadow: 0 18px 36px rgba(30, 26, 22, 0.08);
  --font-display: "Iowan Old Style", Georgia, serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  padding: 20px;
}

a {
  color: var(--accent);
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.panel {
  background: rgba(255, 250, 242, 0.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.hero h1,
.toolbar-title,
.company-title {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.hero h1 {
  margin-top: 8px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 0.98;
}

.hero p {
  margin: 0;
}

.hero-copy {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.75;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.toolbar {
  display: grid;
  gap: 16px;
}

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

.filter-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(217, 204, 186, 0.9);
  background: rgba(255, 255, 255, 0.38);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.filter-select {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(217, 204, 186, 0.95);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 44px 14px 16px;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.filter-select:hover,
.filter-select:focus-visible {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(167, 102, 47, 0.08);
  outline: none;
}

.filter-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.02em;
}

.result-summary {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(217, 204, 186, 0.95);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  cursor: pointer;
}

.toggle-input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.toggle-label {
  font-size: 14px;
  font-weight: 600;
}

.toolbar-title {
  font-size: 28px;
}

.toolbar-copy {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.date-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.date-button:hover,
.date-button:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

.date-button.active {
  background: var(--surface-alt);
  border-color: var(--accent);
}

.company-list {
  display: grid;
  gap: 18px;
}

.group-section {
  display: grid;
  gap: 12px;
}

.group-header {
  display: grid;
  gap: 4px;
  padding: 4px 2px;
}

.group-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: -0.03em;
}

.group-copy {
  margin: 0;
  color: var(--muted);
}

.group-company-list {
  display: grid;
  gap: 14px;
}

.company-card {
  background: rgba(255, 250, 242, 0.95);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.company-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.company-meta {
  display: grid;
  gap: 4px;
}

.company-title {
  font-size: 30px;
  line-height: 1;
}

.type-line {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ticker-line {
  color: var(--muted);
  font-size: 14px;
}

.market-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(167, 102, 47, 0.25);
  background: rgba(167, 102, 47, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.industry-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(30, 26, 22, 0.1);
  background: rgba(30, 26, 22, 0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--accent);
  font-weight: 700;
}

.lead {
  margin: 14px 0 0;
  line-height: 1.8;
}

.section-block {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.summary-hero {
  margin-top: 18px;
  display: grid;
  gap: 8px;
  padding: 14px 0 4px;
}

.company-summary {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.72;
  font-weight: 600;
  letter-spacing: 0;
}

.company-summary-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.company-summary-item {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 600;
}

.section-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary-list,
.attachment-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.summary-item,
.attachment-item {
  line-height: 1.75;
}

.detail-section .summary-item,
.detail-section .attachment-item,
.detail-section .market-note,
.detail-section .lead {
  font-size: 14px;
  line-height: 1.72;
}

.market-note {
  margin: 0;
  color: var(--muted);
}

.attachment-item a {
  font-weight: 600;
  text-decoration: none;
}

.attachment-meta {
  color: var(--muted);
  font-size: 13px;
  margin-left: 8px;
}

.attachment-item h3 {
  margin: 0;
  font-size: 16px;
}

.attachment-list {
  padding-left: 0;
  list-style: none;
}

.attachment-list.compact {
  gap: 6px;
}

.detail-section {
  gap: 8px;
}

.loading,
.empty {
  text-align: center;
  color: var(--muted);
}

@media (max-width: 720px) {
  body {
    padding: 14px;
  }

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

  .toggle-row {
    width: 100%;
    justify-content: flex-start;
  }

  .panel,
  .company-card {
    padding: 18px;
  }

  .company-summary {
    font-size: 16px;
  }

  .company-header,
  .attachment-item {
    flex-direction: column;
  }

  .rank-pill {
    width: fit-content;
  }
}
