@font-face {
  font-family: Thai;
  src: url("/thai-ui.ttf");
}
* {
  box-sizing: border-box;
}
::selection {
  background: #c9e1d2;
  color: #153f30;
}
body {
  margin: 0;
  font-family: Thai, system-ui, sans-serif;
  background: #f5f7f4;
  color: #21372b;
  font-size: 16px;
  line-height: 1.65;
  accent-color: #216a4f;
  caret-color: #216a4f;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  background: white;
  border: 1px solid #cbd7ce;
  border-radius: 10px;
  padding: 10px 16px;
  color: #254c39;
  transition: background 0.15s;
}
button:hover {
  background: #eaf2eb;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
button.primary {
  background: #24644c;
  color: white;
  border-color: #24644c;
}
button.primary:hover {
  background: #194e39;
}
a {
  color: #216247;
  text-underline-offset: 4px;
}
input,
textarea {
  border: 1px solid #afc1b4;
  border-radius: 10px;
  padding: 13px;
  background: #fff;
  color: #21372b;
  width: 100%;
  min-height: 48px;
}
textarea {
  resize: vertical;
  min-height: 80px;
}
input::placeholder,
textarea::placeholder {
  color: #617367;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #b29453;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.35;
}
h2 {
  font-size: 23px;
  line-height: 1.45;
}
h3 {
  font-size: 18px;
}
small,
.muted {
  color: #52695b;
}
.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.brand b {
  color: #c2a568;
}
.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 560px);
  align-items: stretch;
}
.welcome {
  background: #173f30;
  color: #f9faf6;
  padding: clamp(32px, 7vw, 110px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 25px;
}
.welcome h1 {
  font-size: clamp(32px, 4vw, 54px);
  max-width: 15ch;
  line-height: 1.3;
}
.welcome p {
  max-width: 42ch;
  color: #d3e0d6;
}
.login-form {
  align-self: center;
  padding: clamp(24px, 5vw, 64px);
}
label {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}
.login-form button {
  width: 100%;
  margin: 10px 0 20px;
}
.error {
  color: #a02828;
  min-height: 26px;
  overflow-wrap: anywhere;
}
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  background: #173f30;
  color: white;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.sidebar .muted {
  color: #cfddd2;
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.sidebar nav button {
  text-align: left;
  background: transparent;
  color: #e9f0e9;
  border-color: transparent;
}
.sidebar nav button.active {
  background: #e5eee4;
  color: #1c4835;
  font-weight: 700;
}
.sidebar footer {
  margin-top: auto;
  padding-top: 30px;
}
.sidebar footer button {
  width: 100%;
  background: transparent;
  color: white;
  border-color: #7b9685;
}
.main {
  min-width: 0;
}
.topbar {
  min-height: 90px;
  padding: 20px 36px;
  background: white;
  border-bottom: 1px solid #dfe7df;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.identity strong {
  display: block;
}
.content {
  padding: 36px clamp(20px, 4vw, 64px);
  max-width: 1300px;
  margin: auto;
}
.chat {
  max-width: 780px;
  margin: auto;
  min-height: calc(100dvh - 165px);
  display: flex;
  flex-direction: column;
}
.chat-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 26px;
}
.chat-head h1 {
  font-size: 26px;
}
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}
.suggestions button {
  font-size: 14px;
}
.messages {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 20px;
}
.message {
  max-width: 70ch;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.user {
  align-self: flex-end;
  background: #e4eee5;
  padding: 16px 20px;
  border-radius: 18px 18px 4px 18px;
  max-width: 85%;
}
.message.assistant {
  padding: 8px 0;
}
.message.assistant strong {
  display: block;
  color: #2d6048;
  margin-bottom: 10px;
}
.composer {
  margin-top: auto;
  position: sticky;
  bottom: 0;
  padding-top: 16px;
  background: #f5f7f4;
}
.composebox {
  background: white;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 10px;
  border: 1px solid #c4d2c7;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}
.composebox textarea {
  border: 0;
  min-height: 70px;
  max-height: 180px;
  padding: 8px;
}
.composebox button {
  flex: none;
}
.composer small {
  display: block;
  text-align: center;
  margin-top: 9px;
  font-size: 13px;
}
.rows {
  background: white;
  border: 1px solid #d5e0d7;
  border-radius: 16px;
  padding: 0 24px;
  margin: 20px 0;
}
.row {
  padding: 20px 0;
  border-bottom: 1px solid #e0e7e1;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  overflow-wrap: anywhere;
}
.row:last-child {
  border: 0;
}
.row p {
  margin-bottom: 4px;
}
.row strong {
  font-variant-numeric: tabular-nums;
}
.row .amount {
  text-align: right;
  white-space: nowrap;
}
.empty {
  padding: 30px 0;
  color: #52695b;
}
.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(480px, 100%);
  background: white;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  border-left: 1px solid #c8d5cd;
  z-index: 10;
  overflow: auto;
  padding: 24px;
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}
.drawer-head h2 {
  margin: 0;
}
.draft {
  padding: 24px 0;
  border-bottom: 1px solid #dbe4dc;
}
.draft p {
  margin: 8px 0;
}
.draft h3 {
  margin-bottom: 12px;
}
.draft dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 18px 0;
}
.draft dt,
.draft dd {
  margin: 0;
}
.draft dd {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.draft .net {
  font-size: 20px;
  font-weight: 700;
  padding-top: 10px;
  border-top: 1px solid #dce5dd;
}
.draft ul {
  padding-left: 22px;
}
.draft button {
  width: 100%;
  margin-top: 16px;
}
.badge {
  display: inline-block;
  background: #edf3ee;
  color: #325c43;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 13px;
}
.notice {
  border: 1px solid #bc9553;
  background: #faf6eb;
  color: #6a4b18;
  padding: 14px;
  border-radius: 8px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
.page-head p {
  max-width: 65ch;
}
#status {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: #173f30;
  color: white;
  border-radius: 12px;
  padding: 0;
  z-index: 20;
}
#status:not(:empty) {
  padding: 12px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
body {
  scrollbar-color: #a8bfae #f5f7f4;
}
button svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
.feed {
  padding: 18px 0;
  border-bottom: 1px solid #dce5dd;
}
.feed small {
  display: block;
  margin-top: 4px;
}
@media (max-width: 760px) {
  .login {
    display: block;
  }
  .welcome {
    padding: 28px 24px;
    gap: 12px;
  }
  .welcome h1 {
    font-size: 30px;
    margin-bottom: 0;
    max-width: 20ch;
  }
  .welcome p {
    margin-bottom: 0;
  }
  .login-form {
    padding: 28px 24px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    padding: 15px 16px;
    gap: 14px;
    position: static;
  }
  .sidebar .brand {
    font-size: 19px;
  }
  .sidebar nav {
    display: flex;
    gap: 4px;
    overflow: auto;
    padding-bottom: 3px;
  }
  .sidebar nav button {
    white-space: nowrap;
    padding: 8px 12px;
  }
  .sidebar footer {
    display: none;
  }
  .sidebar > p {
    display: none;
  }
  .topbar {
    padding: 15px 20px;
    min-height: 76px;
  }
  .content {
    padding: 24px 18px;
  }
  .chat {
    min-height: calc(100dvh - 260px);
  }
  .chat-head {
    gap: 10px;
  }
  .chat-head h1 {
    font-size: 24px;
  }
  .chat-head button {
    padding: 9px 12px;
  }
  .composebox {
    padding: 8px;
  }
  .composebox button {
    padding: 10px 14px;
  }
  .rows {
    padding: 0 17px;
  }
  .row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .row .amount {
    text-align: left;
  }
  .drawer {
    padding: 20px;
  }
  .page-head {
    display: block;
  }
  .identity small {
    font-size: 13px;
  }
  .message.user {
    max-width: 95%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (min-width: 1000px) {
  body:has(.drawer) .main {
    margin-right: 480px;
  }
}

.login-form select{width:100%;min-height:48px;border:1px solid #b8c9bd;border-radius:12px;padding:12px;font:inherit;background:#fff;color:#163e30;box-sizing:border-box}
