.file-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  margin-top: 9px;
  border: 1px solid #b8cfcb;
  background: #fff;
  overflow: hidden;
}

.file-input {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-button {
  align-self: stretch;
  display: flex;
  align-items: center;
  background: var(--teal);
  color: #fff;
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 900;
}

.file-status {
  min-width: 0;
  padding: 5px 0 5px 8px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-picker { background: #fdfcf9; }
.upload .file-picker { width: 100%; }

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
}

.jalali-date-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  margin-top: 6px;
}

.jalali-date-field > input {
  margin: 0;
  border-left: 0;
}

.calendar-toggle {
  border: 0;
  background: var(--deep);
  color: #fff;
  padding: 0 13px;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.jalali-calendar {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  right: 0;
  width: min(310px, calc(100vw - 55px));
  padding: 13px;
  background: #fff;
  border: 1px solid #a9c9c4;
  box-shadow: 0 16px 38px rgba(9, 38, 53, .22);
  color: var(--ink);
}

.calendar-header {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  text-align: center;
  margin-bottom: 10px;
}

.calendar-header strong { font-size: 12px; }

.calendar-header button,
.calendar-footer button {
  border: 1px solid var(--line);
  background: #f5faf8;
  color: var(--teal);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.calendar-header button {
  height: 32px;
  font-size: 20px;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-weekdays b {
  text-align: center;
  color: var(--muted);
  font-size: 9px;
}

.calendar-day {
  aspect-ratio: 1;
  border: 0;
  background: #f7f8f5;
  color: var(--ink);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.calendar-day:hover { background: #dcefeb; }
.calendar-day.today { outline: 1px solid var(--teal); outline-offset: -2px; }
.calendar-day.selected { background: var(--teal); color: #fff; font-weight: 900; }

.calendar-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.calendar-footer button {
  padding: 5px 10px;
  font-size: 9px;
}

.field-error {
  display: block;
  width: 100%;
  margin-top: 5px;
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
}

.invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(157, 63, 54, .08) !important;
}

.check { flex-wrap: wrap; }
.check .field-error { margin: 0 28px 0 0; }
.check a { color: var(--teal); font-weight: 900; }
.public-footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.public-footer-links a { color: #dcecea; text-decoration: none; }

.top-actions, .account-box { display: flex; align-items: center; gap: 12px; }
.account-box { border-right: 1px solid var(--line); padding-right: 12px; font-size: 11px; }
.account-box button { border: 1px solid #a7cec9; background: #fff; color: var(--teal); padding: 6px 10px; font: inherit; cursor: pointer; }
.auth-gate { max-width: 1100px; min-height: calc(100vh - 74px); margin: auto; padding: 70px 30px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 60px; align-items: center; }
.auth-intro h1 { font-size: clamp(31px, 4vw, 54px); line-height: 1.25; margin: 8px 0 20px; }
.auth-intro > p:last-of-type { color: var(--muted); max-width: 650px; }
.auth-security { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.auth-security span { border: 1px solid #a7cec9; color: var(--teal); background: #edf7f4; border-radius: 99px; padding: 6px 12px; font-size: 10px; font-weight: 800; }
.auth-forms { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 26px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: -26px -26px 25px; }
.auth-tabs button { border: 0; border-bottom: 1px solid var(--line); background: #f2f1ed; color: #4b5d66; padding: 14px; font: inherit; font-weight: 900; cursor: pointer; }
.auth-tabs button.active { background: #fff; color: var(--teal); border-bottom-color: #fff; }
.auth-form h2 { margin: 0 0 18px; font-size: 20px; }
.auth-form label { display: block; margin-top: 13px; }
.auth-form > small { display: block; color: var(--muted); font-size: 9px; margin-top: 7px; }
.auth-explain { margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.auth-link { display: block; margin: 11px auto 0; border: 0; background: transparent; color: var(--teal); padding: 5px; font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.otp-confirm { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
#phone-verification .primary { margin-top: 16px; }
#email-verification .primary { margin-top: 16px; }
#auth-message .error, #auth-message .success { margin-top: 15px; }
#auth-message .success { border-right: 5px solid var(--teal); background: #edf7f4; color: var(--teal); padding: 13px; font-size: 11px; }

.email-settings { margin: 0 auto 24px; max-width: 1120px; padding: 24px; border: 1px solid var(--line); background: #fff; display: grid; grid-template-columns: minmax(240px, .8fr) minmax(320px, 1.2fr); gap: 22px; }
.email-settings form { display: grid; gap: 12px; }
.email-settings .primary { width: fit-content; }
.email-activity { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 16px; }
.email-activity h3 { margin: 0 0 10px; }
.email-activity-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.email-activity-row span { color: var(--teal); font-weight: 700; }
.email-activity-row small, .muted { color: var(--muted); }

.steps { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; }
.service-option { border-bottom: 1px solid #315160; padding: 7px 0; margin: 0; }
.quote-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; margin-top: 16px; }
.quote-options select { background: #fff; }
.quote-lines p { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; margin: 0; font-size: 11px; }
.quote-lines b { white-space: nowrap; color: var(--teal); }
.physical-print-card { margin-top: 18px; padding: 14px; border: 1px solid #7aaea8; background: rgba(255,255,255,.06); }
.physical-print-card > p { margin: 4px 0 10px; }
.physical-print-card small { display: block; color: #c8d7da; font-size: 11px; line-height: 1.8; }
.billing-documents { border: 1px solid var(--line); background: #fff; padding: 12px; }
.billing-documents > p { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.billing-documents > p:last-child { border-bottom: 0; }
.billing-documents span, .billing-documents small { display: block; }
.billing-documents small { color: var(--muted); font-size: 10px; }
.billing-documents a { white-space: nowrap; color: var(--teal); font-weight: 900; text-decoration: none; }
.print-fulfillment-form, .print-fulfillment-ready { padding: 16px; border: 1px solid #7aaea8; background: #f4f9f7; }
.print-fulfillment-form > p, .print-fulfillment-ready > p { color: var(--muted); font-size: 11px; }
.print-fulfillment-form .check { color: var(--ink); }
.print-quote-card, .print-payment-card { padding: 16px; border: 1px solid #7aaea8; background: #f4f9f7; }
.print-quote-card > p, .print-payment-card > p { color: var(--muted); font-size: 11px; }
.print-quote-card > a { display: inline-block; margin: 4px 0 8px; color: var(--teal); font-size: 11px; font-weight: 900; }

.manual-payment-card {
  border: 1px solid #4d6f78;
  background: rgba(255, 255, 255, .06);
  padding: 14px;
}
.manual-payment-card > small { display: block; color: #c8d7da; margin-top: 10px; }
.manual-payment-card label { display: block; color: #eef5f5; margin-top: 10px; }
.sandbox-payment { border: 2px solid #e6bb4d; }
.originality-card { border-right: 4px solid var(--teal); padding-right: 12px; }
.originality-card p { font-size: 11px; color: var(--muted); }
.agent-plan > p { font-size: 10px; color: var(--muted); }
.agent-plan ol { padding-right: 18px; }
.agent-plan li { margin-bottom: 10px; padding: 7px; background: #f5f8f7; border-right: 3px solid #a7b7b4; }
.agent-plan li b, .agent-plan li small { display: block; }
.agent-plan li b { font-size: 11px; }
.agent-plan li small { font-size: 9px; color: var(--muted); }
.agent-plan .task-running, .agent-plan .task-queued { border-color: #e6bb4d; }
.agent-plan .task-completed { border-color: var(--teal); }
.agent-plan .task-blocked { border-color: var(--red); background: #fff4f2; }
.job-card { border: 1px solid #bfd7d3; border-right: 4px solid var(--teal); padding: 13px; background: #f5faf8; }
.job-card p { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0; font-size: 10px; }
.job-card p span { color: var(--muted); }
.danger-action { width: 100%; margin-top: 10px; border: 1px solid var(--red); background: #fff; color: var(--red); padding: 9px 12px; font: inherit; font-weight: 900; cursor: pointer; }
.danger-action:hover { background: #fff0ee; }
.danger-action:disabled { opacity: .55; cursor: wait; }
.job-retry_wait { border-right-color: #d19a25; background: #fff9e9; }
.job-failed, .job-dead_letter { border-right-color: var(--red); background: #fff4f2; }

@media (max-width: 700px) {
  .jalali-calendar { right: auto; left: 0; }
  .file-picker { align-items: stretch; flex-direction: column; gap: 0; }
  .file-button, .file-status { justify-content: center; text-align: center; }
  .service-grid, .quote-options { grid-template-columns: 1fr; }
  .auth-gate { grid-template-columns: 1fr; padding: 35px 18px; gap: 25px; }
  .auth-intro h1 { font-size: 34px; }
  .ethical-badge { display: none; }
  .email-settings { grid-template-columns: 1fr; margin-inline: 14px; }
  .email-activity { grid-column: 1; }
  .email-activity-row { grid-template-columns: 1fr auto; }
  .email-activity-row small { grid-column: 1 / -1; }
}
