@font-face {
  font-family: Workspace;
  src: local("Inter"), local("Arial");
  font-display: swap;
}
:root {
  --canvas: #f1f6f5;
  --surface: #fff;
  --ink: #062e34;
  --muted: #526a6f;
  --line: #d6e2e3;
  --accent: #003e45;
  --mint: #2ed8c3;
  --green: #15734f;
  --red: #c33d46;
  --amber: #866010;
  --radius: 20px;
  font-family: Workspace, Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: normal;
}
button:hover,
.button:hover {
  background: #eaf3f1;
}
button.primary,
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.primary:hover {
  background: #07555b;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.quiet {
  border-color: transparent;
  background: transparent;
}
button.small,
.button.small {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}
button.danger {
  color: var(--red);
}
:focus-visible {
  outline: 3px solid #008c82;
  outline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #95afb3;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}
input[type="file"] {
  padding: 8px;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: #7b8e91;
}
label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
}
label span.hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
label.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  line-height: 1.5;
}
label.check input {
  margin-top: 2px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 8px;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
}
h3 {
  font-size: 15px;
  margin-bottom: 10px;
}
p {
  line-height: 1.6;
}
small,
.muted,
.hint {
  color: var(--muted);
}
small {
  line-height: 1.5;
}
.workspace {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  padding: 28px 18px;
  border-right: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
  font-size: 16px;
  line-height: 1.25;
}
.brand img {
  width: 38px;
  height: 38px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.sidebar nav a {
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
}
.sidebar nav a.active {
  background: var(--accent);
  color: white;
}
.sidebar .foot {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}
.topbar {
  height: 72px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
  gap: 12px;
}
.topbar .eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.3px;
  font-size: 11px;
  color: var(--muted);
}
main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 34px 32px 60px;
  min-width: 0;
}
.heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  min-width: 0;
}
.card.soft {
  background: #eaf4f0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stats .card {
  margin: 0;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.stat-value {
  font-size: 30px;
  letter-spacing: -0.7px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
}
.toolbar input {
  max-width: 520px;
}
.toolbar select {
  max-width: 250px;
}
.table-scroll {
  overflow: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  text-align: left;
}
th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0.3px;
}
th,
td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td strong {
  display: block;
}
td small {
  display: block;
  margin-top: 5px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 650;
  background: #e8eff0;
  white-space: nowrap;
}
.badge.ok {
  color: var(--green);
  background: #e4f4e9;
}
.badge.alert {
  color: var(--red);
  background: #fdebed;
}
.badge.warning {
  color: var(--amber);
  background: #fff4d8;
}
.badge.info {
  color: #25697b;
  background: #e3f1f6;
}
.money {
  font-variant-numeric: tabular-nums;
}
.red {
  color: var(--red);
}
.green {
  color: var(--green);
}
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 5px 0 14px;
  margin-bottom: 10px;
}
.tabs a {
  flex-shrink: 0;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: #fff;
}
.tabs a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.grid {
  display: grid;
  gap: 18px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.wide {
  grid-column: 1/-1;
}
.stack {
  display: grid;
  gap: 18px;
}
.separator {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.notice {
  border: 1px solid #d7c594;
  background: #fff9eb;
  border-radius: 14px;
  padding: 15px 18px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.notice.error {
  border-color: #e8b8bd;
  background: #fff0f1;
  color: #8f2933;
}
.notice.info {
  border-color: #b9d6d4;
  background: #eef8f5;
}
.notice p:last-child {
  margin-bottom: 0;
}
.notice ul {
  padding-left: 20px;
  margin: 8px 0;
}
.empty {
  text-align: center;
  padding: 50px 24px;
}
.empty-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #e5f1ec;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin: 0 auto 20px;
}
.empty p {
  max-width: 540px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 14px;
}
.empty h2 {
  margin-bottom: 12px;
}
.source-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    13px/1.7 Workspace,
    Arial,
    sans-serif;
  max-height: 450px;
  overflow: auto;
  margin: 12px 0 0;
}
.source {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.source:first-child {
  padding-top: 0;
}
.source:last-child {
  border-bottom: 0;
}
.source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.source-name {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.source details {
  margin-top: 12px;
}
details > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0;
  line-height: 1.5;
}
details details {
  padding-left: 12px;
}
.kv {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr);
  gap: 8px 20px;
  font-size: 13px;
  margin: 12px 0;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.plan-rows {
  display: grid;
  gap: 10px;
}
.plan-row {
  display: grid;
  grid-template-columns:
    minmax(160px, 2fr) minmax(110px, 1fr) minmax(110px, 1fr)
    minmax(90px, 1fr) 34px;
  gap: 10px;
  align-items: end;
}
.plan-row button {
  width: 34px;
  min-height: 42px;
  padding: 0;
}
.plan-row label {
  font-size: 11px;
}
.plan-row .delete {
  color: var(--red);
}
.history {
  list-style: none;
  padding: 0;
  margin: 0;
}
.history li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  display: grid;
  gap: 5px;
}
.history li:last-child {
  border-bottom: 0;
}
.breadcrumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--muted);
}
.breadcrumbs a {
  text-decoration: none;
}
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: min(460px, calc(100vw - 32px));
  background: var(--accent);
  color: #fff;
  padding: 16px 20px;
  box-shadow: 0 12px 40px #00262c26;
  border-radius: 14px;
  z-index: 100;
  font-size: 14px;
  line-height: 1.5;
}
#toast.error {
  background: #8c2831;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 24px;
  max-width: min(680px, calc(100vw - 32px));
  width: 100%;
  padding: 28px;
  color: var(--ink);
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #002c3466;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 0;
}
.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}
.login {
  max-width: 440px;
  margin: 10vh auto;
}
.login .brand {
  margin-bottom: 30px;
}
.login h1 {
  font-size: 26px;
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.help-step {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}
.help-step .step {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: #e5f4ef;
  color: var(--accent);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}
.help-step p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 0;
}
.result-item {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.result-item:first-child {
  border-top: 0;
}
.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.result-head h3 {
  margin-bottom: 5px;
}
.result-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.pre-line {
  white-space: pre-line;
}
.amount {
  display: block;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
form > .actions {
  margin-top: 20px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  main {
    padding-top: 44px;
  }
  .heading {
    margin-bottom: 32px;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  main {
    padding: 26px 22px;
  }
  .sidebar {
    padding: 24px 12px;
  }
  .topbar {
    padding: 0 22px;
  }
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .plan-row {
    grid-template-columns: 2fr 1fr 1fr 1fr 34px;
  }
  .stats {
    gap: 10px;
  }
  .stats .card {
    padding: 18px;
  }
  .stat-value {
    font-size: 25px;
  }
}
@media (max-width: 760px) {
  .workspace {
    display: block;
  }
  .sidebar {
    height: auto;
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 14px;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
  .sidebar nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
    align-items: center;
  }
  .sidebar nav a {
    padding: 8px 10px;
    font-size: 12px;
  }
  .sidebar .foot {
    display: none;
  }
  .topbar {
    height: 50px;
    padding: 0 16px;
  }
  .topbar .eyebrow {
    font-size: 9px;
    letter-spacing: 0.5px;
  }
  .topbar small {
    font-size: 11px;
  }
  main {
    padding: 24px 16px 50px;
  }
  .heading {
    display: block;
  }
  .heading > .actions {
    margin-top: 16px;
  }
  h1 {
    font-size: 27px;
  }
  .card {
    padding: 18px;
    border-radius: 16px;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stats .card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
  .stat-label {
    margin: 0;
  }
  .stat-value {
    text-align: right;
    font-size: 24px;
  }
  .stat-note {
    grid-column: 1/-1;
  }
  .grid.two,
  .grid.three,
  .grid.four,
  .help-grid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar input,
  .toolbar select {
    max-width: none;
  }
  .plan-row {
    grid-template-columns: 1fr 1fr;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .plan-row > label:first-child {
    grid-column: 1/-1;
  }
  .plan-row button {
    justify-self: end;
  }
  .kv {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .kv dd {
    margin-bottom: 10px;
  }
  .result-head,
  .source-head {
    flex-wrap: wrap;
  }
  .tabs a {
    padding: 9px 13px;
  }
  .source-text {
    max-height: 280px;
  }
  dialog {
    padding: 20px;
  }
  .login {
    margin: 7vh 16px;
  }
  .table-scroll table {
    min-width: 650px;
  }
  .actions button,
  .actions .button {
    font-size: 13px;
  }
  .result-meta {
    gap: 5px;
  }
  .card .table-scroll {
    margin: 0 -4px;
  }
  .help-step {
    padding: 20px;
  }
}
