@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/ibm-plex-latin-400.woff2) format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/ibm-plex-thai-400.woff2) format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/ibm-plex-thai-500.woff2) format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/ibm-plex-thai-600.woff2) format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
:root {
  --ink: #1c1b19;
  --muted: #6b6a62;
  --line: rgba(0, 0, 0, 0.12);
  --base: #fbfaf7;
  --paper: #fff;
  --wash: #f1f0eb;
  --blue: #2b6cb8;
  --blue-dark: #225a9c;
  --green: #1f7a4d;
  --amber: #8a5a00;
  --red: #b42318;
  font-family:
    "IBM Plex Sans", "IBM Plex Sans Thai", Thonburi, "Leelawadee UI", sans-serif;
  color: var(--ink);
  background: var(--base);
  line-height: 1.7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--blue);
}
.shell {
  max-width: 1240px;
  margin: auto;
  padding: 24px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 19px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
.session {
  color: var(--muted);
  font-size: 14px;
}
.layout {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr);
  gap: 32px;
  padding-top: 26px;
}
.nav {
  display: grid;
  align-content: start;
  gap: 5px;
}
.nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
}
.nav button:hover,
.nav button.active {
  background: var(--wash);
  color: var(--ink);
  font-weight: 500;
}
.content {
  min-width: 0;
}
.layout--contract {
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
.layout--contract .nav {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.3;
  margin-bottom: 7px;
}
h2 {
  font-size: 20px;
  line-height: 1.35;
}
.lede,
.muted {
  color: var(--muted);
}
.small {
  font-size: 14px;
}
.eyebrow {
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.stack {
  display: grid;
  gap: 12px;
}
.spread {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
label {
  display: grid;
  gap: 5px;
  font-weight: 500;
  font-size: 14px;
}
input,
textarea,
select {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}
textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.7;
}
input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(43, 108, 184, 0.28);
  outline-offset: 2px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
}
.button:hover {
  background: var(--blue-dark);
}
.button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 500;
  background: var(--wash);
  color: var(--muted);
}
.status.good,
.status.paid,
.status.completed {
  background: #e5f4ea;
  color: var(--green);
}
.status.awaiting_payment,
.status.delivered {
  background: #fff2db;
  color: var(--amber);
}
.status.failed,
.status.declined {
  background: #fdeaea;
  color: var(--red);
}
.item {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.item:first-child {
  border-top: 0;
  padding-top: 0;
}
.item:last-child {
  padding-bottom: 0;
}
.template-choice {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}
.template-choice:hover {
  border-color: var(--blue);
}
.contract-header,
.document-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.contract-header h1 {
  max-width: 34ch;
  overflow-wrap: anywhere;
}
.contract-header p,
.document-toolbar h2 {
  margin-bottom: 0;
}
.contract-tools {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 8px;
}
.contract-desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem);
  gap: 24px;
  align-items: start;
}
.contract-paper {
  padding: clamp(20px, 4vw, 48px);
}
.document-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 16px;
}
.document {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: clamp(17px, 1.5vw, 19px);
  font-weight: 400;
  line-height: 1.85;
  max-inline-size: 42rem;
}
.document p {
  margin: 0 0 0.2em;
}
.document h3 {
  font-size: 1.05em;
  line-height: 1.5;
  margin: 0 0 0.4em;
}
.document .document-clause {
  margin-block-end: 0.75em;
  padding-inline-start: 1.4em;
  text-indent: -1.4em;
}
.document-spacing {
  block-size: 0.85em;
}
.contract-review {
  scroll-margin-block-start: 16px;
}
.contract-primary details {
  border-top: 1px solid var(--line);
  padding-block: 12px;
}
.contract-primary details .document {
  margin-block: 12px;
}
#contract-editor textarea[name="body"] {
  min-block-size: clamp(21rem, 62vh, 43rem);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
}
.guest-document {
  width: min(calc(100% - 32px), 48rem);
  margin: 32px auto;
}
.guest-document h1 {
  overflow-wrap: anywhere;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .contract-desk {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .contract-header {
    flex-direction: column;
  }
  .contract-tools {
    justify-content: flex-start;
  }
}
.auth {
  max-width: 500px;
  margin: 48px auto;
}
.auth .card {
  padding: 28px;
}
.notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 390px;
  background: #1c1b19;
  color: #fff;
  padding: 12px 15px;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.notice.error {
  background: var(--red);
}
.empty {
  padding: 24px 0;
  color: var(--muted);
}
.sandbox {
  background: #f3f8fd;
  color: #225a9c;
  border: 1px solid #bfd7ef;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
}
.role {
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.hidden {
  display: none !important;
}
.login-link {
  color: var(--blue);
  border: 0;
  background: transparent;
  padding: 0;
  text-decoration: underline;
}
@media (max-width: 760px) {
  .shell {
    padding: 16px;
  }
  .layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .nav {
    display: flex;
    overflow: auto;
    padding-bottom: 3px;
  }
  .nav button {
    white-space: nowrap;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    align-items: flex-start;
  }
  .session {
    text-align: right;
  }
  .spread {
    align-items: flex-start;
    flex-direction: column;
  }
  h1 {
    font-size: 26px;
  }
  .card {
    padding: 16px;
  }
}
