:root {
  color-scheme: light;
  --text: #132d35;
  --muted: #52686d;
  --line: #d7e3e3;
  --canvas: #edf4f3;
  --paper: #fff;
  --tint: #e8f4f0;
  --accent: #096552;
  --accent-dark: #064b40;
  --deep: #102b33;
  --focus: #137b68;
  --radius: 16px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box }
body { margin: 0; background: var(--canvas); color: var(--text); line-height: 1.55 }
main { width: min(100% - 2rem, 76rem); margin: 1.5rem auto 0; padding-bottom: 4rem }
[hidden] { display: none !important }
.masthead {
  display: flex; align-items: center; min-height: 115px; padding: 1.45rem clamp(1.15rem, 4vw, 2.4rem);
  border-radius: 22px; background: linear-gradient(110deg, #102b33, #124940); color: #fff;
}
.brand { display: flex; gap: 1rem; align-items: center }
.brand-mark {
  width: 48px; height: 48px; border: 1px solid #65af99; border-radius: 13px;
  display: grid; place-items: center; background: #d6f4e3;
}
.brand-mark span {
  width: 19px; height: 23px; border: 2px solid #0e594a; border-radius: 4px; position: relative;
}
.brand-mark span::after {
  content: ""; position: absolute; width: 9px; height: 5px; inset: 5px 3px auto;
  border-bottom: 2px solid #0e594a; border-left: 2px solid #0e594a; transform: rotate(-45deg);
}
h1,h2,h3 { margin: 0; line-height: 1.2; letter-spacing: -.025em }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 750 }
h2 { font-size: clamp(1.35rem, 3.2vw, 2rem) }
h3 { font-size: 1.1rem }
.brand p { margin: .25rem 0 0; color: #bce0d4; font-size: .96rem }
.work-tabs {
  display: flex; align-items: center; gap: .35rem; padding: .38rem;
  margin: 1.15rem 0; border: 1px solid var(--line); background: var(--paper);
  border-radius: 14px; overflow: auto; scrollbar-width: thin;
}
.work-tabs button { border-color: transparent; background: transparent; flex: 0 0 auto; white-space: nowrap; padding: .56rem .9rem }
.work-tabs button[data-tab=imports] { margin-left: auto }
.work-tabs button[aria-pressed=true] { color: #fff; background: var(--accent) }
.surface,.card,.result,.empty-state,.result-list {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
}
.surface,.card { padding: clamp(1.15rem, 3vw, 2rem); box-shadow: 0 4px 14px #072f2908 }
.surface h2 { margin-bottom: 1.1rem }
.panel-note { color: var(--muted); margin: .9rem 0 0; font-size: .94rem }
button,select,input,textarea {
  font: inherit; border: 1px solid #becfce; border-radius: 9px; background: white; color: var(--text);
  min-height: 43px; padding: .55rem .78rem;
}
button { cursor: pointer; font-weight: 650 }
button:hover:not(:disabled) { background: var(--tint) }
button.primary { background: var(--accent); color: white; border-color: var(--accent); padding-inline: 1.05rem }
button.primary:hover:not(:disabled),.work-tabs button[aria-pressed=true]:hover:not(:disabled) { background: var(--accent-dark) }
button:disabled { opacity: .55; cursor: default }
a { color: var(--accent-dark); text-underline-offset: .15em; overflow-wrap: anywhere }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px }
label { display: grid; gap: .35rem; font-size: .94rem; font-weight: 650 }
input:not([type=checkbox]),textarea { min-width: 0; width: 100% }
textarea { resize: vertical }
input[type=checkbox] { inline-size: 18px; block-size: 18px; min-height: 0; accent-color: var(--accent) }
select {
  appearance: none; padding-right: 2.15rem;
  background: linear-gradient(45deg,transparent 50%,#3b5f59 50%) right 19px center/5px 5px no-repeat,
              linear-gradient(135deg,#3b5f59 50%,transparent 50%) right 14px center/5px 5px no-repeat, white;
}
.row { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap }
.actions { margin: 1rem 0 }
.search-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(10rem, 15rem) auto; gap: .65rem; align-items: center; margin-top: .45rem }
.search-fields.compact { grid-template-columns: minmax(0, 30rem) auto; max-width: 45rem }
.filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(13rem,1fr)); gap: .78rem; margin-bottom: 1rem }
.check { display: flex; align-items: center; font-weight: 550; gap: .4rem; align-self: center }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.filter-panel { border-top: 1px solid var(--line); margin-top: .7rem }
.filter-panel summary { color: var(--accent-dark); min-height: 40px; padding: .45rem 0 }
summary { cursor: pointer; font-weight: 680; margin: .35rem 0 }
#status { color: var(--muted); margin: .75rem 0 }
#status:empty { display: none }
#results { margin-top: 1.1rem; min-width: 0 }
.result-toolbar,.section-title,.result-list-heading {
  display: flex; align-items: center; justify-content: space-between; gap: .7rem; flex-wrap: wrap;
}
.section-title h2 { margin-bottom: 0 }
.result-toolbar { margin-bottom: .8rem }
.result-toolbar p { margin: .25rem 0; color: var(--muted) }
.result-list { overflow: hidden }
.result-list-heading { padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: #f7fbfa; color: var(--muted); font-size: .83rem; font-weight: 720 }
.result {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center;
  padding: .95rem 1rem; border: 0; border-radius: 0; min-height: 78px;
}
.result + .result { border-top: 1px solid var(--line) }
.result:hover { background: #f8fcfb }
.result strong,.result p { overflow-wrap: anywhere }
.result p { margin: .22rem 0; color: var(--muted); font-size: .9rem }
.result-name { border: 0; min-height: 0; border-radius: 5px; color: var(--accent-dark); background: transparent; text-align: left; padding: .1rem .15rem; margin-left: -.15rem }
.tag { display: inline-block; font-size: .82rem; padding: .14rem .5rem; border-radius: .35rem; background: var(--tint); color: #1d5b4f }
.tag[data-state=pending] { background: #fff1d2; color: #744f17 }
.tag[data-state=unavailable] { background: #f0eeea; color: #58554e }
.empty-state { padding: 1.4rem; color: var(--muted) }
.facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(13rem,1fr)); padding: .9rem; gap: .7rem; border: 1px solid var(--line); border-radius: 12px; background: #f7fbfa; margin: .9rem 0 }
.facts p { margin: 0; overflow-wrap: anywhere }
.facts b { display: block; color: var(--muted); font-size: .82rem }
.action-link { font-weight: 650 }
.report { overflow: auto }
.report table { border-collapse: collapse; min-width: 100%; text-align: left }
.report th,.report td { padding: .5rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; min-width: 8rem }
.report th { color: var(--muted) }
.tabs-sub { gap: .4rem }
.tabs-sub button { min-height: 38px; font-size: .875rem; padding: .33rem .65rem }
.tabs-sub button[aria-pressed=true] { border-color: var(--accent); background: var(--tint); color: var(--accent-dark) }
.section-area { padding: 1rem; border: 1px solid var(--line); background: #f7fbfa; border-radius: 11px }
.section-area h3 { margin: 0 0 .65rem }
.note { margin: .75rem 0 }
.record-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 16rem),1fr)); gap: .5rem }
.record-grid > div { background: var(--paper); border: 1px solid var(--line); padding: .55rem; border-radius: .5rem }
.search-message { color: var(--muted) }
.import-meter { margin: .75rem 0; font-weight: 650; color: var(--accent-dark) }
@media (max-width: 710px) {
  main { width: calc(100% - 1.15rem); margin-top: .6rem }
  .work-tabs button[data-tab=imports] { margin-left: 0 }
  .search-fields { grid-template-columns: 1fr auto }
  .search-fields > input { grid-column: 1 / -1 }
  .search-fields.compact { grid-template-columns: 1fr }
  .result { gap: .55rem; padding: .8rem; grid-template-columns: 1fr }
}
@media print {
  body { background: white }
  main { width: auto; padding: 0; margin: 0 }
  .masthead,nav,main>section,#status,button,.action-link,.note,.tabs-sub { display: none !important }
  .card,.result { border: 0; box-shadow: none }
  .report { overflow: visible }
}
:root {
  --text: #27213d; --muted: #675f79; --line: #e4dcef; --canvas: #f3eff8;
  --tint: #f1e8fa; --accent: #6d44a8; --accent-dark: #4c277c; --deep: #2b2043; --focus: #8052ba;
}
.masthead { background: linear-gradient(110deg, #33234d, #5b3e78 70%, #714c8f); }
.brand-mark { background: #e9daf5; border-color: #bca3d3; }
.brand-mark span,.brand-mark span::after { border-color: #60398b; }
.brand p { color: #e8d9f4; }
.surface,.card { box-shadow: 0 4px 14px #3924540a; }
button,select,input,textarea { border-color: #d7cce3; }
select {
  background: linear-gradient(45deg,transparent 50%,#654a7c 50%) right 19px center/5px 5px no-repeat,
              linear-gradient(135deg,#654a7c 50%,transparent 50%) right 14px center/5px 5px no-repeat, white;
}
.result-list-heading,.facts,.section-area { background: #faf7fd; }
.result:hover { background: #fbf8fe; }
.tag { color: #553480; }
.company-identity { display: flex; align-items: flex-start; gap: .9rem; }
.company-symbol {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 760; font-size: 1.15rem; background: #e9ddf5; color: #5a3780;
}
.company-identity .tag { margin-top: .45rem; }
.company-full-name { margin: .25rem 0 0; color: var(--muted); font-size: .94rem; }
.detail-card { overflow: visible; }
.card-layout { display: grid; grid-template-columns: minmax(12rem,15.5rem) minmax(0,1fr); gap: 1rem; margin-top: 1.2rem; align-items: start; }
.card-nav { position: sticky; top: .7rem; display: grid; gap: .17rem; border: 1px solid var(--line); padding: .5rem; border-radius: 12px; }
.card-nav button { text-align: left; min-height: 34px; padding: .35rem .55rem; border: 0; font-size: .91rem; }
.card-nav button[aria-pressed=true] { color: var(--accent-dark); background: var(--tint); }
.card-nav-title { margin: .25rem .55rem .35rem; font-size: .77rem; color: var(--muted); font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.card-jump { display: none; }
.card-body { min-width: 0; }
.card-body .section-area { min-width: 0; overflow-x: auto; }
.overview-status { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .85rem; }
.overview-status .tag[data-state=warning] { background: #fff1dc; color: #774a13; }
.overview-links { display: flex; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 790px) {
  .card-layout { display: block; }
  .card-nav { display: none; }
  .card-jump { display: grid; margin: .9rem 0; }
}
@media (max-width: 710px) {
  .work-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .23rem; overflow: visible; }
  .work-tabs button { white-space: normal; font-size: .82rem; padding: .4rem; line-height: 1.22; text-align: center; }
}
@media (max-width: 380px) { .work-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media print { .card-layout { display: block; } .card-nav,.card-jump { display: none!important; } }
.masthead { justify-content: space-between; gap: .75rem; flex-wrap: wrap }
.account-bar { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap }
.account-bar button { min-height: 36px; border-color: #b7a3ce; background: #e8dbf5; color: #38224f }
.auth-panel { width: min(100%, 30rem); margin: 2rem auto; }
.auth-switch { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.15rem }
.auth-switch button[aria-pressed=true] { background: var(--tint); color: var(--accent-dark); border-color: var(--focus) }
#auth-form { display: grid; gap: .75rem }
#auth-form #auth-submit { justify-self: start }
#auth-status { margin: 0; color: var(--muted) }
#auth-status:empty { display: none }
#accounts-panel { margin-top: 1rem }
body.company-open #workspace > .surface { display: none; }
body.company-open .masthead { min-height: 74px; padding-block: .8rem; }
body.company-open .masthead h1 { font-size: clamp(1.5rem,3vw,2rem); }
body.company-open .masthead .brand-mark { width: 40px; height: 40px; border-radius: 11px; }
body.company-open .masthead .brand p { display: none; }
body.company-open .work-tabs { margin-block: .85rem; }
.card-breadcrumb { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .7rem; color: var(--muted); font-size: .88rem; }
.card-breadcrumb .back-button { min-height: 34px; padding: .22rem .65rem; background: var(--paper); color: var(--accent-dark); }
.facts-summary { grid-template-columns: repeat(auto-fit,minmax(min(100%,12rem),1fr)); }
.fact-wide { grid-column: span 2; }
.fact-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem; }
.copy-value { min-height: 0; border: 0; background: transparent; padding: .05rem .25rem; font-size: .8rem; color: var(--accent-dark); text-decoration: underline; text-underline-offset: .15em; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap: .7rem; margin-bottom: .9rem; }
.overview-box { background: white; border: 1px solid var(--line); border-radius: 11px; padding: .8rem; min-width: 0; }
.overview-box h4 { margin: 0 0 .45rem; line-height: 1.25; }
.overview-line { display: grid; gap: .05rem; margin-bottom: .42rem; overflow-wrap: anywhere; }
.overview-line span { color: var(--muted); font-size: .82rem; }
.overview-box .overview-action { color: var(--accent-dark); background: transparent; border: 0; padding: .15rem 0; font-size: .88rem; min-height: 0; }
.overview-links button { min-height: 36px; font-size: .87rem; }
@media (max-width: 560px) { .fact-wide { grid-column: auto; } }
@media print { .card-breadcrumb { display: none; } }
