:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #182d25;
  background: #f4f8f5;
  --paper: #fff;
  --text: #182d25;
  --muted: #51685d;
  --green: #175840;
  --green-dark: #124532;
  --green-soft: #e5f2e9;
  --line: #dce7df;
  --danger: #912f28;
  --danger-soft: #fff4f2;
  --shadow: 0 12px 26px rgba(25, 66, 44, .07);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--green); }
:focus-visible { outline: 3px solid #5a9576; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.65rem, 5.5vw, 2.25rem); letter-spacing: -.03em; line-height: 1.3; margin-bottom: .6rem; }
h2 { font-size: 1.17rem; line-height: 1.4; }
p { line-height: 1.65; }
svg.icon { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; }
small { font-size: .875rem; }
.sr-only {
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  position: absolute;
}
.skip-link { position: fixed; left: 16px; top: 8px; z-index: 10; transform: translateY(-180%); }
.skip-link:focus { transform: none; padding: 10px; border-radius: 8px; background: white; }
.app-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.app-header-inner {
  width: min(100%, 1056px);
  margin-inline: auto;
  padding: .85rem max(1rem, env(safe-area-inset-right)) .85rem max(1rem, env(safe-area-inset-left));
}
.brand { display: flex; align-items: center; width: fit-content; gap: .7rem; font-size: .96rem; font-weight: 700; }
.brand small { display: block; margin: .15rem 0 0; color: var(--muted); font-size: .76rem; font-weight: 500; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 12px;
  background: var(--green);
  color: #d8f4dd;
}
.brand-mark svg { width: 27px; height: 27px; transform: translateY(-1px); }
.main {
  max-width: 960px;
  margin-inline: auto;
  padding: 1.5rem max(1rem, env(safe-area-inset-right)) 6.5rem max(1rem, env(safe-area-inset-left));
}
.main:focus { outline: none; }
.main.form-main { padding-bottom: 1rem; }
.boot { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.container-narrow { max-width: 620px; margin-inline: auto; }
.page-head { margin-bottom: 1.25rem; }
.page-head p { color: var(--muted); margin-bottom: 0; }
.card {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.1rem;
  box-shadow: var(--shadow);
}
.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-radius: 11px;
  border: 1px solid transparent;
  padding: .62rem .94rem;
  text-decoration: none;
  font-weight: 650;
  background: var(--green-soft);
  color: var(--green-dark);
}
.btn:hover { background: #d9eddf; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.secondary { border-color: var(--line); background: #fff; }
.btn.secondary:hover { background: #f1f8f3; }
.btn.text { background: transparent; padding-inline: .3rem; }
.btn.text:hover { background: var(--green-soft); }
.btn:disabled { opacity: .58; cursor: progress; }
.btn.full { width: 100%; }
.btn .icon { width: 19px; height: 19px; }
.muted { color: var(--muted); }
.login-shell { display: grid; align-items: stretch; gap: 1rem; max-width: 850px; margin-inline: auto; }
.login-intro {
  position: relative;
  overflow: hidden;
  background: #123f30;
  color: white;
  border-radius: 20px;
  padding: 1.5rem 1.2rem;
}
.login-intro > * { position: relative; z-index: 1; }
.login-intro h1 { margin-bottom: .6rem; }
.login-intro p { color: #d3e7d7; margin-bottom: 0; }
.login-card h2 { margin-bottom: .25rem; }
.login-card > p { margin-bottom: 1rem; }
.login-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #d3eedb;
  color: var(--green-dark);
  margin-bottom: 1rem;
}
.login-icon .icon { width: 22px; }
.login-intro::after {
  content: "";
  position: absolute;
  right: -75px;
  bottom: -125px;
  width: 250px;
  height: 250px;
  border: 34px solid rgba(184, 231, 199, .12);
  border-radius: 64px;
  transform: rotate(-28deg);
}
.login-fields, .form-grid { display: grid; min-width: 0; gap: 1rem; }
.control { display: grid; min-width: 0; gap: .42rem; align-content: start; }
.control > label { font-weight: 650; font-size: .93rem; }
.control .optional { color: var(--muted); font-weight: 400; font-size: .82rem; }
.control small { color: var(--muted); line-height: 1.5; }
.control :is(input:not([type=file]), select, textarea) {
  width: 100%;
  min-height: 48px;
  border: 1px solid #bdcfc2;
  border-radius: 10px;
  background: #fff;
  padding: .72rem .8rem;
  color: var(--text);
  font-size: 16px;
}
.control :is(input, textarea)::placeholder { color: #61776b; }
.control select {
  appearance: none;
  padding-right: 2.2rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2351685D' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 8 4.5 4.5L14.5 8'/%3E%3C/svg%3E") right .78rem center / 18px 18px no-repeat;
}
.control textarea { min-height: 95px; resize: vertical; line-height: 1.6; }
.control :is(input, select, textarea)[aria-invalid=true] { border-color: var(--danger); }
.check-option { display: flex; align-items: flex-start; gap: .55rem; min-height: 46px; }
.check-option input { flex: none; margin: .18rem 0 0; width: 19px; height: 19px; accent-color: var(--green); }
.check-option span { display: grid; gap: .24rem; font-size: .92rem; font-weight: 600; line-height: 1.4; cursor: pointer; }
.check-option small { color: var(--muted); font-weight: 400; }
.login-fields .btn { margin-top: .1rem; }
.status-message { margin: .5rem 0 0; font-size: .9rem; line-height: 1.6; }
.status-message:empty { display: none; }
.status-message.error {
  border: 1px solid #efd0ca;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 11px;
  padding: .7rem .82rem;
}
.status-message.success { color: var(--green-dark); }
.payment-paste {
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f4f9f5;
}
.payment-paste textarea {
  min-height: 5.5rem;
}
.payment-paste .status-message {
  margin-top: .1rem;
}
.home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  border-radius: 20px;
  background: #124a36;
  color: #fff;
  padding: 1.3rem 1.2rem;
  margin-bottom: 1rem;
}
.home-head h1 { margin-bottom: .5rem; overflow-wrap: anywhere; }
.home-head p { margin: 0; color: #d4ecdc; font-size: .95rem; }
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: #d1e9d9;
  color: var(--green-dark);
  border-radius: 15px;
  font-size: 1.1rem;
  font-weight: 750;
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 1.55rem 0 .65rem; }
.section-head h2 { margin: 0; }
.section-head .btn { white-space: nowrap; font-size: .9rem; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.action-card {
  min-width: 0;
  display: grid;
  align-content: start;
  justify-items: start;
  text-align: left;
  gap: .65rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .95rem .75rem;
  color: var(--text);
  background: #fff;
  box-shadow: var(--shadow);
}
.action-card:hover { border-color: #adcabb; background: #fcfefd; }
.action-card strong { font-size: 1.03rem; }
.action-card small { color: var(--muted); min-width: 0; line-height: 1.5; }
.action-illustration {
  display: grid;
  place-items: center;
  height: 36px;
  width: 36px;
  color: #225d45;
  background: #deefe3;
  border-radius: 11px;
}
.action-illustration.refund { background: #f7eddb; color: #765318; }
.recent-card { padding: .12rem .85rem; }
.blank { padding: 1.6rem 1rem; color: var(--muted); text-align: center; }
.blank p { margin: 0; }
.blank .icon { display: block; margin: 0 auto .65rem; }
.record { border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; }
.record summary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: .45rem .8rem;
  padding: .85rem .2rem;
  cursor: pointer;
}
.record summary::-webkit-details-marker { display: none; }
.record summary:hover { background: #f7fbf8; }
.record-title { min-width: 0; display: flex; flex-direction: column; gap: .25rem; align-items: flex-start; }
.record-title strong, .record-title small { overflow-wrap: anywhere; }
.record-title small { color: var(--muted); }
.record-meta { display: grid; justify-items: end; gap: .3rem; text-align: right; }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.money.refund { color: #794e22; }
.badge {
  display: inline-block;
  white-space: nowrap;
  background: #f4ebd6;
  color: #684918;
  padding: .2rem .45rem;
  border-radius: 5px;
  font-size: .75rem;
  font-weight: 650;
}
.record-details { padding: .2rem .2rem .8rem; }
.record-details dl { margin: 0; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: .55rem .6rem; font-size: .9rem; }
.record-details dt { color: var(--muted); }
.record-details dd { margin: 0; overflow-wrap: anywhere; line-height: 1.5; }
.record-details .btn { margin-top: .55rem; }
.filters { display: flex; gap: .5rem; margin-bottom: 1rem; }
.filters .btn { min-height: 44px; font-size: .9rem; }
.filters [aria-pressed=true] { border-color: #75a58b; background: var(--green-soft); }
.navigation {
  z-index: 2;
  position: fixed;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
  padding: .25rem max(.65rem, env(safe-area-inset-right)) max(.3rem, env(safe-area-inset-bottom)) max(.65rem, env(safe-area-inset-left));
}
.nav-button {
  width: min(33.333%, 130px);
  min-height: 55px;
  padding: .35rem .4rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: .83rem;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .25rem;
}
.nav-button .icon { width: 20px; height: 20px; }
.nav-button[aria-current=page] { color: var(--green-dark); background: #edf6ef; font-weight: 700; }
.back { margin: -.65rem 0 .3rem; }
.form-card { padding: 1rem; }
.form-grid .span { grid-column: 1 / -1; }
.money-input { position: relative; }
.money-input span { position: absolute; top: 50%; left: .85rem; transform: translateY(-50%); color: #52695c; }
.money-input input { padding-left: 1.85rem !important; }
.upload-label { font-size: .93rem; font-weight: 650; }
.upload-label span { font-weight: 400; font-size: .82rem; color: var(--muted); margin-left: .2rem; }
.upload-zone {
  position: relative;
  min-height: 84px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .25rem;
  text-align: center;
  border: 1px dashed #78a88e;
  border-radius: 13px;
  background: #f1f8f3;
  padding: .65rem;
  color: var(--green-dark);
  cursor: pointer;
}
.upload-zone:hover, .upload-zone:focus-within { background: #e7f4e9; outline: 2px solid #5a9576; outline-offset: 2px; }
.upload-zone strong { font-size: .9rem; }
.upload-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.preview-card { min-width: 0; display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding: .45rem 0; }
.preview-card img { width: 45px; height: 58px; object-fit: cover; object-position: center top; border: 1px solid var(--line); border-radius: 7px; }
.preview-card span { overflow-wrap: anywhere; font-size: .89rem; }
.preview-card .btn { font-size: .87rem; }
.form-note { margin: 0; color: var(--muted); font-size: .89rem; line-height: 1.65; }
.form-footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: .65rem;
  padding: .75rem 0 max(.75rem, env(safe-area-inset-bottom));
  background: #f4f8f5;
}
.form-footer .btn { min-height: 50px; }
.form-footer .status-message { margin: 0 0 .55rem; }
.account-card { margin-bottom: 1rem; }
.account-identity { display: flex; align-items: center; gap: .82rem; }
.account-identity h2 { margin: 0 0 .2rem; overflow-wrap: anywhere; }
.account-identity p { margin: 0; }
.account-card .description { color: var(--muted); margin-bottom: .7rem; }
.account-card .control input[readonly] { background: #f4f8f5; font-size: .9rem; }
.account-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.switch-card { max-width: 520px; margin-inline: auto; }
.switch-card p { color: var(--muted); }
.switch-card .account-actions .btn { flex: 1 0 auto; }
.success-icon { background: #d9efe0; color: var(--green-dark); display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; margin-bottom: 1rem; }
.success-view { margin-top: .4rem; }
.success-view .account-actions > .btn { flex: 1 0 auto; }

@media (min-width: 600px) {
  .app-header-inner { padding: 1rem 1.5rem; }
  .main { padding: 2rem 1.5rem 7rem; }
  .main.form-main { padding-bottom: 3rem; }
  .card { padding: 1.4rem; }
  .recent-card { padding: .35rem 1.35rem; }
  .login-shell { grid-template-columns: 1fr 1fr; gap: 1.25rem; padding-top: clamp(1rem, 6vh, 4.5rem); }
  .login-intro { display: flex; flex-direction: column; justify-content: center; padding: 2rem; }
  .login-intro h1 { max-width: 12ch; }
  .login-intro p { max-width: 24ch; }
  .login-card { padding: 1.6rem; }
  .home-head { padding: 1.6rem; }
  .avatar { height: 50px; width: 50px; }
  .action-grid { gap: 1rem; }
  .action-card { padding: 1.25rem; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-footer { padding-top: .9rem; }
  .form-footer .btn { width: auto; min-width: 200px; }
}
@media (max-width: 355px) {
  .main { padding-inline: .75rem; }
  .card { padding-inline: .85rem; }
  .home-head { padding-inline: .9rem; }
  .action-card { padding: .7rem .6rem; }
  .action-card small { font-size: .82rem; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a { transition: background-color .16s, border-color .16s; }
}

.action-illustration.company-payment { background: #e3edf6; color: #284f72; }
.action-illustration.expense { background: #ece8f7; color: #59436f; }
.workflow-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin: .8rem 0; }
.workflow-record .record-title { gap: .3rem; }
.workflow-record .record-details { border-top: 1px solid #f2f6f3; padding-top: .75rem; }
.workflow-record .record-details dl { grid-template-columns: 5rem minmax(0, 1fr); align-items: baseline; }
.workflow-record .record-details :is(dt, dd) { line-height: 1.5; }
.badge.badge-paid, .badge.badge-approved { background: #dff2e5; color: #204c35; }
.badge.badge-returned { background: #ffece7; color: #852f26; }
.workflow-notice {
  margin: 0 0 .85rem;
  padding: .65rem .85rem;
  border-radius: 10px;
  background: #e7f3eb;
  color: var(--green-dark);
  font-size: .92rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.expense-record-lines { padding: 0; margin: .9rem 0 0; list-style: none; }
.expense-record-lines > li { background: #f5f9f6; border: 1px solid var(--line); padding: .65rem .75rem; border-radius: 11px; }
.expense-record-lines > li + li { margin-top: .45rem; }
.expense-record-line-title { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.expense-record-line-title strong { color: var(--text); overflow-wrap: anywhere; min-width: 0; }
.expense-record-lines small, .no-file { color: var(--muted); }
.no-file { display: block; font-size: .86rem; margin-top: .35rem; }
.expense-issues {
  margin: .7rem 0 0;
  padding: .55rem .65rem .55rem 1.55rem;
  background: #fbf5e8;
  color: #705520;
  border: 1px solid #eadfc4;
  border-radius: 10px;
  font-size: .87rem;
  line-height: 1.58;
  overflow-wrap: anywhere;
}
.expense-issues li + li { margin-top: .2em; }
.expense-fields { min-width: 0; border: 0; padding: 0; margin: 0; }
.expense-fields .control input[type=date] { min-width: 0; }
.expense-line-heading .btn { white-space: nowrap; font-size: .88rem; }
.expense-line-stack { display: grid; gap: .85rem; }
.expense-line-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: 0 0 .65rem; }
.expense-line-top h3 { margin: 0; font-weight: 700; font-size: 1.02rem; }
.expense-line-top .btn { font-size: .87rem; }
.expense-upload-zone { min-height: 72px; }
.expense-limit { margin: .75rem 0; }
.expense-warning-box[hidden] { display: none; }
.retained-proof {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .2rem .65rem;
  color: var(--muted);
  font-size: .88rem;
}
.retained-proof > span { min-width: 0; overflow-wrap: anywhere; }
.retained-proof .btn { font-size: .87rem; white-space: nowrap; }
.expense-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .45rem .8rem;
  align-items: center;
  box-shadow: 0 -5px 11px #f4f8f5;
}
.expense-footer .status-message { grid-column: 1 / -1; margin: 0; }
.expense-footer .btn { white-space: nowrap; min-width: min(43vw, 120px); }
.expense-total { min-width: 0; display: grid; gap: .18rem; }
.expense-total span { color: var(--muted); font-size: .84rem; }
.expense-total strong { font-size: clamp(1rem, 4.25vw, 1.3rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

@media (min-width: 840px) {
  .action-grid:has(.company-payment, .expense) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
