@font-face {
  font-family: 'Archivo Narrow';
  src: url('/fonts/archivo-narrow-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Archivo Narrow';
  src: url('/fonts/archivo-narrow-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #151515;
  --ink-2: #3a3a3a;
  --ink-3: #6b6b6b;
  --ink-4: #9b9b9b;
  --line: #e7e7e4;
  --line-2: #d2d2ce;
  --paper: #ffffff;
  --canvas: #f6f6f4;
  --sunken: #efefec;
  --accent: #ffd400;
  --good: #1d7a46;
  --warn: #e59a00;
  --warn-soft: #fbf1de;
  --bad: #bf3329;
  --bad-soft: #fbe9e7;
  --radius: 3px;
  --body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --narrow: 'Archivo Narrow', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sidebar: 224px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

.label {
  font-family: var(--narrow);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

.muted {
  color: var(--ink-3);
}

.small {
  font-size: 12.5px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

/* Shell */

.main {
  min-width: 0;
  padding: 32px 40px 64px;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: #f2f2f2;
  padding: 28px 0 20px;
}

.wordmark {
  display: block;
  padding: 0 24px 32px;
  text-decoration: none;
}

.wordmark-name {
  display: block;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.34em;
}

.nav {
  display: flex;
  flex-direction: column;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  font-family: var(--narrow);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a9a9a9;
  text-decoration: none;
}

.nav a:hover {
  color: #ffffff;
}

.nav a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--accent);
}

.nav svg {
  width: 17px;
  height: 17px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px 24px 0;
  border-top: 1px solid #2a2a2a;
  font-size: 12px;
  color: #9a9a9a;
}

.sidebar-foot .status {
  color: #d8d8d8;
}

.sidebar-foot a {
  color: #d8d8d8;
  text-decoration: none;
}

.sidebar-action {
  margin-top: 6px;
}

.sidebar-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

.sidebar-email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-link {
  flex: none;
  padding: 0;
  border: none;
  background: none;
  color: #d8d8d8;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.sidebar-link:hover {
  color: #ffffff;
}

/* Sign-in and the first password change, outside the app's layout */

.gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.gate-card {
  width: min(400px, 100%);
  padding: 32px 32px 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.gate-brand {
  margin-bottom: 28px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.34em;
}

.gate-title {
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 700;
}

.gate-note {
  margin: -12px 0 20px;
}

.gate-card .btn-primary {
  width: 100%;
}

.gate-foot {
  margin-top: 16px;
  text-align: center;
}

.form-error {
  min-height: 1.45em;
  color: var(--bad);
  font-size: 13px;
}

/* Settings: Team */

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.member-row:last-child {
  border-bottom: none;
}

.member-main {
  flex: 1;
  min-width: 0;
}

.member-email {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.team-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
}

/* Page header */

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-header > div:first-child {
  min-width: 0;
}

.page-header > .actions {
  flex: none;
  flex-wrap: nowrap;
}

.crumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--narrow);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.crumbs a {
  color: var(--ink-3);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink);
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: 8px;
  color: var(--ink-3);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.actions.end {
  justify-content: flex-end;
}

/* Panels */

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  font-family: var(--narrow);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-body {
  padding: 20px;
}

.panel-body.flush {
  padding: 0;
}

.panel-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--canvas);
}

.panel-intro {
  margin-bottom: 14px;
}

.notice {
  margin-bottom: 20px;
}

.layout-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.layout-split > aside {
  position: sticky;
  top: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}

.stack > * + * {
  margin-top: 12px;
}

.inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline.spread {
  justify-content: space-between;
}

.inline.grow {
  flex: 1;
}

.inline svg {
  flex: none;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}

.btn:hover:not(:disabled) {
  border-color: var(--ink-3);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #000000;
  border-color: #000000;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--sunken);
  border-color: transparent;
}

.btn-danger {
  color: var(--bad);
}

.btn-danger:hover:not(:disabled) {
  border-color: var(--bad);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
}

/* Forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  min-width: 0;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.field-hint {
  font-size: 12px;
  color: var(--ink-4);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.textarea {
  height: auto;
  min-height: 96px;
  padding: 8px 10px;
  line-height: 1.5;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23151515' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.55);
}

.input:disabled {
  background: var(--canvas);
  color: var(--ink-3);
}

.input-sm,
.select-sm {
  height: 30px;
  font-size: 13px;
}

.input-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

input[type='number'] {
  appearance: textfield;
}

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.w-xs {
  width: 72px;
}

.w-sm {
  width: 104px;
}

.w-md {
  width: 180px;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  position: sticky;
  top: 0;
  padding: 10px 14px;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
  font-family: var(--narrow);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  white-space: nowrap;
}

.table th.num {
  text-align: right;
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover td {
  background: #fbfbfa;
}

.table a.row-link {
  font-weight: 600;
  text-decoration: none;
}

.table a.row-link:hover {
  text-decoration: underline;
}

/* Status, tags, callouts */

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-2);
}

.status::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-4);
}

.status-good::before {
  background: var(--good);
}

.status-warn::before {
  background: var(--warn);
}

.status-bad::before {
  background: var(--bad);
}

.status-active::before {
  background: var(--accent);
  box-shadow: 0 0 0 1px #c9a800;
}

.tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--sunken);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}

.callout {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: #5c3b00;
}

.callout-bad {
  background: var(--bad-soft);
  color: #6d1d17;
}

.callout svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.callout ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

/* Settings */

.tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tabs button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
}

.tabs button:hover {
  color: var(--ink);
}

.tabs button[aria-selected='true'] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--accent);
}

.settings-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.steps {
  margin: 16px 0;
  padding-left: 20px;
  line-height: 1.8;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

/* Lists of steps and items */

.checklist,
.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist li,
.item-list li {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.checklist li {
  display: flex;
  gap: 12px;
}

.checklist li:last-child,
.item-list li:last-child {
  border-bottom: none;
}

.checklist .mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
}

.checklist .mark svg {
  width: 11px;
  height: 11px;
}

.checklist .done .mark {
  background: var(--good);
  border-color: var(--good);
  color: #ffffff;
}

.checklist .attention .mark {
  border-color: var(--warn);
  color: var(--warn);
}

.item-body {
  flex: 1;
  min-width: 0;
}

.item-title {
  display: block;
  font-weight: 600;
}

a.item-title {
  text-decoration: none;
}

a.item-title:hover {
  text-decoration: underline;
}

.item-text {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.item-action {
  margin-top: 8px;
}

.earlier-links {
  margin-top: 10px;
}

/* Drop zone and progress */

.dropzone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--canvas);
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    background 0.12s ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--ink);
  background: var(--paper);
}

.dropzone-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
}

.dropzone-icon svg {
  width: 18px;
  height: 18px;
}

.dropzone-main {
  flex: 1;
  min-width: 0;
}

.dropzone-title {
  font-weight: 600;
}

.dropzone-title u {
  text-underline-offset: 2px;
}

.dropzone input[type='file'] {
  display: none;
}

.progress {
  height: 4px;
  border-radius: 2px;
  background: var(--sunken);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--ink);
  transition: width 0.3s ease;
}

/* Empty and loading states */

.empty {
  padding: 56px 24px;
  text-align: center;
}

.empty-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--sunken);
}

.empty-mark svg {
  width: 20px;
  height: 20px;
}

.empty-title {
  font-weight: 700;
  font-size: 15px;
}

.empty .btn {
  margin-top: 18px;
}

.skeleton {
  display: block;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--sunken) 0%, #f7f7f5 50%, var(--sunken) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.skeleton:nth-child(3n + 1) {
  width: 90%;
}

.skeleton:nth-child(3n + 2) {
  width: 72%;
}

.skeleton:nth-child(3n) {
  width: 54%;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

/* Dialog */

.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
}

.dialog::backdrop {
  background: rgba(21, 21, 21, 0.45);
}

.dialog-body {
  padding: 22px 24px 8px;
}

.dialog-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
}

.dialog-text {
  color: var(--ink-2);
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px 24px 20px;
}

/* Toasts */

.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 48px));
}

.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  animation: toast-in 0.18s ease-out;
}

.toast svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.toast-success svg {
  color: #6fd39b;
}

.toast-error {
  background: var(--bad);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Files */

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.file-row:last-child {
  border-bottom: none;
}

.file-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--sunken);
  font-family: var(--narrow);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.file-main {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name a {
  text-decoration: none;
}

.file-name a:hover {
  text-decoration: underline;
}

.file-path {
  font-size: 12px;
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.style-section {
  padding: 18px 20px;
}

.spec-choices {
  max-height: 320px;
  overflow-y: auto;
}

.style-section + .style-section {
  border-top: 1px solid var(--line);
}

.style-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.style-section-title {
  font-weight: 700;
  font-size: 15px;
}

.search-block {
  margin-top: 14px;
}

.search-label {
  margin: 20px 0 8px;
}

.search-row {
  display: flex;
  gap: 8px;
}

.results-note {
  margin-top: 12px;
}

/* Links and the factory email */

.link-box {
  display: flex;
  gap: 8px;
}

.link-box .input {
  font-family: var(--mono);
  font-size: 12.5px;
}

.message-box {
  font-family: var(--mono);
  font-size: 12.5px;
  min-height: 260px;
}

.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
}

.kv dt {
  color: var(--ink-3);
}

.kv dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.kv dd.kv-sent {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

details.disclosure > summary {
  list-style: none;
  cursor: pointer;
}

details.disclosure > summary::-webkit-details-marker {
  display: none;
}

details.disclosure > summary .chevron {
  display: inline-flex;
  transition: transform 0.15s ease;
}

details.disclosure[open] > summary .chevron {
  transform: rotate(90deg);
}

details.disclosure > summary svg {
  width: 14px;
  height: 14px;
}

/* Work in progress: what is happening, the share done in large figures, a thick bar */

.progress-view {
  margin-top: 16px;
}

.panel-body > .progress-view:first-child {
  margin-top: 0;
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.progress-doing {
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.progress-percent {
  flex: none;
  /* Keeps its height while empty, so the panel does not jump when a share appears. */
  min-height: 1em;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.progress-large {
  height: 12px;
  border-radius: 6px;
}

.progress-large > span {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.18) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.18) 75%,
    transparent 75%
  );
  background-size: 24px 24px;
  animation: progress-stripes 0.9s linear infinite;
}

.progress-detail {
  min-height: 1.45em;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.progress-compact .progress-doing {
  font-size: 13px;
}

.progress-compact .progress-percent {
  font-size: 20px;
}

.progress-compact .progress-large {
  height: 8px;
  border-radius: 4px;
}

/* Work that cannot be measured: a band moving across */

.progress-busy > span {
  width: 35%;
  animation: progress-sweep 1.1s ease-in-out infinite;
}

@keyframes progress-sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(290%);
  }
}

@keyframes progress-stripes {
  to {
    background-position: 24px 0;
  }
}

/* A button whose action is running */

.btn.is-busy::after {
  content: '';
  flex: none;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Where a PO stands: one bar of steps across the page, done in green, the current one in yellow */

.page-journey {
  margin: -8px 0 24px;
}

/* The part of the page a step opens is outlined in gold while the page scrolls to it. */
.flash {
  animation: flash 2s ease-out;
}

@keyframes flash {
  0%,
  50% {
    box-shadow: 0 0 0 3px var(--accent);
  }
  100% {
    box-shadow: 0 0 0 3px transparent;
  }
}

.journey {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey li {
  flex: 1 1 0;
  min-width: 0;
}

/* Each step is an arrow; the next one tucks into it, leaving an even 4px gap between them. */
.journey li + li {
  margin-left: -12px;
}

.journey li > a,
.journey li > span {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px 0 32px;
  background: var(--sunken);
  color: var(--ink-4);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%);
}

.journey li:first-child > a,
.journey li:first-child > span {
  padding-left: 16px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%);
}

.journey li:last-child > a,
.journey li:last-child > span {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 16px 50%);
}

.journey .done > a,
.journey .done > span {
  background: var(--good);
  color: #ffffff;
}

.journey .current > a,
.journey .current > span {
  background: var(--accent);
  color: var(--ink);
}

.journey a:hover {
  filter: brightness(0.93);
}

.journey a:focus-visible {
  outline: none;
  filter: brightness(0.85);
}

.journey .locked > span {
  cursor: not-allowed;
}

.journey-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  background: var(--paper);
  border: 1.5px solid var(--line-2);
}

.journey .done .journey-mark {
  background: rgba(255, 255, 255, 0.2);
  border-color: transparent;
}

.journey .current .journey-mark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent);
}

.journey-mark svg {
  width: 13px;
  height: 13px;
}

.journey-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.journey-compact {
  min-width: 360px;
}

.journey-compact li + li {
  margin-left: -6px;
}

.journey-compact li > span,
.journey-compact li:first-child > span,
.journey-compact li:last-child > span {
  gap: 6px;
  height: 26px;
  padding: 0 10px 0 16px;
  font-size: 11.5px;
}

.journey-compact li > span {
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
}

.journey-compact li:first-child > span {
  padding-left: 8px;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
}

.journey-compact li:last-child > span {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 8px 50%);
}

.journey-compact .journey-mark {
  width: 16px;
  height: 16px;
  font-size: 10px;
}

.journey-compact .journey-mark svg {
  width: 10px;
  height: 10px;
}

/* The next step again under an order's last line */

.order-bottom-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 100%;
}

.order-bottom-row > p {
  margin-right: auto;
}

/* New order: the dropped sheets */

.sheet-cards:not(:empty) {
  margin-top: 16px;
}

.sheet-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.sheet-card:last-child {
  border-bottom: none;
}

.sheet-card .file-main > * + * {
  margin-top: 6px;
}

.sheet-card .progress-view {
  max-width: 420px;
}

.sheet-problem {
  color: var(--bad);
  font-size: 13px;
}

.sheet-fix {
  margin-top: 8px;
}

.sheet-card .field {
  margin: 10px 0 0;
}

.make-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  width: 100%;
}

/* An order: its next step and details above its lines */

/* The order's two boxes stand side by side at one height, each with its buttons at the bottom. */
.order-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.order-panels > .panel {
  display: flex;
  flex-direction: column;
}

.order-panels > .panel > .panel-body {
  flex: 1;
}

.note-text {
  max-width: 280px;
  white-space: pre-wrap;
  font-weight: 600;
}

.input.needs-decision {
  border-color: var(--warn);
  box-shadow: 0 0 0 3px rgba(229, 154, 0, 0.18);
}

.line-sizes {
  min-width: 180px;
}

.size-list,
.size-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.size {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.size-name {
  margin-right: 4px;
  font-size: 11.5px;
  color: var(--ink-4);
}

.size-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.size-box .size-name {
  margin-right: 0;
}

.size-input {
  width: 56px;
}

.line-problem {
  margin-top: 6px;
  color: var(--bad);
  font-size: 12.5px;
}

.waiting-list {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.waiting-list li + li {
  margin-top: 4px;
}

.po-number {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 700;
}

.kv dd.kv-file {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Stages of work: each turns from a spinner to a green check, and the last line says what was done */

.stages {
  margin: 4px 0;
  padding: 0;
  list-style: none;
}

.stages li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  color: var(--ink-4);
}

.stages li.active,
.stages li.done {
  color: var(--ink);
}

.stages li.failed {
  color: var(--bad);
}

.stage-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
}

.stage-mark svg {
  width: 11px;
  height: 11px;
}

.active .stage-mark {
  border-color: var(--ink);
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

.done .stage-mark {
  background: var(--good);
  border-color: var(--good);
  color: #ffffff;
}

.failed .stage-mark {
  background: var(--bad);
  border-color: var(--bad);
  color: #ffffff;
}

.stage-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}

.stage-detail {
  font-size: 12.5px;
  color: var(--ink-3);
}

.stage-detail:empty {
  display: none;
}

.done-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--good);
}

.done-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--good);
  color: #ffffff;
}

.done-mark svg {
  width: 13px;
  height: 13px;
}

/* Stage dialogs */

.stages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stages-outcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 8px;
}

/* The end and an invisible copy of it share one cell, so the room it needs is kept from the start.
   The rule above the end shows only once the end does. */
.stages-outcome > * {
  grid-area: 1 / 1;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.stages-outcome > :empty {
  border-top-color: transparent;
}

.stages-shape {
  visibility: hidden;
}

/* The end of the whole journey: the PO is with the factory. */
.celebration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 14px 0 6px;
}

.celebration-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
}

.celebration-check {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--good);
  color: #ffffff;
  animation: celebration-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

.celebration-check svg {
  width: 30px;
  height: 30px;
}

.celebration-text {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: var(--ink);
}

/* Each piece flies out once from behind the check and fades; --x, --y and --turn are set per piece. */
.confetti {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 12px;
  margin: -6px 0 0 -3.5px;
  border-radius: 1px;
  opacity: 0;
  animation: confetti-burst 1.1s ease-out 0.15s;
}

.confetti-0 {
  background: var(--accent);
}

.confetti-1 {
  background: var(--ink);
}

.confetti-2 {
  background: var(--good);
}

@keyframes celebration-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes confetti-burst {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(0.6);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(var(--turn)) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti {
    display: none;
  }

  .celebration-check {
    animation: none;
  }
}

.stages-error {
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--bad-soft);
  color: var(--bad);
}

.stages-file {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.stages-file .file-row {
  flex: 1;
  min-width: 0;
}

/* Preparing a link: files dropping into a zip beside the progress */

.preparing-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
}

.preparing-row .progress-view {
  flex: 1;
  min-width: 0;
}

.packing {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
}

.packing-box {
  position: absolute;
  left: 6px;
  bottom: 2px;
  width: 44px;
  height: 26px;
  border-radius: 4px;
  background: var(--ink);
}

.packing-zipper {
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 100%;
  margin-left: -2px;
  background: repeating-linear-gradient(var(--accent) 0 3px, transparent 3px 6px);
}

.packing-file {
  position: absolute;
  left: 18px;
  top: 0;
  width: 20px;
  height: 24px;
  border-radius: 2px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  animation: packing-drop 1.6s ease-in infinite;
}

.packing-file-next {
  animation-delay: 0.8s;
}

@keyframes packing-drop {
  0% {
    transform: translateY(-4px);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  70% {
    transform: translateY(22px);
    opacity: 1;
  }
  100% {
    transform: translateY(30px);
    opacity: 0;
  }
}

.sheet-card .done-line {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Settings: size scales */

.scale-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1.4fr) minmax(0, 1.2fr) 120px 30px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.scale-head {
  margin-bottom: 6px;
}

@media (max-width: 1100px) {
  .layout-split,
  .order-panels {
    grid-template-columns: 1fr;
  }

  .layout-split > aside {
    position: static;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    overflow-x: auto;
  }

  .wordmark {
    padding: 0 16px 0 0;
  }

  .sidebar-foot {
    margin: 0 0 0 auto;
    padding: 0 0 0 16px;
    border-top: none;
  }

  #library-status,
  .sidebar-email {
    display: none;
  }

  .sidebar-account {
    margin-top: 0;
  }

  .nav {
    flex-direction: row;
  }

  .nav a {
    padding: 8px 12px;
  }

  .nav a.active::before {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 0;
    width: auto;
    height: 3px;
  }

  .main {
    padding: 24px 16px 48px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header > .actions {
    flex-wrap: wrap;
  }

  .grid-2,
  .settings-layout {
    grid-template-columns: 1fr;
  }
}
