@import url('/fonts.css');

:root {
  color: #2f282a;
  background: #fff;
  font: 15px/1.45 Galano, 'Segoe UI', sans-serif;
  --surface: #f7f7ff;
  --line: #e4e0e3;
  --muted: #655d63;
  --ink: #2f282a;
  --red: #f34e3f;
}
* { box-sizing: border-box; }
.sales-pane { overflow-y: scroll; scrollbar-gutter: stable; }
.sales-pane::-webkit-scrollbar { width: 8px; }
.sales-pane::-webkit-scrollbar-track { background: var(--surface); }
.sales-pane::-webkit-scrollbar-thumb {
  border: 1px solid var(--surface);
  border-radius: 8px;
  background: #7b767c;
}
@supports not selector(::-webkit-scrollbar) {
  .sales-pane { scrollbar-width: thin; scrollbar-color: #7b767c var(--surface); }
}
body { margin: 0; }
main { max-width: 520px; margin: auto; padding: 22px clamp(12px, 5vw, 18px) 28px; }
header { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 18px; border-bottom: 1px solid var(--line); }
header img { display: block; width: 110px; height: auto; }
header button { min-height: 0; padding: 2px 0; color: var(--muted); background: transparent; font-size: .75rem; font-weight: 400; }
h1 { font: 700 21px/1.2 Trans, Galano, 'Segoe UI', sans-serif; margin: 22px 0 12px; }
h2, legend { font-size: .91rem; font-weight: 700; line-height: 1.3; }
h2 { margin: 0 0 10px; }
label { display: block; font-size: .85rem; font-weight: 700; }
small { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); }
#status { margin: 0 0 14px; font-size: .85rem; color: var(--muted); }
#status:empty, #result:empty, nav:empty, .results:empty { display: none; }
#status[data-error] { background: #fff2f0; border-inline-start: 3px solid var(--red); padding: 9px 10px; border-radius: 4px; color: var(--ink); }
#status[data-loading] {
  position: relative;
  display: flex;
  align-items: center;
  min-block-size: 62px;
  padding: 10px 12px 10px 64px;
  color: var(--ink);
  font-weight: 700;
  background: linear-gradient(115deg, #fff2f0, #fff 62%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 12px;
}
#status[data-loading]::before,
#status[data-loading]::after {
  content: '';
  position: absolute;
  inset-block-start: calc(50% - 18px);
  inset-inline-start: 14px;
  inline-size: 36px;
  block-size: 36px;
}
#status[data-loading]::before {
  border: 2px solid var(--line);
  border-top-color: var(--red);
  border-right-color: var(--red);
  border-radius: 50%;
  animation: loading-orbit 1.45s cubic-bezier(.65, 0, .35, 1) infinite;
}
#status[data-loading]::after {
  background: url('/icon-80.png') center / 21px no-repeat;
  animation: loading-mark 1.45s ease-in-out infinite;
}
@keyframes loading-orbit {
  0% { transform: rotate(-35deg); }
  55% { transform: rotate(250deg) scale(1.06); }
  100% { transform: rotate(325deg); }
}
@keyframes loading-mark {
  0%, 100% { transform: rotate(-7deg); }
  44% { transform: translateY(-3px) rotate(11deg) scale(1.09); }
  68% { transform: translateY(1px) rotate(-9deg) scale(.95); }
}
@media (prefers-reduced-motion: reduce) {
  #status[data-loading]::before,
  #status[data-loading]::after { animation: none; }
}
form, fieldset { min-inline-size: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { margin: 0 0 8px; padding: 0; }
input, select, button { font: inherit; color: inherit; }
input:not([type=radio]):not([type=checkbox]):not([type=hidden]), select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 38px;
  margin: 4px 0 0;
  padding: 7px 9px;
  border: 1px solid #bcb6ba;
  border-radius: 8px;
  background: white;
  font-size: .85rem;
}
input::placeholder { color: var(--muted); opacity: 1; }
.sales-pane select {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: 27px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 13px center, right 8px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.sales-pane input[type=date] { -webkit-appearance: none; appearance: none; }
.sales-pane input[type=date]::-webkit-date-and-time-value { text-align: left; }
.sales-pane select:disabled { color: var(--muted); opacity: 1; }
.fair-ai { margin-top: 10px; }
.fair-ai .fair-status { margin: 8px 0 0; overflow-wrap: anywhere; }
.fair-ai .fair-status:empty { display: none; }
.fair-ai .results a { display: inline-block; margin-top: 6px; }
.prospect-defaults { color: var(--muted); margin: 0 0 8px; font-size: .8rem; overflow-wrap: anywhere; }
button {
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--ink);
  color: white;
  font-size: .85rem;
  font-weight: 700;
  padding: 9px 12px;
  min-height: 36px;
  cursor: pointer;
}
button:disabled { opacity: .55; cursor: wait; }
.primary, .secondary { width: 100%; }
.primary { min-height: 42px; }
.secondary { background: white; border-color: var(--line); color: var(--ink); margin-top: 8px; }
a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.action-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.action-switch label { position: relative; min-width: 0; }
.action-switch input { position: absolute; opacity: 0; }
.action-switch span {
  display: grid;
  height: 100%;
  place-items: center;
  min-height: 40px;
  padding: 5px 2px;
  text-align: center;
  font-size: .76rem;
  line-height: 1.2;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.action-switch input:checked + span { background: var(--ink); border-color: var(--ink); color: white; }
.action-switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.panel { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.field + .field, #projects { margin-top: 10px; }
.field label small { display: inline; margin-inline-start: 3px; }
.results { margin-top: 5px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.results button {
  display: block;
  width: 100%;
  background: white;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  text-align: left;
  overflow-wrap: anywhere;
  padding: 7px 9px;
}
.results button + button { border-top: 1px solid var(--line); }
.results button:hover, .results button:focus-visible { background: var(--surface); }
.results button:focus-visible { outline-offset: -2px; }
.results p { padding: 7px 9px; margin: 0; color: var(--muted); font-size: .8rem; }
.deal-fields { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 10px 8px; }
.deal-fields .field { margin-top: 0; }
.deal-field-full { grid-column: 1 / -1; }
.follow-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.follow-series { grid-column: 1 / -1; }
.follow-choices label, .briefing-choice {
  display: flex;
  gap: 7px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.follow-choices label:has(:checked), .briefing-choice:has(:checked) { border-color: var(--red); background: #fff5f3; }
input[type=radio], input[type=checkbox] { accent-color: var(--ink); margin: 3px 0 0; flex: none; }
.briefing-choice { margin-bottom: 14px; }
.mail-party { margin-top: 12px; }
.mail-party .briefing-choice { margin: 0; }
.mail-party .field { margin-top: 9px; }
#mail-party-preview { margin-top: 5px; overflow-wrap: anywhere; }
nav { display: flex; flex-wrap: wrap; gap: 5px 9px; margin-top: 10px; font-size: .75rem; }
details { margin-top: 10px; font-size: .85rem; }
details button { margin-top: 8px; }
#result { margin-top: 12px; font-size: .85rem; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
