:root {
  --bg: #131118;
  --panel: #17151b;
  --panel-2: #1b181f;
  --line: #302d34;
  --line-soft: rgba(255,255,255,.08);
  --text: #f5f3ee;
  --muted: #aaa8ad;
  --dim: #77747c;
  --champagne: #c9a660;
  --champagne-deep: #a98a4c;
  --champagne-soft: rgba(201,166,96,.12);
  --danger: #d88d8d;
  --warning: #e0bc72;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(201,166,96,.2), transparent 65%),
    linear-gradient(180deg, #0d0b10, var(--bg) 45%, #100e14);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
.top-accent {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  z-index: 4;
  background: linear-gradient(90deg, transparent, var(--champagne) 25%, var(--champagne) 75%, transparent);
  opacity: .65;
}
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 36px; }
.page-head { text-align: center; position: relative; padding: 8px 0 30px; }
.back-link {
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: .04em;
}
.back-link:hover { color: var(--champagne); }
.logo { width: min(280px, 72vw); display: block; margin: 0 auto 14px; }
.kicker, .eyebrow {
  color: var(--champagne);
  text-transform: uppercase;
  letter-spacing: .24em;
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 8px;
}
h1, h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; }
h1 { margin: 0; font-size: clamp(38px, 6vw, 58px); line-height: 1; }
.lead { max-width: 680px; margin: 12px auto 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
.search-panel, .history-panel, .company-card, .financial-panel {
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(29,26,33,.98), rgba(21,19,25,.98));
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.search-panel { padding: 28px; display: grid; grid-template-columns: minmax(220px, .8fr) minmax(420px, 1.2fr); gap: 36px; align-items: end; }
.search-panel h2, .section-heading h2 { margin: 0; font-size: 27px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.search-row { display: flex; gap: 10px; }
input {
  min-width: 0;
  flex: 1;
  border: 1px solid #46414b;
  border-radius: 4px;
  background: #121016;
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
  font-size: 16px;
}
input:focus { outline: 2px solid rgba(201,166,96,.25); border-color: var(--champagne); }
button, .official-link {
  border-radius: 4px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}
#submitButton {
  border: 0;
  padding: 0 20px;
  color: #15110b;
  background: linear-gradient(180deg, var(--champagne), var(--champagne-deep));
}
button:disabled { opacity: .55; cursor: wait; }
.field-help, .message { min-height: 18px; margin: 7px 0 0; font-size: 12px; color: var(--dim); }
.message.error { color: var(--danger); }
.history-panel { margin-top: 18px; padding: 22px 24px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading.compact { margin-bottom: 14px; }
.text-button { border: 0; background: none; padding: 5px; color: var(--muted); }
.text-button:hover { color: var(--text); }
.text-button.danger:hover { color: var(--danger); }
.history-list { display: flex; gap: 9px; flex-wrap: wrap; }
.history-item {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #141218;
  border-radius: 4px;
  overflow: hidden;
}
.history-open, .history-delete { border: 0; background: transparent; color: var(--text); padding: 9px 11px; }
.history-open { font-weight: 600; }
.history-open span { color: var(--dim); font-weight: 400; margin-left: 5px; }
.history-delete { color: var(--dim); border-left: 1px solid var(--line); }
.history-delete:hover { color: var(--danger); }
.result { margin-top: 22px; }
.notice { border: 1px solid; padding: 12px 15px; margin-bottom: 14px; font-size: 13px; line-height: 1.5; }
.notice.warning { color: var(--warning); border-color: rgba(224,188,114,.38); background: rgba(224,188,114,.08); }
.company-card { padding: 28px; }
.company-title-row { display: flex; justify-content: space-between; gap: 22px; align-items: start; }
.company-title-row h2 { font-size: clamp(30px, 5vw, 43px); line-height: 1.05; margin: 0; }
.company-cui { color: var(--muted); margin: 8px 0 0; }
.result-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.official-link, .secondary-button { padding: 10px 12px; font-size: 12px; text-decoration: none; }
.official-link { color: var(--champagne); border: 1px solid rgba(201,166,96,.45); }
.secondary-button { color: var(--text); background: #211e25; border: 1px solid #48434c; }
.identity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 28px 0 0; border: 1px solid var(--line); }
.identity-item { min-width: 0; padding: 15px 17px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.identity-item:nth-child(3n) { border-right: 0; }
.identity-item dt { color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 6px; }
.identity-item dd { margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.financial-panel { padding: 28px; margin-top: 18px; }
.unit { margin: 0; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.year-tools { display: flex; align-items: end; gap: 10px; }
.year-tools label { margin: 0 2px 7px 0; }
.year-tools select {
  min-width: 108px;
  border: 1px solid #46414b;
  border-radius: 4px;
  background: #121016;
  color: var(--text);
  padding: 9px 30px 9px 11px;
  font: inherit;
}
.year-tools .unit { margin: 0 0 10px 6px; }
.statement-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: #151319;
}
.statement-meta strong { color: var(--champagne); }
.statement-meta span { color: var(--muted); font-size: 12px; }
.statement-table { border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.statement-section {
  padding: 9px 14px;
  color: var(--champagne);
  background: rgba(201,166,96,.1);
  border-bottom: 1px solid rgba(201,166,96,.3);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 10px;
  font-weight: 700;
}
.statement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 220px);
  border-bottom: 1px solid var(--line);
}
.statement-row:last-child { border-bottom: 0; }
.statement-row > span { padding: 11px 14px; font-size: 13px; line-height: 1.35; }
.statement-row .statement-value {
  border-left: 1px solid var(--line);
  text-align: right;
  font-weight: 600;
}
.statement-row.group-label { background: #19171d; }
.statement-row.group-label > span:first-child { font-weight: 700; }
.statement-row.indented > span:first-child { padding-left: 30px; color: var(--muted); }
.statement-value.negative { color: #df9a9a; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 720px; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:last-child, td:last-child { border-right: 0; }
thead th { color: var(--champagne); background: #151319; font-size: 12px; position: sticky; top: 0; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; z-index: 1; background: #18161c; min-width: 255px; }
thead th:first-child { z-index: 2; background: #151319; }
tbody td { font-size: 13px; }
tbody tr:hover td { background-color: #1d1a21; }
td.negative { color: #df9a9a; }
.empty-state { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed #48434c; }
footer { display: flex; justify-content: space-between; gap: 20px; color: var(--dim); font-size: 11px; margin-top: 24px; padding: 14px 2px; border-top: 1px solid var(--line-soft); }
:focus-visible { outline: 2px solid var(--champagne); outline-offset: 2px; }
@media (max-width: 820px) {
  .search-panel { grid-template-columns: 1fr; gap: 20px; }
  .identity-grid { grid-template-columns: repeat(2, 1fr); }
  .identity-item:nth-child(3n) { border-right: 1px solid var(--line); }
  .identity-item:nth-child(2n) { border-right: 0; }
  .company-title-row { flex-direction: column; }
  .result-actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1180px); padding-top: 18px; }
  .page-head { padding-top: 42px; }
  .back-link { top: 3px; }
  .search-panel, .company-card, .financial-panel { padding: 20px 16px; }
  .search-row { flex-direction: column; }
  #submitButton { padding: 13px; }
  .identity-grid { grid-template-columns: 1fr; }
  .identity-item, .identity-item:nth-child(2n), .identity-item:nth-child(3n) { border-right: 0; }
  .section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .year-tools { width: 100%; flex-wrap: wrap; }
  .year-tools .unit { margin-left: auto; }
  .statement-meta { flex-direction: column; gap: 5px; }
  .statement-row { grid-template-columns: minmax(0, 1fr) minmax(92px, 34%); }
  .statement-row > span { padding: 10px; font-size: 12px; }
  .statement-row.indented > span:first-child { padding-left: 20px; }
  footer { flex-direction: column; }
}
