/* The team app: the site's black ground and type, set for daily work rather than for show. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font: 400 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

h1,
h2 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.14;
}

h1 {
  font-size: clamp(2rem, 3vw + 1rem, 3.25rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1.375rem;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Header */

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 0.875rem var(--gutter);
  background: rgb(6 6 6 / 0.88);
  border-bottom: 1px solid var(--line-light);
  backdrop-filter: blur(12px);
}

.mark {
  flex-shrink: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  white-space: nowrap;
  text-decoration: none;
}

.mark span {
  color: var(--grey);
  font-weight: 400;
}

.sections {
  display: flex;
  gap: 0.25rem;
  margin-right: auto;
}

.sections a,
.tabs a,
.ranges button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--grey);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--quick), background-color var(--quick);
}

.sections a:hover,
.tabs a:hover,
.ranges button:hover {
  color: var(--white);
}

.sections a[aria-current="page"],
.tabs a[aria-current="page"],
.ranges button[aria-pressed="true"] {
  background: var(--black-2);
  color: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-light);
}

.count {
  min-width: 1.375rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.375rem;
  text-align: center;
}

/* Buttons and fields */

.button,
.quiet {
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  background: none;
  color: var(--white);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--quick), color var(--quick), border-color var(--quick);
}

.button:hover {
  border-color: var(--white);
}

.button.is-solid {
  border-color: var(--white);
  background: var(--white);
  color: var(--ink);
}

.button.is-solid:hover {
  background: var(--paper);
}

.quiet {
  border-color: transparent;
  color: var(--grey);
}

.quiet:hover {
  color: var(--white);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--grey);
  font-size: 0.9375rem;
}

input,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: var(--black);
  color: var(--white);
  font: inherit;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:focus-visible,
textarea:focus-visible {
  outline: 0;
  border-color: var(--white);
}

input[type="date"] {
  width: auto;
  min-height: 2.5rem;
  padding: 0 0.875rem;
  border-radius: 999px;
  color-scheme: dark;
}

/* Page */

.page {
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 3.5rem) var(--gutter) 5rem;
}

.head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.tabs,
.ranges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.empty,
.note {
  color: var(--grey);
}

.note {
  font-size: 0.875rem;
}

.empty {
  max-width: 34rem;
  padding: 2.5rem 0;
}

.empty a {
  color: var(--white);
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-small);
  background: var(--black-2);
  box-shadow: inset 0 0 0 1px var(--line-light);
}

.flash.is-bad {
  box-shadow: inset 0 0 0 1px var(--white);
}

.panel {
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border-radius: var(--radius);
  background: var(--black-2);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.label {
  margin-bottom: 0.625rem;
  color: var(--grey);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0;
}

.pill {
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  font-size: 0.8125rem;
}

.dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--white);
}

.status {
  color: var(--grey);
  font-size: 0.875rem;
}

/* Requests */

.requests {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.request {
  display: grid;
  gap: 0.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: var(--black-2);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow var(--quick);
}

.request:hover {
  box-shadow: inset 0 0 0 1px var(--line-light);
}

.request strong {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.request-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.25rem;
}

.request-date {
  margin-left: auto;
  color: var(--grey);
  font-size: 0.875rem;
}

.request-who {
  color: var(--grey);
}

.request-text {
  overflow: hidden;
  color: var(--grey);
  font-size: 0.9375rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request:not(.is-new) strong {
  color: var(--grey);
  font-weight: 400;
}

.back {
  margin-bottom: 1.5rem;
}

.back a {
  color: var(--grey);
}

.request-head {
  display: grid;
  gap: 0.75rem;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line-light);
}

.lead {
  max-width: 44rem;
  color: var(--grey);
  font-size: var(--step-lead);
}

.who {
  color: var(--grey);
}

.who a {
  color: var(--white);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.request-body {
  display: grid;
  gap: 2rem;
}

.stack {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-width: 0;
}

.stack .panel p {
  overflow-wrap: anywhere;
}

.pictures {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.5rem;
}

.pictures img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-small);
}

.prompt textarea {
  margin-top: 1rem;
  font-size: 0.875rem;
}

.talk h2 {
  margin-bottom: 0.5rem;
}

.messages {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.message {
  max-width: 92%;
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius);
  background: var(--black-2);
  overflow-wrap: anywhere;
}

.message.is-out {
  justify-self: end;
  background: var(--white);
  color: var(--ink);
}

.message-meta {
  margin-bottom: 0.25rem;
  color: var(--grey);
  font-size: 0.8125rem;
}

.message.is-out .message-meta {
  color: var(--grey-dark);
}

.answer {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.answer label {
  margin: 0;
}

.answer .button {
  justify-self: start;
}

/* Sign in */

.login {
  display: grid;
  gap: 1.5rem;
  max-width: 24rem;
  margin: 12vh auto 0;
}

.login form {
  display: grid;
  gap: 1rem;
}

.login label {
  margin: 0;
}

/* Visitors */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tile {
  padding: clamp(0.875rem, 2vw, 1.25rem) clamp(1rem, 2.5vw, 1.5rem);
  font-size: clamp(0.8125rem, 0.5vw + 0.7rem, 1rem);
  border-radius: var(--radius);
  background: var(--black-2);
  color: var(--grey);
}

.tile strong {
  display: block;
  color: var(--white);
  font-size: clamp(1.5rem, 2.5vw + 0.9rem, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.chart {
  position: relative;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  align-items: end;
  gap: 2px;
  height: 13rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line-light);
}

.bar-slot {
  position: relative;
  display: flex;
  align-items: end;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: default;
}

.bar-slot[data-day] {
  cursor: pointer;
}

.bar-fill {
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--white);
  transition: opacity var(--quick);
}

.bar-slot.is-empty .bar-fill {
  background: var(--line-light);
}

.chart:hover .bar-fill {
  opacity: 0.45;
}

.chart .bar-slot:hover .bar-fill,
.chart .bar-slot:focus-visible .bar-fill {
  opacity: 1;
}

.bar-tick {
  position: absolute;
  top: 100%;
  left: 50%;
  padding-top: 0.5rem;
  color: var(--grey);
  font-size: 0.75rem;
  white-space: nowrap;
  transform: translateX(-50%);
}

.tip {
  position: absolute;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-small);
  background: var(--white);
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 0.5rem));
}

.tip[hidden] {
  display: none;
}

.breakdowns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.ranks {
  display: grid;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranks li {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.9375rem;
}

.ranks li::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--share);
  border-radius: 6px;
  background: var(--line-light);
  content: "";
}

.ranks span {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranks b {
  position: relative;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ranks .empty,
.visits .empty {
  padding: 0;
  font-size: 0.9375rem;
}

.ranks .empty::before {
  display: none;
}

.table-wrap {
  max-height: 32rem;
  overflow: auto;
}

.visits {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.visits th {
  position: sticky;
  top: 0;
  padding: 0 1rem 0.625rem 0;
  background: var(--black-2);
  color: var(--grey);
  font-weight: 400;
  text-align: left;
}

.visits td {
  padding: 0.625rem 1rem 0.625rem 0;
  border-top: 1px solid var(--line-light);
  white-space: nowrap;
}

.visits td:first-child {
  color: var(--grey);
  font-variant-numeric: tabular-nums;
}

[data-visitors].is-loading {
  opacity: 0.6;
}

.page > .note {
  margin-top: 1.5rem;
}

@media (min-width: 62rem) {
  .request-body {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
  }

  .talk {
    position: sticky;
    top: 5.5rem;
  }
}

/* Nine sections, the languages and sign out do not fit one row below a very wide screen: the sections get their own. */
@media (max-width: 90rem) {
  .bar {
    flex-wrap: wrap;
    gap: 0.75rem 0.5rem;
  }

  .sections {
    order: 3;
    width: 100%;
    margin-right: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sections a {
    flex: none;
  }

  .languages {
    margin-left: auto;
  }
}

@media (max-width: 40rem) {
  .sections a {
    padding: 0 0.75rem;
  }

  .bar .quiet {
    padding: 0 0.5rem;
  }

  .languages button {
    min-width: 2rem;
    padding: 0 0.375rem;
  }

  .bar-tick:not(.is-shown) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none;
  }
}

/* From visit to request */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--grey);
}

.steps li {
  display: grid;
  align-content: start;
  gap: 0.125rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line-light);
}

.steps strong {
  color: var(--white);
  font-size: clamp(1.5rem, 2vw + 1rem, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.14;
  font-variant-numeric: tabular-nums;
}

.steps span {
  font-size: 0.875rem;
}

/* Feedback */

.feedbacks {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feedback {
  display: grid;
  gap: 0.5rem;
  overflow-wrap: anywhere;
}

.feedback form {
  justify-self: start;
  margin-left: -1.25rem;
}

.feedback .status a {
  color: var(--white);
}

.rating {
  color: var(--grey);
}

.rating strong {
  color: var(--white);
  font-weight: 500;
}

.came {
  color: var(--grey);
}

.came strong {
  color: var(--white);
  font-weight: 500;
}

.ranks b {
  flex: none;
  white-space: nowrap;
}

.ranks.channels {
  max-width: 44rem;
}

/* Businesses */

.figures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  color: var(--grey);
  font-size: 0.9375rem;
}

.figures b {
  color: var(--white);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.add-business {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.add-business .fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.add-business label {
  margin: 0;
}

.add-business input,
.add-business select {
  margin-top: 0.5rem;
}

select {
  min-height: 2.875rem;
  padding: 0 2.25rem 0 1rem;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: var(--black);
  color: var(--white);
  font: inherit;
}

.add-business .button {
  justify-self: start;
}

.stack-gap {
  display: grid;
  gap: 1rem;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
}

.copy-row input {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.875rem;
}

.steps-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.25rem;
  color: var(--grey);
}

code {
  color: var(--white);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
}

.month {
  display: flex;
  gap: 0.5rem;
}

.month input {
  width: auto;
  color-scheme: dark;
}

.tabs + .panel {
  margin-top: 0.75rem;
}

.table-wrap.is-wide {
  max-height: none;
}

.books {
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.books th,
.books td {
  padding: 0.375rem 0.75rem;
  text-align: right;
  white-space: nowrap;
}

.books th:first-child,
.books .is-text {
  text-align: left;
}

.books thead th {
  color: var(--grey);
  font-weight: 400;
  border-bottom: 1px solid var(--line-light);
  vertical-align: bottom;
}

.books tbody th {
  font-weight: 400;
}

.books tbody tr:nth-child(even) {
  background: rgb(246 246 243 / 0.03);
}

.books .is-total th,
.books .is-total td {
  color: var(--white);
  font-weight: 600;
}

.books tr:not(.is-total) td {
  color: var(--grey);
}

.books .is-indent th {
  padding-left: 1.5rem;
}

.books .is-heading th {
  padding-top: 1rem;
  color: var(--grey);
}

.page > .actions {
  margin-top: 1rem;
}

.page > .prompt {
  margin-top: 2rem;
}

@media (max-width: 40rem) {
  .tiles.is-money {
    grid-template-columns: minmax(0, 1fr);
  }

  .add-business .fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

a.button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* Language switch in the header */

.languages {
  display: flex;
  gap: 0.125rem;
}

.languages button {
  min-width: 2.25rem;
  min-height: 2.5rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--grey);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--quick), background-color var(--quick);
}

.languages button:hover {
  color: var(--white);
}

.languages button[aria-pressed="true"] {
  background: var(--black-2);
  color: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-light);
}

/* Report controls: view, real or test figures, report language */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.75rem;
}

.controls .tabs + .tabs {
  padding-left: 1.5rem;
  border-left: 1px solid var(--line-light);
}

@media (max-width: 40rem) {
  .controls .tabs + .tabs {
    padding-left: 0;
    border-left: 0;
  }
}

/* Clients and prices */

.app-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-chips li {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  font-size: 0.875rem;
}

.app-table th .note {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  font-weight: 400;
}

.app-table tr:not(.is-on):not(.is-heading) th,
.app-table tr:not(.is-on):not(.is-heading) td {
  opacity: 0.55;
}

.app-table input[type="number"] {
  width: 6rem;
  padding: 0.375rem 0.5rem;
  text-align: right;
}

.app-table select {
  min-height: 2.25rem;
  padding: 0 1.75rem 0 0.625rem;
  font-size: 0.875rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  color: var(--white);
  font-size: 0.9375rem;
  cursor: pointer;
}

.check input {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--white);
}

.fields-wide {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.head .button {
  align-self: center;
}

.add-business select {
  display: block;
  width: 100%;
}

.discounts {
  display: grid;
  gap: 0.5rem;
}

.discount-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.discount-row select {
  flex: 1;
  max-width: 20rem;
}

.discount-row input {
  width: 5rem;
  text-align: right;
}

/* Prompts */

.prompt-fill {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.prompt-fill label {
  margin: 0;
}

.prompt-fill input {
  max-width: 24rem;
}

.prompt-group {
  margin: 2.5rem 0 0.75rem;
}

.prompt-card + .prompt-card {
  margin-top: 0.75rem;
}

.prompt-card h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
}

.prompt-card textarea {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

/* Billing: a website that does not answer shows a hollow dot; quotes are a plain list. */
.dot.is-bad {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--white);
}

.site-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plain-list {
  display: grid;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A link the owner copies by hand (an invitation that could not be mailed). */
.break {
  word-break: break-all;
}

/* Panels and tiles that follow other blocks on a page keep a little air between them. */
.page > :is(.panel, .tiles, .flash):not(:first-child, .add-business, .prompt) {
  margin-top: 1rem;
}

/* A panel reached by its anchor (after an invitation or a connect code) stops below the sticky header. */
.page :target {
  scroll-margin-top: 8rem;
}

/* The customer area: the language choice on the welcome page stays one row, and on a phone each row of
   a table is a block of its own, so a price or a state never hides behind a sideways scroll. */
.login form.languages {
  display: flex;
  gap: 0.125rem;
  margin-left: 0;
}

@media (max-width: 40rem) {
  .books.is-stacked,
  .books.is-stacked tbody {
    display: block;
  }

  .books.is-stacked thead {
    display: none;
  }

  .books.is-stacked tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.125rem 1rem;
    padding: 0.75rem;
  }

  .books.is-stacked th,
  .books.is-stacked td {
    padding: 0;
    text-align: left;
    white-space: normal;
  }

  .books.is-stacked tbody th {
    grid-column: 1 / -1;
    font-weight: 500;
  }

  .books.is-stacked td[data-label]::before {
    content: attr(data-label) " ";
  }
}
