/* The service desk card of Meridale Motors, an invented car dealership, alone on white. The rows of the three advisors
   get their heights from script.js (rest, open, folded); one soft "glider" slides under the open row. */
:root {
  --fondo: #ffffff;          /* the page */
  --carta: #fcfcfb;          /* the card */
  --inchiostro: #16171a;     /* the words */
  --grigio: #6f7178;         /* the small words */
  --tenue: #b3b5bb;          /* the quietest words */
  --linea: rgba(22, 23, 26, 0.075); /* thin lines and edges */
  --accento: #3556d8;        /* the accent: the call pill, the ring, the copy tick */
  --accento-tenue: rgba(53, 86, 216, 0.09);
  --libero: #1d8656;         /* the words "Available" */
  --occupato: #b0611c;       /* the words "On a call" */
  --grafite: #1c1d21;        /* the call button */
  --font: 'Mona Sans Variable', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
a { color: inherit; text-decoration: none; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(8px, 3vh, 32px) 12px;
}

.desk {
  position: relative;
  width: min(384px, 92vw);
  padding: clamp(11px, 2.6vh, 18px) clamp(11px, 3.4vw, 16px) clamp(10px, 2.2vh, 14px);
  border-radius: 24px;
  background:
    radial-gradient(110% 55% at 100% 0%, rgba(53, 86, 216, 0.055), transparent 62%),
    linear-gradient(180deg, #ffffff, var(--carta));
  border: 1px solid rgba(22, 23, 26, 0.07);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 1px 2px rgba(22, 23, 26, 0.05),
    0 10px 24px -8px rgba(22, 23, 26, 0.12),
    0 36px 70px -30px rgba(22, 23, 26, 0.26);
  overflow: hidden;
}
/* a very fine grain over the card */
.desk__grain {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0.35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.desk__head { position: relative; display: flex; align-items: center; gap: 10px; margin: 0 2px clamp(8px, 1.8vh, 12px); }
.desk__icon {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(155deg, #34363d, #121316);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 5px 12px -4px rgba(18, 19, 22, 0.5);
}
.desk__icon svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 1.45; stroke-linejoin: round; }
.desk__meta { display: flex; flex-direction: column; line-height: 1.18; flex: 1; min-width: 0; }
.desk__title { font-weight: 650; font-size: 15px; letter-spacing: -0.012em; }
.desk__sub { font-size: 12px; color: var(--grigio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk__chip {
  flex: none; font-size: 11px; font-weight: 560; color: var(--grigio);
  padding: 5px 9px; border-radius: 999px; border: 1px solid var(--linea); background: #fff;
}

.team { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }

/* the soft plate that slides under the open row */
.glider {
  position: absolute; left: 0; right: 0; top: 0; height: 0;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(22, 23, 26, 0.07);
  box-shadow: 0 1px 0 #fff inset, 0 1px 2px rgba(22, 23, 26, 0.05), 0 12px 26px -14px rgba(22, 23, 26, 0.28);
  opacity: 0;
  pointer-events: none;
}
.glider::after {
  /* a hairline of light along the top edge */
  content: ''; position: absolute; left: 14%; right: 14%; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(53, 86, 216, 0.45), transparent);
}

.rep { position: relative; z-index: 1; border-radius: 16px; overflow: hidden; }
.rep__main { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 6px; height: 60px; }
.rep__open {
  flex: 1; min-width: 0; height: 100%;
  display: flex; align-items: center; gap: 11px;
  border-radius: 12px;
}
.rep__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.rep__name { font-size: 14px; font-weight: 620; letter-spacing: -0.008em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-stretch: 100%; }
.rep__role { font-size: 12px; color: var(--grigio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep__state { font-variant-numeric: tabular-nums; font-weight: 540; }
.rep__state.is-free { color: var(--libero); }
.rep__state.is-busy { color: var(--occupato); }
.rep__state.is-away { color: var(--grigio); }

/* the abstract avatars: no faces, a colour field with one geometric shape that turns when the row opens */
.ava {
  position: relative; flex: none;
  width: 40px; height: 40px; border-radius: 13px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 0 0 1px rgba(22, 23, 26, 0.06), 0 6px 12px -6px rgba(22, 23, 26, 0.35);
}
.ava svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ava__shape { transform-origin: 50% 50%; }
.ava__sheen {
  position: absolute; inset: -20% auto -20% -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-14deg);
  opacity: 0;
}

/* the call button: a graphite circle that grows into a pill with the name */
.call {
  position: relative; flex: none;
  height: 36px; width: 36px; border-radius: 999px;
  display: flex; align-items: center; gap: 7px; padding: 0 0 0 10px;
  background: linear-gradient(180deg, #2b2d33, var(--grafite));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 6px 14px -6px rgba(18, 19, 22, 0.55);
  overflow: visible;
  white-space: nowrap;
}
.call__icon { width: 16px; height: 16px; flex: none; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; transform-origin: 50% 60%; }
.call__clip { overflow: hidden; display: block; height: 16px; line-height: 16px; }
.call__label { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em; opacity: 0; }
.call__ring { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); pointer-events: none; overflow: visible; opacity: 0; }
.call__ring rect { fill: none; stroke: var(--accento); stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(53, 86, 216, 0.55)); }
.call.is-calling { background: linear-gradient(180deg, #4062e4, var(--accento)); }
@media (hover: hover) {
  .call:hover .call__icon { animation: squillo 0.6s cubic-bezier(.3, 1.4, .5, 1); }
}
@keyframes squillo {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-14deg); }
  45% { transform: rotate(10deg); }
  70% { transform: rotate(-5deg); }
}

/* the detail under the open row */
.rep__detail { height: 0; overflow: hidden; }
.rep__inner { padding: 0 10px 11px 57px; display: flex; flex-direction: column; gap: 8px; }
.line {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 10px; border-radius: 11px;
  background: rgba(22, 23, 26, 0.03);
  border: 1px solid var(--linea);
}
.line__label { font-size: 11px; color: var(--grigio); white-space: nowrap; }
.line__num { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.005em; flex: 1; white-space: nowrap; }
.copy {
  position: relative; flex: none; height: 24px; min-width: 24px; padding: 0 7px; border-radius: 8px;
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 580; color: var(--grigio);
  background: #fff; border: 1px solid var(--linea);
  box-shadow: 0 1px 1px rgba(22, 23, 26, 0.04);
  transition: color 0.2s, border-color 0.2s;
}
.copy svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.copy__tick { position: absolute; left: 7px; top: 50%; margin-top: -6.5px; }
.copy__tick path { stroke: var(--accento); stroke-width: 1.9; stroke-dasharray: 12; stroke-dashoffset: 12; }
.copy__words { position: relative; display: block; height: 14px; overflow: hidden; line-height: 14px; }
.copy__roll { display: block; }
.copy__roll span { display: block; }
.copy.is-done { color: var(--accento); border-color: rgba(53, 86, 216, 0.25); }
@media (hover: hover) {
  .copy:hover { color: var(--inchiostro); border-color: rgba(22, 23, 26, 0.16); }
  .copy.is-done:hover { color: var(--accento); }
}
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 11px; font-weight: 540; color: #45474e;
  padding: 3px 8px; border-radius: 999px;
  background: #fff; border: 1px solid var(--linea);
}
.tag--accent { color: #2b47b6; background: var(--accento-tenue); border-color: transparent; }

/* the foot: how busy the workshop is today, and the booking link */
.desk__foot {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: clamp(8px, 1.8vh, 12px); padding: clamp(8px, 1.6vh, 11px) 4px 0;
  border-top: 1px solid var(--linea);
}
.bays { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 11.5px; color: var(--grigio); }
.bays__label { white-space: nowrap; }
.bays__bar { display: flex; gap: 2px; }
.bays__bar i { display: block; width: 4px; height: 11px; border-radius: 2px; background: rgba(22, 23, 26, 0.1); transform-origin: 50% 100%; }
.bays__bar i.is-on { background: linear-gradient(180deg, #5874e6, var(--accento)); }
.bays__count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bays__count b { color: var(--inchiostro); font-weight: 620; }
.desk__book { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 600; color: var(--accento); white-space: nowrap; padding: 4px 2px 4px 6px; border-radius: 8px; }
.desk__book svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.35s cubic-bezier(.3, 1.6, .5, 1); }
@media (hover: hover) { .desk__book:hover svg { transform: translateX(3px); } }

@media (max-width: 440px) {
  .line__label { display: none; }
  .rep__inner { padding-left: 51px; }
}
@media (max-width: 360px) {
  .bays__label { display: none; }
}

.pointer {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; margin: -3px 0 0 -4px;
  fill: #16171a; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  opacity: 0;
  z-index: 20;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rep__open:focus, .call:focus, .copy:focus, .desk__book:focus { outline: none; }
.rep__open:focus-visible, .call:focus-visible, .copy:focus-visible, .desk__book:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
