/* Timeline rows and the log forms (quote-tab.js, activity-forms.js), the Customer card, the Work log's Contacts row and the Claude key box in Settings → Connections. Loaded after styles.css; it reuses .history-item, .log-form, .field and .btn and only adds what they lack. */

/* Timeline: the kind's chip on a call, text, email or record (a message, an inventory, a form, a checklist) */

.tl-chip {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  padding: 0.05rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--sunk);
  color: var(--ink);
  flex: 0 0 auto;
}

/* The chip's words stay --ink: a company's brand color (Settings → Company & look) can be any color, light or dark, so it tints only the fill and the border. */

.tl-chip[data-tl-chip="call"] {
  background: var(--accent-soft);
  border-color: transparent;
}

.tl-chip[data-tl-chip="email"] {
  background: transparent;
  border-color: var(--accent);
}

/* A record (the app made it, or a customer's answer arrived; not a contact): the accent's fill and its border, an inventory's dashed, a form's and a checklist's dotted. */

.tl-chip[data-tl-chip="message"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.tl-chip[data-tl-chip="inventory"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  border-style: dashed;
}

.tl-chip[data-tl-chip="form"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  border-style: dotted;
}

.tl-chip[data-tl-chip="checklist"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  border-style: dotted;
}

/* A removed entry, shown only after Show removed: kept, muted. */

.tl-row.tl-removed {
  color: var(--muted);
}

.tl-row.tl-removed .history-what {
  font-weight: 400;
  font-style: italic;
}

.tl-row.tl-removed .tl-chip {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.tl-actions {
  display: inline-flex;
  gap: 0.6rem;
  flex: 0 0 auto;
}

.tl-toggle {
  margin: 0.35rem 0 0;
}

/* Add note · Log call · Log text · Log email */

.tl-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.history-add > .hint {
  margin: 0;
}

/* The Log call / text / email, Correct and Remove forms */

.tl-row > .af-form {
  flex: 1 0 100%;
}

.af-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.5rem 0.75rem;
  align-items: end;
  min-width: 0;
}

.af-grid .af-wide {
  grid-column: 1 / -1;
}

.af-grid .lf-date .date-btn {
  width: 100%;
}

.af-grid input[type="time"] {
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  min-height: 36px;
  width: 100%;
  min-width: 0;
}

.af-grid textarea {
  resize: vertical;
}

.af-form .check {
  min-height: 32px;
}

/* The Customer card */

.qp-contact-who {
  margin: 0 0 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.qp-contact-who div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.qp-contact-who dt {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: 600;
}

.qp-contact-who dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.qp-contact .hint {
  margin: 0.35rem 0 0;
}

.qp-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.5rem 0.75rem;
  min-width: 0;
}

.qp-contact-grid .qp-contact-wide {
  grid-column: 1 / -1;
}

/* The Work log's Contacts row: Calls · Texts · Emails, lined up under the day's first tiles */

.wl-contacts {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wl-contacts-label {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
}

/* Settings → Connections: the Claude key box (connections-card.js's claudeHtml). A password box, which styles.css's base rule for the text boxes does not list, so it takes that rule's look here (the field line, the accent's focus ring); change both together. */

.claude-part input[type="password"] {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  min-height: 36px;
  width: 100%;
  min-width: 0;
}

.af-grid input[type="time"]:focus-visible,
.claude-part input[type="password"]:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Shared working-form rhythm and quiet timeline hierarchy. */
.af-form { background: var(--ground); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.af-grid, .qp-contact-grid { gap: 10px 16px; }
.qp-contact-who { gap: 12px 32px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.qp-contact-who dt { font-weight: 400; font-size: 12px; }
.qp-contact-who dd { font-weight: 600; }
.tl-chip { font-weight: 400; }
.history-add { border-top: 1px solid var(--line); padding-top: 14px; }
.tl-add { gap: 8px; }
@media (min-width: 1200px) {
  .qp-contact-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .qp-contact-grid .qp-contact-wide { grid-column: span 1; }
}
