:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172b4d;
  background: #f3f6fa;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(100%, 440px);
  padding: 36px;
  background: #fff;
  border: 1px solid #e4e9f0;
  border-radius: 16px;
  box-shadow: 0 18px 50px #172b4d12;
}

.brand {
  margin-bottom: 32px;
  color: #1454a1;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .12em;
}

.brand span {
  margin-left: 6px;
  padding: 4px 7px;
  border-radius: 5px;
  background: #e9f2ff;
  color: #3975bd;
  font-size: 10px;
}

h1 { margin: 0 0 8px; font-size: 26px; }
h2 { margin-top: 0; font-size: 18px; }
.intro { margin: 0 0 24px; color: #617188; line-height: 1.5; }

label {
  display: block;
  margin: 16px 0 7px;
  font-size: 14px;
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}

input:focus {
  outline: 3px solid #d9eaff;
  border-color: #3975bd;
}

small { display: block; margin-top: 7px; color: #617188; line-height: 1.4; }
ul.errorlist { padding: 0; color: #a42b2b; list-style: none; font-size: 13px; }

button {
  width: 100%;
  min-height: 46px;
  margin-top: 24px;
  border: 0;
  border-radius: 8px;
  background: #1559a6;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: #104a8d; }
button.secondary { background: #e8eef6; color: #25425f; }
.switch { margin: 22px 0 0; text-align: center; font-size: 14px; }
a { color: #1454a1; }
.notice { margin: 28px 0 0; color: #7c8795; font-size: 12px; line-height: 1.5; }
.empty { margin: 28px 0 8px; padding: 20px; border-radius: 10px; background: #f3f7fc; }
.empty p { margin-bottom: 0; color: #617188; line-height: 1.5; }

@media (max-width: 480px) {
  .card { padding: 26px 22px; }
}

body.app-body {
  display: block;
  min-height: 100vh;
  padding: 0;
  background: #f5f7fb;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  width: 252px;
  flex-direction: column;
  padding: 28px 18px 18px;
  border-right: 1px solid #e7ebf2;
  background: #fff;
}

.sidebar .brand {
  margin: 0 0 44px 8px;
  text-decoration: none;
}

.workspace-label,
.eyebrow,
.panel-kicker,
.summary-label {
  color: #8390a3;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .1em;
}

.workspace-label { margin: 0 8px 13px; }
.sidebar nav { display: grid; gap: 5px; }

.nav-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 11px;
  border-radius: 8px;
  color: #50627a;
  font-size: 14px;
  text-decoration: none;
}

.nav-link.active { background: #edf4fd; color: #1759a4; font-weight: 700; }
.nav-link.disabled { color: #9aa5b4; }
.nav-link small { margin-left: auto; font-size: 10px; }
.nav-icon { width: 18px; text-align: center; font-size: 17px; }

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 15px 4px 0;
  border-top: 1px solid #edf0f4;
}

.profile-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: #e8f1fc;
  color: #1559a6;
  font-weight: 750;
}

.profile-name { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; }
.profile-name small { margin-top: 3px; font-size: 11px; }
.sidebar-bottom form { margin-left: auto; }

.icon-button {
  width: 34px;
  min-height: 34px;
  margin: 0;
  background: transparent;
  color: #758399;
  font-size: 19px;
}

.icon-button:hover { background: #f0f3f7; color: #253b57; }

.main-content {
  width: min(100% - 252px, 1260px);
  margin-left: 252px;
  padding: 44px clamp(28px, 5vw, 72px) 24px;
}

.page-header,
.section-heading,
.findings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.page-header { margin-bottom: 28px; }
.page-header .eyebrow { margin: 0 0 10px; }
.page-header h1 { font-size: 30px; }
.page-header .intro { margin: 8px 0 0; }
.status-pill,
.demo-badge,
.findings-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid #e5eaf1;
  border-radius: 999px;
  background: #fff;
  color: #627188;
  font-size: 12px;
  white-space: nowrap;
}

.status-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d99731;
}

.welcome-panel {
  position: relative;
  display: flex;
  min-height: 260px;
  align-items: center;
  overflow: hidden;
  padding: 36px 44px;
  border-radius: 16px;
  background: linear-gradient(115deg, #123e72, #1768ae);
  color: #fff;
}

.welcome-copy { position: relative; z-index: 1; max-width: 520px; }
.welcome-copy .panel-kicker { color: #b9d8fb; }
.welcome-copy h2 { margin: 12px 0 10px; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; }
.welcome-copy p { max-width: 470px; margin: 0 0 22px; color: #d7e7f8; line-height: 1.55; }

.button-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-radius: 8px;
  background: #fff;
  color: #1559a6;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover { background: #edf5ff; }
.button-link span { font-size: 18px; }
.welcome-copy .secondary-link { margin: 12px 0 0; font-size: 12px; }
.secondary-link a { color: #d7e7f8; text-decoration: none; }
.secondary-link a:hover { text-decoration: underline; }
.welcome-art { position: absolute; inset: 0 2% 0 auto; display: grid; width: 38%; place-items: center; opacity: .95; }
.art-sheet { position: relative; width: 178px; padding: 28px 22px 22px; transform: rotate(7deg); border: 1px solid #ffffff50; border-radius: 14px; background: #ffffff18; box-shadow: 0 25px 65px #07284955; }
.art-sheet-title { width: 72%; height: 8px; margin-bottom: 23px; border-radius: 8px; background: #d9edff; }
.art-row { display: flex; justify-content: space-between; margin: 13px 0; }
.art-row i, .art-row b { height: 6px; border-radius: 8px; background: #b8dcff; }
.art-row i { width: 58%; opacity: .65; }
.art-row b { width: 20%; background: #fff; }
.art-check { position: absolute; right: -23px; bottom: -21px; display: grid; width: 53px; height: 53px; place-items: center; border: 5px solid #1768ae; border-radius: 50%; background: #89d8b0; color: #154b39; font-size: 27px; font-weight: 800; }

.section-heading { align-items: end; margin: 34px 0 16px; }
.section-heading .eyebrow,
.findings-heading .eyebrow { margin: 0 0 7px; }
.section-heading h2,
.findings-heading h2 { margin: 0; font-size: 20px; }
.muted-label { color: #8390a3; font-size: 12px; }

.source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.source-card { min-width: 0; padding: 19px; border: 1px solid #e7ebf2; border-radius: 12px; background: #fff; }
.source-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; font-size: 20px; font-weight: 700; }
.file-icon { background: #edf4fd; color: #2166b1; }
.link-icon { background: #eff5f0; color: #358166; }
.remote-icon { background: #f4f0fb; color: #7854a7; }
.source-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 15px; }
.source-card h3 { margin: 0; font-size: 14px; }
.soon-tag { padding: 4px 7px; border-radius: 999px; background: #f1f3f6; color: #78869a; font-size: 10px; }
.source-card p { min-height: 42px; margin: 9px 0 15px; color: #748197; font-size: 12px; line-height: 1.5; }
.text-button { width: auto; min-height: auto; margin: 0; padding: 0; background: transparent; color: #8894a5; font-size: 11px; font-weight: 500; text-align: left; cursor: not-allowed; }
.text-button:hover { background: transparent; color: #8894a5; }

.privacy-callout,
.explanation-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 15px 17px;
  border: 1px solid #e7edf5;
  border-radius: 11px;
  background: #f8fbff;
}

.privacy-mark,
.explanation-icon { display: grid; width: 22px; height: 22px; flex: none; place-items: center; border-radius: 50%; background: #deebfa; color: #2765a5; font-size: 13px; font-weight: 750; }
.privacy-callout strong { font-size: 12px; }
.privacy-callout p { margin: 4px 0 0; color: #718097; font-size: 12px; line-height: 1.5; }
.app-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 28px; color: #8a96a7; font-size: 11px; }

.back-link { display: inline-block; margin-bottom: 23px; color: #52708e; font-size: 13px; text-decoration: none; }
.back-link:hover { color: #1559a6; }
.report-header { align-items: center; margin-bottom: 22px; }
.report-header h1 { margin-bottom: 0; }
.demo-badge { background: #fff8e9; border-color: #f4e4bd; color: #8b6822; }
.report-summary { display: flex; align-items: center; justify-content: space-between; padding: 23px 26px; border: 1px solid #e7ebf2; border-radius: 13px; background: #fff; }
.summary-label { color: #8a96a7; }
.summary-copy h2 { margin: 9px 0 5px; font-size: 20px; }
.summary-copy h2 span { margin-left: 5px; padding: 4px 6px; border-radius: 4px; background: #f1f4f7; color: #718097; font-size: 9px; vertical-align: middle; }
.summary-copy p { margin: 0; color: #77859a; font-size: 12px; }
.summary-score { display: flex; align-items: center; gap: 11px; padding-left: 24px; border-left: 1px solid #edf0f4; color: #63748c; font-size: 11px; line-height: 1.4; }
.summary-score strong { color: #d28b2c; font-size: 34px; }
.explanation-panel { margin: 14px 0 27px; }
.explanation-panel p { margin: 0; color: #66768c; font-size: 12px; line-height: 1.55; }
.explanation-panel strong { color: #394d65; }
.findings-heading { align-items: end; margin-bottom: 13px; }
.findings-count { padding: 7px 10px; background: #f0f4f9; font-size: 11px; }
.finding-card { margin-bottom: 13px; padding: 21px 23px; border: 1px solid #e7ebf2; border-radius: 12px; background: #fff; }
.finding-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.risk-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; }
.risk-tag i { width: 7px; height: 7px; border-radius: 50%; background: #da9851; }
.risk-high { color: #a15d24; }
.risk-medium { color: #95722b; }
.risk-medium i { background: #d5b443; }
.finding-number { color: #96a1af; font-size: 10px; }
.finding-card h3 { margin: 12px 0 6px; font-size: 16px; }
.finding-summary { margin: 0; color: #718097; font-size: 12px; line-height: 1.55; }
.finding-details { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #eff1f4; }
.finding-details span { color: #78869a; font-size: 10px; font-weight: 700; }
.finding-details p { margin: 6px 0 0; color: #465a72; font-size: 12px; line-height: 1.55; }
.finding-action { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px; border-radius: 8px; background: #f3f8f5; }
.action-icon { display: grid; width: 21px; height: 21px; flex: none; place-items: center; border-radius: 50%; background: #d8eee1; color: #37805e; font-size: 12px; font-weight: 800; }
.finding-action p { margin: 0; color: #587163; font-size: 11px; line-height: 1.55; }
.finding-action strong { color: #355f49; }
.report-endnote { margin-top: 17px; padding: 18px; border: 1px solid #e7ebf2; border-radius: 10px; background: #fff; font-size: 12px; }
.report-endnote p { margin: 6px 0 0; color: #718097; line-height: 1.5; }

.upload-panel,
.preview-panel {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid #e7ebf2;
  border-radius: 13px;
  background: #fff;
}

.upload-panel h2,
.preview-heading h2 { margin: 0; font-size: 19px; }
.upload-panel > p { max-width: 740px; margin: 9px 0 20px; color: #718097; font-size: 12px; line-height: 1.6; }
.upload-form { max-width: 580px; }
.upload-form > input[type="file"] { min-height: auto; padding: 12px; background: #fafbfd; font-size: 12px; }
.upload-form .consent-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; color: #566982; font-size: 12px; font-weight: 500; line-height: 1.5; }
.upload-form .consent-check input { width: 17px; min-height: 17px; height: 17px; flex: none; margin: 1px 0 0; accent-color: #1559a6; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.upload-form .upload-actions button { max-width: 280px; margin-top: 0; }
.upload-form .upload-actions .secondary-button { border: 1px solid #d9e1eb; background: #f5f7fa; color: #344b67; }
.trial-balance-result { margin-bottom: 22px; padding: 18px; border: 1px solid #dce5ef; border-radius: 10px; background: #f7f9fc; }
.trial-balance-result h2 { margin: 4px 0 7px; font-size: 18px; }
.trial-balance-result > p { margin: 6px 0; color: #596b81; font-size: 12px; line-height: 1.55; }
.trial-balance-result.status-ok { border-color: #cce4d3; background: #f2f8f3; }
.trial-balance-result.status-review { border-color: #ecd3cd; background: #fff7f5; }
.trial-balance-result.status-incomplete,
.trial-balance-result.status-unsupported { border-color: #f0dfb8; background: #fffaf0; }
.trial-balance-count { font-weight: 700; }
.control-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.control-list div { padding: 10px; border: 1px solid #e5eaf0; border-radius: 7px; background: #fff; }
.control-list dt { color: #6d7e93; font-size: 10px; }
.control-list dd { margin: 5px 0 0; color: #314760; font-size: 13px; font-weight: 700; }
.trial-balance-findings { margin: 12px 0; padding-left: 20px; color: #744c43; font-size: 12px; line-height: 1.6; }
.upload-form ul.errorlist { margin: 7px 0; }
.import-warning { margin: 0 0 18px; border-color: #f0dfb8; background: #fffaf0; }
.import-warning .privacy-mark { background: #f7e9c9; color: #8b6822; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.preview-heading .eyebrow { margin: 0 0 8px; }
.preview-notice { color: #738198; font-size: 11px; line-height: 1.5; }
.table-scroll { max-width: 100%; overflow: auto; margin: 14px 0; border: 1px solid #e8ecf2; border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; }
.data-table th,
.data-table td { max-width: 260px; padding: 9px 11px; border-bottom: 1px solid #edf0f4; overflow-wrap: anywhere; }
.data-table th { background: #f6f8fb; color: #586b84; font-weight: 700; }
.data-table td { color: #43576f; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.connection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.connection-card { padding: 20px; border: 1px solid #e7ebf2; border-radius: 12px; background: #fff; }
.connection-card h3 { margin: 13px 0 7px; font-size: 15px; }
.connection-card p { min-height: 45px; margin: 0 0 13px; color: #718097; font-size: 12px; line-height: 1.55; }
.connection-card a { color: #1759a4; font-size: 12px; font-weight: 700; text-decoration: none; }
.connection-card a:hover { text-decoration: underline; }
.connection-status { display: inline-block; padding: 5px 8px; border-radius: 999px; background: #f0f3f7; color: #718097; font-size: 10px; }
.connection-card.ready { border-color: #d9e9dc; }
.connection-card.ready .connection-status { background: #eaf5ed; color: #387650; }
.connection-card.restricted { background: #fafbfc; }
.connection-card.restricted .connection-status { background: #fbf1e8; color: #93612f; }
.connection-card code { font-size: 11px; }

.connection-list { display: grid; gap: 8px; margin-bottom: 28px; }
.connection-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border: 1px solid #e7ebf2; border-radius: 12px; background: #fff; color: inherit; text-decoration: none; }
.connection-row:hover { border-color: #c9d6e6; }
.connection-row-title { display: grid; gap: 3px; font-size: 14px; font-weight: 700; }
.connection-row-title small { color: #718097; font-size: 12px; font-weight: 400; }
.status-pill.status-ok { border-color: #d9e9dc; background: #eaf5ed; color: #387650; }
.status-pill.status-error { border-color: #f1d5d2; background: #fcefed; color: #a8433a; }
.status-pill.status-new { color: #718097; }
.token-value { display: block; padding: 10px 12px; border-radius: 8px; background: #fff; font-size: 13px; word-break: break-all; user-select: all; }
.steps { margin: 0 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.7; }
.steps pre { overflow-x: auto; margin: 8px 0; padding: 12px; border-radius: 8px; background: #f3f6fa; font-size: 12px; }
.period-fields { display: flex; flex-wrap: wrap; gap: 16px; }
.period-fields label { display: grid; gap: 6px; }

@media (min-width: 1450px) {
  .app-shell { max-width: 1700px; margin: 0 auto; }
  .sidebar { left: max(0px, calc((100vw - 1700px) / 2)); }
}

@media (max-width: 1050px) {
  .sidebar { width: 218px; }
  .main-content { width: calc(100% - 218px); margin-left: 218px; padding: 34px 28px 22px; }
  .source-grid { grid-template-columns: 1fr; }
  .source-card p { min-height: auto; }
  .connection-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .sidebar { position: static; width: auto; padding: 16px 18px; border-right: 0; border-bottom: 1px solid #e7ebf2; }
  .sidebar .brand { margin: 0 0 14px; }
  .workspace-label, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; gap: 5px; overflow-x: auto; }
  .nav-link { min-height: 37px; flex: none; padding: 0 9px; font-size: 12px; }
  .nav-link small, .nav-link.disabled { display: none; }
  .nav-link { gap: 7px; }
  .nav-icon { width: auto; font-size: 14px; }
  .main-content { width: 100%; margin: 0; padding: 27px 18px 20px; }
  .page-header { flex-direction: column; gap: 12px; }
  .page-header h1 { font-size: 25px; }
  .welcome-panel { min-height: 250px; padding: 28px 23px; }
  .welcome-copy { max-width: 100%; }
  .welcome-copy p { max-width: 90%; font-size: 13px; }
  .welcome-art { right: -18%; width: 60%; opacity: .28; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .source-grid { grid-template-columns: 1fr; }
  .source-card { padding: 16px; }
  .muted-label { font-size: 11px; }
  .app-footer { flex-direction: column; gap: 5px; }
  .report-header { align-items: flex-start; }
  .report-summary { align-items: flex-start; gap: 12px; padding: 18px 15px; }
  .summary-copy h2 { font-size: 16px; }
  .summary-copy p { font-size: 10px; }
  .summary-score { gap: 7px; padding-left: 12px; }
  .summary-score strong { font-size: 27px; }
  .summary-score span { font-size: 9px; }
  .finding-card { padding: 17px 15px; }
  .finding-details { grid-template-columns: 1fr; gap: 13px; }
  .findings-heading h2 { font-size: 18px; }
  .upload-panel, .preview-panel { padding: 18px 15px; }
  .upload-form button { max-width: none; }
  .control-list { grid-template-columns: 1fr; }
  .preview-heading { align-items: flex-start; flex-direction: column; }
}
