@font-face {
  font-family: Assistant;
  src: url("/fonts/assistant-hebrew-400-normal.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0590-05ff, U+200c-2010, U+20aa, U+25cc, U+fb1d-fb4f;
}
@font-face {
  font-family: Assistant;
  src: url("/fonts/assistant-latin-400-normal.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0000-00ff, U+2000-206f;
}
:root {
  --green: #129d50;
  --dark: #12233f;
  --muted: #526780;
  --line: #dfe7ef;
  --bg: #eff4f9;
  --red: #a82f37;
  --radius: 18px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--dark);
  font-family: Assistant, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
button,
input,
select,
textarea {
  font: inherit;
}
a {
  color: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 22px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: white;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.secondary,
.button.secondary {
  background: white;
  color: var(--dark);
  border: 1px solid var(--line);
}
button.danger {
  background: #fff0f0;
  color: var(--red);
}
button.text {
  background: none;
  color: var(--muted);
  padding: 8px;
}
.brand {
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand:before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--green);
  color: white;
  border-radius: 10px;
}
.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 5%;
  background: #ffffffed;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar nav {
  display: flex;
  gap: 8px;
}
.topbar nav a {
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 10px;
  color: var(--muted);
}
.topbar nav a.active {
  background: #e7f5ec;
  color: #087a3a;
  font-weight: 700;
}
.layout {
  max-width: 1120px;
  margin: auto;
  padding: 38px 24px 100px;
}
.narrow {
  max-width: 650px;
}
.login {
  max-width: 480px;
  margin: 7vh auto;
  padding: 30px;
}
.login h1 {
  font-size: 34px;
  margin-bottom: 10px;
}
h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 23px;
  line-height: 1.3;
  margin: 0 0 16px;
}
h3 {
  margin: 0 0 8px;
}
p {
  margin: 8px 0 18px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  color: #11773f;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 5px 24px #12233f05;
}
.layout > .card + .card {
  margin-top: 18px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.stack > * + * {
  margin-top: 14px;
}
.field {
  display: block;
  margin: 14px 0;
}
label > span {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}
input:not([type="checkbox"]):not([type="color"]),
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd6e3;
  border-radius: 10px;
  background: white;
  color: var(--dark);
  outline: none;
  min-height: 48px;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #129d5015;
}
textarea {
  resize: vertical;
  min-height: 100px;
}
input[type="tel"],
input[type="email"],
input[inputmode="numeric"] {
  direction: ltr;
  text-align: right;
}
input[type="color"] {
  width: 72px;
  height: 44px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0;
  font-size: 15px;
}
.check input {
  margin-top: 6px;
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  flex: none;
}
.error {
  padding: 14px;
  border: 1px solid #f0c4c7;
  border-radius: 12px;
  background: #fff3f3;
  color: var(--red);
  white-space: pre-wrap;
  margin: 12px 0;
}
.banner {
  padding: 10px 20px;
  background: #fff0c7;
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid #e7d08d;
}
.success {
  padding: 15px;
  border-radius: 12px;
  background: #e7f5ec;
  color: #116832;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 26px 0;
}
.stat small {
  display: block;
  color: var(--muted);
}
.stat b {
  font-size: 36px;
  line-height: 1.3;
}
.empty {
  text-align: center;
  padding: 60px 24px;
}
.empty .symbol {
  font-size: 50px;
  color: var(--green);
  margin-bottom: 16px;
}
.tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin: 24px 0 14px;
}
.tabs button {
  background: white;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid var(--line);
  padding: 7px 18px;
  min-height: 38px;
}
.tabs .active {
  background: var(--dark);
  color: white;
}
.quote-row {
  display: grid;
  grid-template-columns: 1fr 130px 120px 100px;
  gap: 20px;
  align-items: center;
  padding: 20px 6px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.quote-row:last-child {
  border: 0;
}
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  background: #eef1f5;
  color: #526780;
}
.badge.signed {
  background: #e7f5ec;
  color: #136a3c;
}
.badge.opened {
  background: #e9f0ff;
  color: #375b9a;
}
.badge.ready {
  background: #fff3d4;
  color: #8b681f;
}
.new {
  color: #128047;
  font-size: 14px;
}
.progress {
  height: 6px;
  background: #dce5ef;
  border-radius: 10px;
  margin: 20px 0 32px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--green);
}
.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.templates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.template {
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--dark);
  display: block;
  text-align: right;
}
.template.selected {
  border-color: var(--green);
}
.template .mini {
  height: 160px;
  overflow: hidden;
  pointer-events: none;
  background: #ddd;
}
.template .mini > div {
  width: 600px;
  transform: scale(0.28);
  transform-origin: top right;
}
.template .name {
  display: block;
  padding: 12px;
  font-weight: 700;
}
.template .q {
  margin: 0;
}
dialog {
  border: 0;
  border-radius: 20px;
  max-width: 900px;
  width: calc(100% - 28px);
  padding: 24px;
  max-height: 92vh;
  overflow: auto;
}
dialog::backdrop {
  background: #12233f88;
}
.modal-head {
  position: sticky;
  top: -24px;
  background: white;
  padding: 15px 0;
  z-index: 5;
}
.editor {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(350px, 1fr);
  gap: 24px;
  align-items: start;
}
.edit-items .item {
  padding: 16px;
  background: #f6f8fb;
  border-radius: 12px;
  margin-bottom: 12px;
}
.edit-items textarea {
  min-height: 60px;
}
.preview {
  position: sticky;
  top: 100px;
  max-height: 80vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.plans {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 25px 0;
}
.plan {
  padding: 22px 16px;
  text-align: center;
}
.plan.featured {
  border: 2px solid var(--green);
}
.plan .price {
  font-size: 34px;
  font-weight: 800;
}
.plan button {
  width: 100%;
  padding-inline: 8px;
}
.public {
  max-width: 840px;
  margin: 24px auto 70px;
  padding: 0 12px;
}
.sign-box {
  margin-top: 20px;
}
.signature-pad {
  display: block;
  width: 100%;
  height: 180px;
  border: 1px dashed #9fadc0;
  border-radius: 12px;
  touch-action: none;
  background: #fff;
}
.notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #12233f;
  color: white;
  padding: 12px 22px;
  border-radius: 14px;
  z-index: 100;
  max-width: 90%;
  box-shadow: 0 8px 30px #0003;
}
.loading {
  text-align: center;
  padding: 70px;
  color: var(--muted);
}
.full {
  width: 100%;
}
.small {
  font-size: 14px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
footer {
  font-size: 14px;
  color: var(--muted);
  margin-top: 35px;
  text-align: center;
}
footer a {
  margin: 0 8px;
}
.saved {
  font-size: 14px;
  color: #167846;
}
.receipt {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.mobile-only {
  display: none;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  direction: ltr;
  text-align: left;
}
@media (max-width: 800px) {
  .topbar {
    height: auto;
    min-height: 65px;
    padding: 14px 20px;
    flex-wrap: wrap;
  }
  .topbar nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .topbar nav a {
    padding: 6px 12px;
  }
  .layout {
    padding: 24px 16px 70px;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 16px;
  }
  .stat b {
    font-size: 28px;
  }
  .quote-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .quote-row .date {
    font-size: 14px;
  }
  .editor {
    display: block;
  }
  .preview {
    position: static;
    max-height: none;
    margin-top: 20px;
  }
  .plans {
    grid-template-columns: 1fr 1fr;
  }
  .templates {
    grid-template-columns: 1fr 1fr;
  }
  .two {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 20px;
  }
  .login {
    padding: 24px;
    margin: 4vh auto;
  }
  .q-hero,
  .q-cover {
    height: 220px;
  }
  dialog {
    padding: 16px;
  }
  .modal-head {
    top: -16px;
  }
  .public {
    margin-top: 14px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  a {
    transition:
      background 0.15s,
      border-color 0.15s;
  }
  .card {
    animation: appear 0.2s ease;
  }
  @keyframes appear {
    from {
      opacity: 0.6;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
:focus-visible {
  outline: 3px solid #226cc3;
  outline-offset: 3px;
}

.legal-table { overflow-x: auto; margin-block: 20px; }
.legal-table table { width: 100%; border-collapse: collapse; text-align: right; }
.legal-table th, .legal-table td { padding: 10px 8px; border-bottom: 1px solid #e5e7eb; }
