:root {
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #11233e;
  background: #f4f7fb;
  --blue: #1858e8;
  --deep: #1545a6;
  --muted: #546681;
  --line: #e3eaf3;
  --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 2px solid #1a5be6; outline-offset: 3px; }
button, input, h1, h2, p, dl, dd { margin: 0; }
button { border: 0; }
.icon { width: 20px; height: 20px; flex: 0 0 20px; display: inline-flex; }
.icon svg { width: 100%; height: 100%; }
#app { max-width: 640px; margin: 0 auto; min-height: 100dvh; }
.masthead, .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: calc(62px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 18px 0;
  border-bottom: 1px solid var(--line);
  background: #f7faff;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 750; letter-spacing: .02em; }
.logo { width: 32px; height: 32px; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 650; color: #516783; background: #eaf0f8; white-space: nowrap; }
.pill.connected { color: #0d6e56; background: #e4f6f0; }
.topbar { display: grid; grid-template-columns: 54px minmax(0, 1fr) 54px; }
.topbar h1 { font-size: 17px; text-align: center; }
.topbar .pill { justify-self: end; }
.back { width: 44px; min-height: 44px; display: grid; place-items: center; background: transparent; border-radius: 12px; margin-left: -9px; }
.content { padding: 16px 16px calc(26px + env(safe-area-inset-bottom)); }
.hero { padding: 27px 16px 18px; border-radius: 21px; background: linear-gradient(144deg,#e4edff,#f7faff); border: 1px solid #dce7fb; }
.kicker { color: var(--deep); font-size: 12px; font-weight: 750; letter-spacing: .12em; margin-bottom: 6px; }
.hero h1 { font-size: clamp(27px, 7vw, 36px); letter-spacing: -.035em; line-height: 1.2; }
.lead { color: var(--muted); font-size: 13px; margin-top: 10px; margin-bottom: 22px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--white); padding: 5px 5px 5px 11px; border: 1px solid #cbdaf3; border-radius: 13px; }
.search .icon { color: var(--deep); }
.search input { width: 100%; min-width: 0; border: 0; background: transparent; color: inherit; min-height: 42px; outline-offset: 0; }
.search input::placeholder { font-size: 13px; color: #5a6b86; }
.primary { color: white; background: var(--blue); padding: 0 12px; min-height: 44px; white-space: nowrap; border-radius: 9px; font-size: 13px; font-weight: 700; }
.primary:disabled { opacity: .65; }
.search-wrap, .import-form { display: grid; gap: 9px; }
.source-picker { width: fit-content; max-width: 100%; min-height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: white; color: inherit; font: inherit; }
.source-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 15px; }
.official-link { color: var(--blue); }
.import-form { margin-top: 15px; }
.import-form label { display: grid; gap: 4px; font-size: 13px; }
.import-form input, .import-form textarea { width: 100%; min-height: 42px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.import-form textarea { min-height: 88px; }
.home-section, .results .section-heading { margin-top: 23px; }
h2 { font-size: 16px; font-weight: 750; }
.home-section h2, .section-heading { margin-bottom: 10px; }
.sample, .result, .graph-link {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px; border-radius: 15px; background: var(--white); border: 1px solid var(--line);
}
.sample-text, .result-name, .share-label { flex: 1; min-width: 0; }
.sample-text strong, .result-name strong, .share-label strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.sample-text small, .result-name small, .share-label small { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; }
.sample > .icon, .result > .icon { color: #526987; }
.saved-link { margin-bottom: 8px; }
.tile { display: inline-grid; width: 41px; height: 41px; flex: 0 0 41px; place-items: center; border-radius: 12px; }
.blue { color: var(--deep); background: #e9f0ff; }
.green { color: #0f755e; background: #e6f7f1; }
.white { color: #fff; background: #ffffff29; }
.note { margin: 15px 1px 0; color: var(--muted); font-size: 12px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.muted { color: var(--muted); font-size: 12px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 15px; }
.analysis { margin-top: 18px; padding: 16px; }
.analysis .note { margin: 6px 0 12px; }
.analysis button:disabled { opacity: .65; }
.analysis-result { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.results .result + .result { margin-top: 8px; }
.summary { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 15px; }
.summary .company-title { flex: 1; min-width: 0; }
.company-title h2 { font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
.company-title .pill { margin-top: 6px; }
.metrics { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 9px; flex: 1 1 100%; margin-top: 6px; padding-top: 13px; border-top: 1px solid var(--line); }
.metrics dt, .fields dt { color: var(--muted); font-size: 12px; }
.metrics dd, .fields dd { margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.metrics dd { font-weight: 720; }
.graph-link { margin: 12px 0; color: white; background: linear-gradient(110deg, #1649c4, #2064ed); border: 0; min-height: 73px; }
.graph-link small { color: #e5efff; }
.registration { padding: 14px 15px; }
.fields { margin-top: 9px; }
.fields > div { display: grid; grid-template-columns: 104px 1fr; gap: 6px; padding: 8px 0; align-items: baseline; }
.fields > div + div { border-top: 1px solid var(--line); }
.fields dd { margin: 0; }
.graph { padding: 10px; }
.root { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #e9f1ff; color: var(--deep); border-radius: 10px; }
.root .share-label small { margin: 0; }
.branches { padding: 0 0 0 10px; margin: 0 0 0 8px; list-style: none; border-left: 1px solid #cbd9ef; }
.branch { position: relative; padding-top: 7px; }
.branch::before { content: ''; position: absolute; top: 33px; left: -11px; width: 10px; border-top: 1px solid #cbd9ef; }
.share { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px; min-height: 55px; border-radius: 9px; border: 1px solid var(--line); background: #fbfdff; text-align: left; }
.share[aria-expanded="true"] { border-color: #b0c7fa; background: #f2f6ff; }
.share .tile { width: 27px; height: 28px; flex-basis: 27px; border-radius: 7px; }
.share .icon { width: 15px; height: 15px; flex-basis: 15px; }
.share-label strong { font-size: 13px; }
.share-label small, .holding small { font-size: 10px; }
.holding { text-align: right; flex-shrink: 0; }
.holding strong, .holding small { display: block; }
.holding strong { color: var(--deep); font-size: 13px; font-variant-numeric: tabular-nums; }
.holding small { color: var(--muted); }
.branches .branches .branches .branches { margin-left: 3px; padding-left: 5px; }
.branches .branches .branches .branches .branch::before { left: -6px; width: 5px; }
.branches .branches .branches .branches .branches .branches { margin-left: 0; padding-left: 0; border-left: 0; }
.branches .branches .branches .branches .branches .branches .branch::before { display: none; }
.message { background: #edf3fb; padding: 10px 12px; border-radius: 9px; color: var(--muted); font-size: 13px; margin-top: 8px; }
.small-action { padding: 6px 8px; margin-top: 6px; border-radius: 6px; color: var(--deep); background: #fff; min-height: 36px; }
@media (min-width: 700px) {
  #app { margin: 24px auto; border: 1px solid var(--line); border-radius: 23px; overflow: hidden; min-height: min(820px, calc(100dvh - 48px)); background: #f8faff; }
  .content { padding: 20px; }
}

.archive-group { margin: 17px 0 8px; font-size: 14px; }
.archive-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.archive-button { min-height: 44px; padding: 7px 8px; color: var(--deep); background: #edf3ff; border-radius: 9px; }
.archive-shortcut { margin-bottom: 12px; padding-inline: 13px; }
#company-archive { margin-top: 12px; }
.archive > .registration > .archive-button { margin-top: 12px; }
.archive-filter, .archive-record { margin-top: 10px; padding: 12px; border-radius: 10px; background: #f4f7fc; }
.archive-filter summary { min-height: 26px; cursor: pointer; font-size: 14px; font-weight: 650; }
.archive-record h3 { margin: 0; font-size: 15px; }
.archive-record .note { margin-top: 4px; }
.archive-fields { margin: 7px 0 0; }
.archive-fields > div { grid-template-columns: minmax(56px, 32%) minmax(0, 1fr); }
.archive-fields dt { overflow-wrap: anywhere; }
.archive-values { margin: 0; padding-inline-start: 18px; }
.archive-value { white-space: pre-wrap; overflow-wrap: anywhere; }
