/* Pieces of the real Task Tracker app, for showing its screens on the website.
   Colours, fonts, sizes and borders are copied from the app's own stylesheets
   (app/assets/stylesheets/tasktracker.css and work.css, and the schedule's calendar
   styles), so what's shown here matches what people see after they sign up.
   Everything sits under .app-ui, so none of it leaks into the website's own look.
   If the app's look changes, update the tokens and rules here to match. */

.app-ui {
  --ink: #16233b;
  --ink-2: #44526a;
  --ink-3: #66748b;
  --steel: #eef1f6;
  --steel-2: #e3e8f0;
  --paper: #ffffff;
  --line: #d9dfe9;
  --line-2: #bcc6d5;
  --carbon: #2742c4;
  --carbon-dark: #1b2f93;
  --carbon-wash: #e8ecfb;
  --canary: #fff3b0;
  --canary-deep: #ffd84d;
  --canary-ink: #6b5400;
  --ok: #157347;
  --ok-wash: #dcf3e6;
  --warn: #975a00;
  --danger: #b3261e;
  --danger-wash: #fde5e3;
  --purple: #7e2aa3;
  --purple-wash: #f3e3fb;
  --radius: 8px;
  --radius-sm: 5px;
  --app-body: Barlow, system-ui, sans-serif;
  --app-display: "Barlow Semi Condensed", Barlow, system-ui, sans-serif;

  color: var(--ink);
  font-family: var(--app-body);
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: normal;
}
.app-ui *, .app-ui *::before, .app-ui *::after { box-sizing: border-box; }
.app-ui h1, .app-ui h2, .app-ui h3, .app-ui h4, .app-ui h5 {
  margin: 0; font-family: var(--app-display); font-weight: 600; line-height: 1.15;
  text-transform: none; letter-spacing: normal; color: var(--ink);
}
.app-ui p { margin: 0; }
.app-ui ul, .app-ui ol, .app-ui dl, .app-ui dd { margin: 0; padding: 0; list-style: none; }
.app-ui .muted { color: var(--ink-3); }

/* The "window" a screen sits in on the website: the app's grey page background. */
.app-shot {
  background: var(--steel);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 18px 40px -18px rgb(19 28 51 / 0.45);
}
.app-ui.app-shot { display: block; max-width: 100%; min-width: 0; }
.app-shot.fit { width: max-content; max-width: 100%; justify-self: start; align-self: center; }
.app-caption { font-size: .82rem; color: var(--ink-3, #66748b); margin-top: 14px; }

/* Buttons, tabs, badges: .btn, .tab, .badge in the app */
.app-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 30px; padding: 3px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font: 600 13px/1.2 var(--app-body); white-space: nowrap;
}
.app-btn-primary { background: var(--carbon); border-color: var(--carbon); color: #fff; }
.app-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; color: var(--ink-2); font-size: 16px; }
.app-tabs { display: flex; gap: 2px; }
.app-tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font: 500 13.5px var(--app-body); }
.app-tab-on { background: var(--ink); color: #fff; }
.app-tab-count { min-width: 20px; padding: 0 5px; border-radius: 99px; background: rgb(68 82 106 / 0.14); font: 400 12px var(--app-body); text-align: center; }
.app-badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--steel-2); color: var(--ink-2); }
.app-badge-blue { background: var(--carbon-wash); color: var(--carbon-dark); }
.app-badge-yellow { background: var(--canary); color: var(--canary-ink); }
.app-badge-green { background: var(--ok-wash); color: var(--ok); }
.app-badge-purple { background: var(--purple-wash); color: var(--purple); }
.app-chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* Panels: .panel, .panel-head, .panel-body, .detail-list, .table */
.app-panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.app-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.app-ui .app-panel-head h3 { font-size: 18px; }
.app-panel-body { padding: 16px; }
.app-detail-list { display: flex; flex-direction: column; gap: 7px; }
.app-detail-list.roomy { gap: 12px; }
.app-detail-list > div { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 10px; }
.app-detail-list dt { color: var(--ink-3); }
.app-detail-list dd { overflow-wrap: anywhere; }
.app-ui a.app-link, .app-link { color: var(--carbon); text-decoration: none; }
.app-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.app-table th { padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--ink-3); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
.app-table td { padding: 10px 14px; border-bottom: 1px solid var(--steel-2); vertical-align: top; }
.app-table tbody tr:last-child td { border-bottom: 0; }

/* Page title: .page-head in the app */
.app-page-head { margin-bottom: 14px; }
.app-page-head .app-back { display: block; margin-bottom: 4px; color: var(--ink-2); font-size: 13px; }
.app-ui .app-page-head h3 { font-size: 24px; letter-spacing: -0.005em; }
.app-page-head .app-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; color: var(--ink-3); font-size: 13.5px; }

/* Where the work is: .stub (the strip across the top of a work order) */
.app-stub {
  display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden;
}
.app-stub li { position: relative; min-width: 0; border-left: 1.5px dashed var(--line-2); transition: background .3s; }
.app-stub li:first-child { border-left: 0; }
.app-stub-hole { display: block; width: 15px; height: 15px; margin: 9px auto 3px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); font-size: 12px; font-weight: 700; line-height: 1; color: var(--paper); }
.app-stub-label { display: block; padding: 0 4px 8px; color: var(--ink-3); font-size: 13px; font-weight: 400; text-align: center; }
.app-stub-label .done-word { display: none; }
.app-stub .done { background: var(--ok-wash); }
.app-stub .done .app-stub-hole { display: grid; place-items: center; width: 18px; height: 18px; margin: 8px auto 2px; border: 1.5px solid var(--ok); background: var(--ok); }
.app-stub .done .app-stub-hole::before { content: "✓"; }
.app-stub .done .app-stub-label { color: var(--ink); font-weight: 500; }
.app-stub .done .todo-word { display: none; }
.app-stub .done .done-word { display: inline; }
.app-stub .now { box-shadow: inset 0 0 0 2px var(--carbon); background: var(--paper); }
.app-stub .now .app-stub-hole { border: 2.5px solid var(--carbon); background: var(--carbon-wash); }
.app-stub .now .app-stub-label { color: var(--carbon-dark); font-weight: 700; }
.app-stub .now .app-stub-label::after {
  content: "Now"; display: block; width: max-content; margin: 3px auto 0; padding: 0 6px; border-radius: 999px;
  background: var(--carbon); color: var(--paper); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; line-height: 16px; text-transform: uppercase;
}

/* The schedule: .schedule-bar, the calendar board and its .tt-card visits */
.app-schedule-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.app-ui .app-schedule-bar h3 { font-size: 24px; }
.app-schedule-nav { display: flex; align-items: center; gap: 2px; }
.app-schedule-title { margin-left: 6px; font: 600 16px var(--app-display); }
.app-schedule-bar .app-tabs { margin-left: auto; }

.app-board-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.app-board { --who-w: 100px; --hours: 11; min-width: 540px; font-size: 13px; }
.app-board-head, .app-board-row { display: grid; grid-template-columns: var(--who-w) minmax(0, 1fr); }
.app-board-head { border-bottom: 1px solid var(--steel-2); color: var(--ink); font-weight: 500; }
.app-board-head > div:first-child { padding: 6px 8px; border-right: 1px solid var(--steel-2); }
.app-board-hours { position: relative; display: grid; grid-template-columns: repeat(var(--hours), minmax(0, 1fr)); }
.app-board-hours span { padding: 6px 0 6px 4px; border-left: 1px solid var(--steel-2); white-space: nowrap; }
.app-board-hours span:first-child { border-left: 0; }
.app-board-row { border-bottom: 1px solid var(--steel-2); }
.app-board-row:last-child { border-bottom: 0; }
.app-board-who { padding: 6px 8px; border-right: 1px solid var(--steel-2); line-height: 1.25; }
.app-board-who b { display: block; font-weight: 600; }
.app-board-who small { display: block; color: var(--ink-3); font-size: 11.5px; }
.app-board-who small.stale { color: var(--warn); }
.app-board-lane {
  position: relative; min-height: 62px;
  /* Hour lines, then the shaded time outside business hours (before 8am and after 5pm here). */
  background:
    linear-gradient(90deg, rgb(91 106 111 / 0.07) 0 calc(100% / var(--hours)), transparent 0 calc(100% - 100% / var(--hours)), rgb(91 106 111 / 0.07) 0),
    repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--hours) - 1px), var(--steel-2) 0 calc(100% / var(--hours)));
}
.app-now { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px solid var(--danger); z-index: 2; pointer-events: none; }
.app-board-hours .app-now { top: auto; bottom: -4px; height: 0; border: 0; }
.app-board-hours .app-now::after { content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

.app-card {
  --who: var(--carbon);
  position: absolute; top: 3px; height: 56px;
  overflow: hidden; display: flex; flex-direction: column; min-width: 0;
  padding: 3px 6px 3px 7px;
  border-left: 3px solid var(--who); border-radius: 3px;
  background: color-mix(in srgb, var(--who) 13%, white);
  color: var(--ink); line-height: 1.25; font-size: 12px;
}
.app-card > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-time { color: var(--ink-3); font-size: 12px; }
.app-card strong { font-weight: 700; }
.app-card small { color: var(--ink-3); font-size: 12px; }
.app-card.completed { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgb(255 255 255 / 0.55) 6px 12px); }
.app-card.tentative { border-left-style: dashed; outline: 1px dashed var(--who); outline-offset: -1px; background: color-mix(in srgb, var(--who) 6%, white); }
.app-card.event { --who: #975a00; background: #fff6cc; border-left-style: dashed; }
.app-card.block {
  --who: var(--ink-3); font-style: italic; opacity: .9; justify-content: center;
  background-color: var(--steel-2);
  background-image: repeating-linear-gradient(45deg, transparent, transparent 6px, rgb(0 0 0 / 0.05) 6px, rgb(0 0 0 / 0.05) 12px);
}
/* A visit dropped onto the board from the "to schedule" list. */
.app-card.dropped { animation: app-drop .7s cubic-bezier(.2,1.2,.4,1) both; animation-delay: .5s; }
.js .app-card.dropped { animation-play-state: paused; }
.js .in .app-card.dropped, .js .app-card.dropped.go { animation-play-state: running; }
@keyframes app-drop {
  0% { transform: translate(-40px, 40px) rotate(-3deg); opacity: 0; box-shadow: 0 6px 18px -6px rgb(0 0 0 / 0.35); }
  70% { opacity: 1; box-shadow: 0 6px 18px -6px rgb(0 0 0 / 0.35); }
  100% { transform: none; opacity: 1; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .app-card.dropped { animation: none; } }

.app-schedule-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; color: var(--ink-3); font-size: 12.5px; }
.app-schedule-legend span { display: inline-flex; align-items: center; gap: 6px; }
.app-swatch-tentative { width: 14px; height: 10px; border: 1px dashed var(--ink-3); border-radius: 2px; }
.app-swatch-hours { width: 14px; height: 10px; border-radius: 2px; background: rgb(91 106 111 / 0.14); }

/* The "to schedule" list beside the board: .unscheduled and .wait-card */
.app-unscheduled { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.app-ui .app-unscheduled { width: 300px; max-width: 100%; }
.app-ui .app-unscheduled h3 { display: flex; align-items: center; gap: 6px; font-size: 17px; }
.app-unscheduled .app-hint { color: var(--ink-3); font-size: 13.5px; line-height: 1.35; }
.app-wait-card {
  display: flex; flex-direction: column; gap: 1px; padding: 8px 10px;
  border: 1px solid var(--line-2); border-top: 4px solid var(--canary-deep); border-radius: 3px;
  background: #fffdf2; color: var(--ink); font-size: 13.5px; line-height: 1.3;
}
.app-wait-card strong { font-weight: 600; }
.app-wait-card small { color: var(--ink-3); font-size: 13px; }
.app-wait-card em { font-style: normal; font-weight: 600; }
.app-wait-card .urgent { color: var(--danger); }
.app-wait-card.lifting { animation: app-lift 3.2s ease-in-out infinite; animation-delay: 1s; }
@keyframes app-lift {
  0%, 55%, 100% { transform: none; box-shadow: none; }
  15%, 40% { transform: translate(10px, -4px) rotate(-1.5deg); box-shadow: 0 6px 18px -6px rgb(0 0 0 / 0.35); }
}
@media (prefers-reduced-motion: reduce) { .app-wait-card.lifting { animation: none; } }
.app-split { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 700px) { .app-split { grid-template-columns: 1fr; } .app-ui .app-unscheduled { width: auto; } }

/* A team note on the timeline: yellow like a sticky note */
.app-note { padding: 8px 10px; border-left: 3px solid var(--canary-deep); background: #fffbe0; font-size: 13.5px; }
.app-note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 2px; font-weight: 600; }
.app-note-head time { margin-left: auto; color: var(--ink-3); font-weight: 400; font-size: 12.5px; }

/* The work order story (home and trade pages): a work order's strip, then the steps */
.app-steps { display: flex; flex-direction: column; }
.app-steps li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 12px; padding: 12px 16px; border-top: 1px solid var(--steel-2); transition: opacity .5s; }
.app-steps li:first-child { border-top: 0; }
.app-steps time { grid-row: span 2; color: var(--ink-3); font-size: 13.5px; padding-top: 1px; }
.app-steps .app-badge { justify-self: start; }
.app-steps p { color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }
.js .app-steps li { opacity: .38; }
.js .app-steps li.lit { opacity: 1; }
@media (max-width: 520px) {
  .app-steps li { grid-template-columns: 1fr; }
  .app-steps time { grid-row: auto; }
  .app-stub-label { font-size: 11px; }
}

/* Keep wide app pictures inside their column on phones; they scroll inside their frame. */
.feature-row > *, .day > *, .split > * { min-width: 0; }
