:root {
  --ink: #1f1f1f;
  --ink-soft: #444746;
  --muted: #444746;
  --placeholder: #747775;
  --line: #c4c7c5;
  --line-strong: #747775;
  --hover: #f0f4f9;
  --blue: #0b57d0;
  --blue-deep: #0842a0;
  --blue-wash: #d3e3fd;
  --red: #b3261e;
  --red-wash: #f9dedc;
  --star: #f9ab00;
  --page: #ffffff;
  --canvas: #f8fafd;
  --search: #e9eef6;
  --shadow: 0 1px 2px rgba(31, 31, 31, 0.08);
  --font-ui: "Google Sans", "Google Sans Text", Arial, Helvetica, sans-serif;
  --font-doc: "Google Sans Text", "Google Sans", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.43;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; color: inherit; }

button { cursor: pointer; }

[hidden] { display: none !important; }

body:not(.ready) .canvas,
body:not(.ready) .home,
body:not(.ready) .login {
  visibility: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.topbar {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 64px;
  padding: 0 16px 0 6px;
  background: #fff;
  border-bottom: 1px solid #e1e3e1;
  flex: 0 0 auto;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
}

.icon-btn:hover { background: var(--hover); }

.icon-btn svg { width: 24px; height: 24px; display: block; }

.logo-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  flex: 0 0 auto;
}

.logo-btn:hover { background: var(--hover); }

.logo-btn svg { width: 36px; height: 36px; display: block; }

.product-name {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  margin-left: 4px;
  letter-spacing: 0;
  white-space: nowrap;
  flex: 0 0 auto;
  text-align: left;
  cursor: pointer;
}

.title-input {
  margin-left: 4px;
  height: 36px;
  min-width: 120px;
  max-width: min(480px, 42vw);
  width: 240px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-size: 18px;
  line-height: 24px;
  padding: 0 8px;
  color: var(--ink);
}

.title-input:hover { border-color: #747775; }

.title-input:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
}

.star-btn { width: 36px; height: 36px; }

.star-btn svg { width: 22px; height: 22px; }

.star-btn[aria-pressed="true"] { color: var(--star); }

.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
}

.save-status svg { width: 18px; height: 18px; display: block; flex: 0 0 auto; }

.spacer { flex: 1; }

.duration-chip {
  background: var(--blue-wash);
  color: var(--blue-deep);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.billing-only { display: none !important; }

body[data-view="login"] .app-nav,
body[data-view="login"] .home,
body[data-view="login"] .canvas,
body[data-view="login"] .app-only,
body[data-view="login"] .home-only,
body[data-view="login"] .editor-only,
body[data-view="login"] .summary-only,
body[data-view="login"] .tasks-only,
body[data-view="login"] .companies-only,
body[data-view="login"] .integrations-only,
body[data-view="login"] .billing-only { display: none !important; }

body[data-view="billing"] .billing-only { display: flex !important; }
body[data-view="billing"] .app-only,
body[data-view="billing"] .home-only,
body[data-view="billing"] .editor-only,
body[data-view="billing"] .summary-only,
body[data-view="billing"] .tasks-only,
body[data-view="billing"] .companies-only,
body[data-view="billing"] .integrations-only,
body[data-view="billing"] .login-only { display: none !important; }
body[data-view="editor"] .home-only,
body[data-view="editor"] .summary-only,
body[data-view="editor"] .tasks-only,
body[data-view="editor"] .companies-only,
body[data-view="editor"] .integrations-only,
body[data-view="editor"] .login-only,
body[data-view="editor"] .billing-only { display: none !important; }
body[data-view="home"] .login-only,
body[data-view="home"] .billing-only,
body[data-view="home"] .companies-only,
body[data-view="home"] .integrations-only,
body[data-view="summary"] .login-only,
body[data-view="summary"] .billing-only,
body[data-view="summary"] .tasks-only,
body[data-view="summary"] .companies-only,
body[data-view="summary"] .integrations-only,
body[data-view="tasks"] .login-only,
body[data-view="tasks"] .billing-only,
body[data-view="tasks"] .home-only,
body[data-view="tasks"] .editor-only,
body[data-view="tasks"] .summary-only,
body[data-view="tasks"] .companies-only,
body[data-view="tasks"] .integrations-only { display: none !important; }
body[data-view="companies"] .companies-only { display: block !important; }
body[data-view="companies"] .home-only,
body[data-view="companies"] .editor-only,
body[data-view="companies"] .summary-only,
body[data-view="companies"] .tasks-only,
body[data-view="companies"] .integrations-only,
body[data-view="companies"] .login-only,
body[data-view="companies"] .billing-only { display: none !important; }
body[data-view="integrations"] .integrations-only { display: block !important; }
body[data-view="integrations"] .home-only,
body[data-view="integrations"] .editor-only,
body[data-view="integrations"] .summary-only,
body[data-view="integrations"] .tasks-only,
body[data-view="integrations"] .companies-only,
body[data-view="integrations"] .team-only,
body[data-view="integrations"] .login-only,
body[data-view="integrations"] .billing-only { display: none !important; }
body[data-view="team"] .team-only { display: block !important; }
body[data-view="team"] .home-only,
body[data-view="team"] .editor-only,
body[data-view="team"] .summary-only,
body[data-view="team"] .tasks-only,
body[data-view="team"] .companies-only,
body[data-view="team"] .integrations-only,
body[data-view="team"] .login-only,
body[data-view="team"] .billing-only { display: none !important; }
body[data-view="support"] .support-only { display: block !important; }
body[data-view="support"] .home-only,
body[data-view="support"] .editor-only,
body[data-view="support"] .summary-only,
body[data-view="support"] .tasks-only,
body[data-view="support"] .companies-only,
body[data-view="support"] .integrations-only,
body[data-view="support"] .team-only,
body[data-view="support"] .login-only,
body[data-view="support"] .billing-only { display: none !important; }
body[data-view="login"] .signup-only { display: none; }
body[data-mode="signup"] .signup-only { display: block; }

.login {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: none;
}

body[data-view="login"] { overflow: auto; }
.login-card h1 { margin: 0 0 8px; font-size: 36px; font-weight: 400; letter-spacing: 0; }
.login-card p { margin: 0 0 16px; color: var(--muted); }
.login-about { font-size: 14px; line-height: 1.45; }
.login-about a { color: var(--blue); }
.login-field { display: block; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.login-field input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
}
.login-submit {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 20px;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
}
.google-btn {
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.google-btn:hover { background: var(--hover); }
.google-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.login-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.login-card .login-legal {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 16px 0 0;
  font-size: 13px;
}
.login-legal a { color: var(--blue); text-decoration: none; }
.login-legal a:hover { text-decoration: underline; }
.app-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}
.nav-burger { color: var(--ink-soft); }
.nav-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: 30;
  width: 280px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(32, 33, 36, 0.12);
}
.nav-panel[hidden] { display: none; }
.nav-pill {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  padding: 8px 14px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
}
.nav-x {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}
.nav-x:hover { background: var(--hover); }
.nav-x svg { width: 20px; height: 20px; }
.nav-kicker {
  margin: 6px 12px 4px;
  color: var(--muted);
  font-size: 13px;
}
.nav-item,
.nav-auth {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 1px 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.nav-item svg,
.nav-auth svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--muted);
}
.nav-item:hover,
.nav-auth:hover { background: var(--hover); }
.nav-item.is-current {
  background: var(--blue-wash);
  color: var(--blue);
}
.nav-item.is-current svg { color: var(--blue); }
.nav-item.is-current:hover { background: var(--blue-wash); }
.nav-item[hidden] { display: none; }
.nav-rule { height: 1px; margin: 6px 8px; background: #e6e8eb; }
.nav-status { margin: 4px 10px 6px; color: var(--red); font-size: 13px; }
.nav-status:empty { display: none; }

.dir-lead {
  max-width: 720px;
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.build-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.build-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 500;
}

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

.build-row input {
  flex: 1 1 140px;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 12px;
  font-size: 14px;
}

.build-row input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.btn-filled {
  border: 0;
  border-radius: 20px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 0 16px;
  height: 40px;
  white-space: nowrap;
}

.btn-filled:hover { background: var(--blue-deep); }

.dir-actions { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.btn-outline {
  border: 1px solid var(--blue);
  background: #fff;
  color: var(--blue);
  border-radius: 20px;
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
}
.btn-outline:hover { background: var(--hover); }
a.btn-outline { display: inline-flex; align-items: center; text-decoration: none; }
.built-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.built-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--hover);
  border-radius: 16px;
  padding: 4px 8px 4px 12px;
  font-size: 13px;
}

.built-list li.is-editing {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.record-name { font-weight: 500; }

.built-list li.is-editing input {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  font-size: 13px;
  min-width: 140px;
}

.chip-action {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 4px;
}

.chip-action:hover { background: var(--blue-wash); }
.chip-action.danger { color: var(--red); }
.chip-action.danger:hover { background: var(--red-wash); }

.contact-email { color: var(--muted); }

.companies-only,
.integrations-only,
.team-only,
.support-only { display: none !important; }

body[data-view="home"] .editor-only,
body[data-view="home"] .summary-only,
body[data-view="home"] .tasks-only,
body[data-view="home"] .companies-only,
body[data-view="home"] .integrations-only { display: none !important; }

body[data-view="home"] #canvas.is-embedded { display: block !important; }

body[data-view="summary"] .home-only,
body[data-view="summary"] .editor-only,
body[data-view="summary"] .tasks-only,
body[data-view="summary"] .companies-only,
body[data-view="summary"] .integrations-only { display: none !important; }

.canvas {
  flex: 1;
  overflow: auto;
  background: var(--canvas);
}

.page {
  width: min(816px, calc(100% - 32px));
  margin: 16px auto 48px;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: none;
  padding: 72px 72px 96px;
  color: var(--ink);
  font-family: var(--font-doc);
  font-size: 15px;
  line-height: 1.5;
}

@media (min-width: 900px) {
  .page {
    width: 816px;
    min-height: 1056px;
    padding: 96px 96px 120px;
  }
}

.section { margin: 0 0 28px; }

.field-label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.customer-input,
.contact-input {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  border-radius: 0;
  padding: 2px 0 6px;
}

.customer-input {
  width: 100%;
  font-family: var(--font-doc);
  font-size: 28px;
  line-height: 1.3;
  color: var(--ink);
}

.customer-input::placeholder,
.contact-input::placeholder { color: var(--placeholder); }

.customer-input:hover,
.contacts-box:hover { border-bottom-color: var(--line); }

.customer-input:focus,
.contacts-box:focus-within {
  outline: none;
  border-bottom-color: var(--blue);
}

.hint {
  margin: 8px 0 0;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--placeholder);
}

.deal-select {
  width: 100%;
  max-width: 420px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-doc);
  font-size: 14px;
  padding: 0 8px;
}

.deal-select:hover { border-color: var(--line-strong); background: #fff; }

.deal-select:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
}

.deal-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
}

.deal-list:empty { display: none; }

.deal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.deal-row[data-status="identified"] { box-shadow: inset 3px 0 0 var(--blue); }
.deal-row[data-status="working"] { box-shadow: inset 3px 0 0 var(--star); }
.deal-row[data-status="closed"] { box-shadow: inset 3px 0 0 #188038; }

.deal-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-doc);
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
}

.deal-name-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 32px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  font-family: var(--font-doc);
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
}

.deal-name-input::placeholder { color: var(--placeholder); }

.deal-name-input:focus { outline: none; }

.deal-row-status {
  flex: none;
  min-width: 128px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background-color: var(--hover);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%235f6368' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  padding: 0 28px 0 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
}

.deal-row-status:hover { background-color: #fff; border-color: #bdc1c6; }

.deal-row-status:focus {
  outline: none;
  border-color: var(--blue);
  background-color: #fff;
}

.deal-remove {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.deal-remove[hidden] { display: none; }

.deal-row-pick .deal-remove[hidden] {
  display: block;
  visibility: hidden;
  pointer-events: none;
}

.deal-remove:hover { background: var(--hover); color: var(--red); }

.deal-remove:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

#tech-create { max-width: 520px; }

#tech-create .dt { max-width: 420px; margin-top: 12px; }

#tech-save { margin-top: 12px; }

.deal-message.is-error { color: var(--red); }

.hint-plus {
  flex: none;
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  font-size: 18px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.hint-plus[hidden] { display: none; }

.hint-plus:hover { background: var(--blue-wash); }

.hint-plus[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.contact-field { position: relative; }

.contact-options {
  position: absolute;
  z-index: 8;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(60, 64, 67, 0.18);
}

.contact-options[hidden] { display: none !important; }

.contact-options li { margin: 0; }

.contact-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  padding: 8px 12px;
}

.contact-options li:last-child .contact-option { border-bottom: 0; }

.contact-option:hover,
.contact-option.is-active { background: var(--blue-wash); }

.contact-option .option-email {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-option-label,
.contact-option-empty {
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
}

.contact-option-label {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.contacts-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-bottom: 1px solid transparent;
  padding-bottom: 4px;
}

#chips { display: contents; }

.contact-input {
  flex: 1 1 180px;
  min-width: 160px;
  font-family: var(--font-doc);
  font-size: 15px;
  padding: 6px 0;
}

.contact-input:focus { outline: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  background: #e8eaed;
  color: var(--ink);
  border-radius: 16px;
  padding: 4px 4px 4px 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 20px;
}

.chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.chip button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.chip button:hover { background: var(--line); }

.when {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 36px;
  align-items: start;
}

.when > * { min-width: 0; }

.billable-toggle {
  grid-column: 1 / -1;
  margin: 0;
}

.when.is-collapsed > :not(.billable-toggle) {
  display: none;
}

.billable-set {
  grid-column: 1 / -1;
  margin: 0 0 8px;
}

.billable-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}

.billable {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.billable-hint {
  margin: 8px 0 0;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.billable input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.length-block,
.when-summary { grid-column: 1 / -1; }

.dt-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
}

.dt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
}

.dt:first-child { flex: 1.35 1 0; }

.dt input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-doc);
  font-size: 14px;
  padding: 0 8px;
}

.dt input:hover { border-color: var(--line-strong); background: #fff; }

.dt input:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 1px var(--blue);
}

.length-value {
  margin: 0;
  font-family: var(--font-doc);
  line-height: 1.35;
}

.length-value[data-state="ok"] {
  font-size: 22px;
  color: var(--blue-deep);
}

.length-value[data-state="empty"] {
  font-size: 14px;
  font-style: italic;
  color: var(--placeholder);
}

.length-value[data-state="invalid"] {
  font-size: 16px;
  font-weight: 700;
  color: var(--red);
}

.length-hint {
  margin: 8px 0 0;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.when-summary {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

.divider {
  border: 0;
  border-top: 1px solid #e8eaed;
  margin: 4px 0 24px;
}

.notes-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

.notes-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.notes-heading .field-label { margin: 0; }

.save-note {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
}

.save-note:hover { background: var(--blue-wash); }

.mention {
  color: var(--blue);
  font-weight: 600;
  background: var(--blue-wash);
  border-radius: 4px;
  padding: 0 3px;
}

.tag-menu,
.alerts-panel {
  position: absolute;
  z-index: 20;
  min-width: 240px;
  max-width: 320px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px;
}

.tag-menu {
  top: calc(100% + 6px);
  right: 0;
}

.alerts-btn { position: relative; }

.alerts-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.alerts-panel {
  top: 56px;
  right: 64px;
}

.tag-option,
.alert-row,
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  border-radius: 6px;
  padding: 8px;
}

.tag-option:hover,
.alert-open:hover { background: var(--hover); }

.alert-row { align-items: flex-start; }

.alert-copy { display: block; min-width: 0; }

.alert-copy strong,
.team-row strong { display: block; font-size: 14px; }

.alert-copy span,
.team-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.support-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--blue-wash);
  color: var(--blue-deep);
  font-size: 13px;
}

.support-bar button {
  border: 0;
  background: transparent;
  color: var(--blue-deep);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  padding: 4px 8px;
}

.support-bar button:hover { background: #fff; }

.team-row.is-current { background: var(--blue-wash); }

.team-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.team-actions input {
  width: 11rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}

.team-invite {
  display: flex;
  gap: 8px;
  max-width: 520px;
  margin: 16px 0;
}

.team-invite input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
}

.team-label {
  margin: 22px 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.team-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 640px;
}

.team-row {
  border-top: 1px solid #e8eaed;
  cursor: default;
}

.team-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.notes {
  min-height: 420px;
  outline: none;
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.notes.is-empty:before {
  content: "What was discussed?";
  color: var(--placeholder);
  pointer-events: none;
}

.notes ul,
.notes ol { margin: 0.4em 0 0.4em 1.4em; padding: 0; }

.notes div + div { margin-top: 0.15em; }

.notes .note-entry + .note-entry { margin-top: 18px; }

.notes .note-time {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 2px;
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  user-select: none;
}

.note-todo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.note-todo input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.note-due {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.note-due[hidden] { display: none; }

.note-due.is-overdue { color: var(--red); }

.note-due.is-today { color: var(--blue); }

.note-due-input,
.task-due-input {
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  background: #fff;
  user-select: auto;
}

.note-due.is-overdue .note-due-input { border-color: var(--red); color: var(--red); }

.note-due.is-today .note-due-input { border-color: var(--blue); }

.task-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid #e8eaed;
}

.task-row.is-overdue { box-shadow: inset 3px 0 0 var(--red); }

.task-row.is-today { box-shadow: inset 3px 0 0 var(--blue); }

.tasks-overdue {
  color: var(--red);
  font-weight: 600;
}

.task-open {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.task-open strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.task-due-label {
  display: block;
  margin-top: 2px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.task-due-label.is-overdue { color: var(--red); }

.task-due-label.is-today { color: var(--blue); }

.task-due-label.is-none {
  color: var(--muted);
  font-weight: 500;
}

.task-due {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
}

.task-when {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
}

.task-text {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.notes .note-body {
  margin-top: 0;
  min-height: 1.65em;
}

.notes img,
.notes .note-shot {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.home {
  flex: 1;
  overflow: auto;
  background: var(--canvas);
  padding: 28px 40px 72px;
}

body[data-view="home"] .home,
body[data-view="tasks"] .home {
  padding: 10px 20px 36px;
}

body[data-view="tasks"] .home-search {
  display: block !important;
}

.home-inner { max-width: 1120px; margin: 0 auto; }

.home-search {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(560px, calc(100% - 400px));
  margin: 0;
  transform: translate(-50%, -50%);
}

.home-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.home-search input {
  width: 100%;
  height: 46px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: var(--search);
  box-shadow: none;
  padding: 0 16px 0 44px;
  font-size: 16px;
}

.home-search input:focus {
  outline: none;
  background: #fff;
  border-color: var(--blue);
  box-shadow: none;
}

.home-section { margin: 0 0 36px; }

.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 4px;
}

.composer-bar h2,
#composer-heading {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
}

#composer-section { margin-bottom: 16px; }

.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.composer-save {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

#canvas.is-embedded {
  flex: none;
  overflow: visible;
  background: transparent;
}

#canvas.is-embedded .page {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 0;
  padding: 8px 12px 10px;
  font-size: 13px;
  line-height: 1.35;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: none;
}

#canvas.is-embedded .note-sheet { column-gap: 16px; }

#canvas.is-embedded .note-side .section { margin-bottom: 4px; }

#canvas.is-embedded .field-label {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

#canvas.is-embedded .customer-input,
#canvas.is-embedded .contact-input {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 11px;
  line-height: 1.3;
}

#canvas.is-embedded .customer-input {
  padding: 0 0 1px;
}

#canvas.is-embedded .contact-input {
  padding: 2px 0;
}

#canvas.is-embedded .contacts-box {
  min-height: 26px;
  gap: 4px;
  padding-bottom: 1px;
}

#canvas.is-embedded .chip {
  padding: 1px 2px 1px 8px;
  font-size: 12px;
  line-height: 18px;
}

#canvas.is-embedded .chip button {
  width: 18px;
  height: 18px;
  font-size: 14px;
}

#canvas.is-embedded .hint {
  margin-top: 2px;
  font-size: 11px;
}

#canvas.is-embedded .hint-plus {
  width: 22px;
  height: 22px;
  font-size: 15px;
}

#canvas.is-embedded .when {
  margin: 6px 0 0;
  gap: 4px 12px;
}

#canvas.is-embedded .billable-set { margin: 0; }

#canvas.is-embedded .billable-row { gap: 2px 12px; }

#canvas.is-embedded .billable {
  gap: 5px;
  font-size: 12px;
}

#canvas.is-embedded .billable input {
  width: 13px;
  height: 13px;
}

#canvas.is-embedded .dt {
  gap: 1px;
  font-size: 11px;
}

#canvas.is-embedded .length-value { line-height: 1.25; }

#canvas.is-embedded .length-value[data-state="ok"] { font-size: 15px; }

#canvas.is-embedded .length-value[data-state="empty"],
#canvas.is-embedded .length-value[data-state="invalid"] { font-size: 12px; }

#canvas.is-embedded .length-hint { margin-top: 2px; font-size: 11px; }

#canvas.is-embedded .when-summary { font-size: 12px; }

#canvas.is-embedded .divider { margin: 4px 0 6px; }

#canvas.is-embedded .notes-section { margin-bottom: 0; }

#canvas.is-embedded .notes-heading { margin-bottom: 4px; }

#canvas.is-embedded .notes-actions { gap: 6px; }

#canvas.is-embedded .save-note {
  font-size: 12px;
  padding: 4px 8px;
}

#canvas.is-embedded .notes {
  min-height: 64px;
  font-size: 13px;
  line-height: 1.4;
}

#canvas.is-embedded .notes .note-entry + .note-entry { margin-top: 10px; }

#canvas.is-embedded .deal-name,
#canvas.is-embedded .deal-name-input { font-size: 13px; }

#canvas.is-embedded .deal-list,
#canvas.is-embedded #tech-create,
#canvas.is-embedded .deal-select,
#canvas.is-embedded #tech-create .dt { max-width: none; }

#canvas.is-embedded .deal-list { margin-bottom: 8px; }

#canvas.is-embedded #tech-create .dt,
#canvas.is-embedded #tech-save { margin-top: 6px; }

#canvas.is-embedded .deal-row {
  min-height: 28px;
  gap: 6px;
  padding: 2px 4px 2px 8px;
}

#canvas.is-embedded .deal-remove {
  width: 24px;
  height: 24px;
  font-size: 16px;
}

#canvas.is-embedded .dt input,
#canvas.is-embedded .deal-select,
#canvas.is-embedded .deal-row-status {
  height: 26px;
  font-size: 12px;
}

#canvas.is-embedded .deal-name-input { height: 26px; }

.doc-card.is-open .thumb { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }

.home-section h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink);
}

.company-notes { margin: 0 0 16px; }

.company-notes[hidden] { display: none; }

.company-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.company-picker select {
  min-width: 220px;
  max-width: min(420px, 70vw);
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%235f6368' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  padding: 0 32px 0 12px;
  appearance: none;
  cursor: pointer;
}

.company-picker select:hover { border-color: #bdc1c6; }

.company-picker select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.blank-status {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 16px;
}

.blank-card,
.doc-card { width: 200px; }

.blank-card,
.open-card {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
}

.open-card { width: 100%; }

.blank-thumb,
.thumb {
  position: relative;
  height: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.blank-thumb {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 56px;
  font-weight: 300;
  line-height: 1;
}

.blank-thumb:before,
.thumb:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4285f4, #ea4335 32%, #fbbc04 64%, #34a853);
}

.blank-thumb svg {
  width: 42px;
  height: 42px;
}

.summary-lead {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.3;
}

.summary-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
}

.summary-empty {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.summary-entry {
  display: block;
  width: calc(100% + 16px);
  margin: 0 -8px;
  padding: 20px 8px 8px;
  border: 0;
  border-top: 1px solid #e8eaed;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.summary-entry:hover,
.summary-entry:focus-visible { background: #f8fbff; }

.summary-entry h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}

.summary-line {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.45;
}

.summary-line strong {
  display: inline-block;
  width: 92px;
  color: var(--muted);
  font-weight: 700;
}

.summary-notes {
  margin: 10px 0 12px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.55;
}

.summary-thumb {
  color: var(--blue);
}
.blank-card:hover .blank-thumb,
.open-card:hover .thumb,
.open-card:focus-visible .thumb { border-color: var(--blue); }

.blank-label,
.card-title {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

button.card-title {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

button.card-title:hover,
button.card-title:focus-visible { color: var(--blue); }

.card-sub,
.card-edited {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-card { position: relative; }

.thumb-body {
  padding: 18px 14px 12px;
  font-family: var(--font-doc);
  color: var(--ink);
}

.thumb-customer {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb-meta,
.thumb-notes {
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.thumb-meta {
  color: var(--muted);
  margin-bottom: 8px;
}

.thumb-notes {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  position: absolute;
  top: 10px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 1;
}

.card-actions button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink-soft);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
  display: grid;
  place-items: center;
  padding: 0;
  opacity: 0;
}

.card-actions button svg { width: 18px; height: 18px; }

.card-actions button.is-on { color: var(--star); opacity: 1; }

.doc-card:hover .card-actions button,
.doc-card:focus-within .card-actions button,
.card-actions button:focus-visible { opacity: 1; }

#starred-section,
#recent-section,
#tasks-section { margin-bottom: 16px; }

#starred-section h2,
#recent-section h2,
#tasks-section h2 { margin-bottom: 8px; }

#tasks-count { margin: 0 0 8px; }

#starred-grid,
#recent-grid,
#tasks-list {
  flex-direction: column;
  gap: 6px;
}

#starred-grid .doc-card,
#recent-grid .doc-card,
#tasks-list .doc-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

#starred-grid .open-card,
#recent-grid .open-card,
#tasks-list .open-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title edited"
    "sub sub"
    "preview preview";
  column-gap: 12px;
  row-gap: 1px;
  width: 100%;
  padding: 8px 76px 8px 12px;
  text-align: left;
}

#starred-grid .card-title,
#recent-grid .card-title,
#tasks-list .card-title {
  grid-area: title;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

#starred-grid .card-edited,
#recent-grid .card-edited,
#tasks-list .card-edited {
  grid-area: edited;
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
}

#starred-grid .card-sub,
#recent-grid .card-sub,
#tasks-list .card-sub {
  grid-area: sub;
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
}

#starred-grid .card-sub:empty,
#recent-grid .card-sub:empty,
#tasks-list .card-sub:empty,
#starred-grid .card-preview:empty,
#recent-grid .card-preview:empty,
#tasks-list .card-preview:empty { display: none; }

#starred-grid .card-preview,
#recent-grid .card-preview,
#tasks-list .card-preview {
  grid-area: preview;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#starred-grid .card-actions,
#recent-grid .card-actions,
#tasks-list .card-actions {
  top: 6px;
  right: 6px;
}

#starred-grid .card-actions button,
#recent-grid .card-actions button,
#tasks-list .task-check {
  width: 28px;
  height: 28px;
  box-shadow: none;
  border: 1px solid transparent;
}

#starred-grid .doc-card:hover .card-actions button,
#recent-grid .doc-card:hover .card-actions button,
#tasks-list .doc-card:hover .task-check,
#starred-grid .doc-card:focus-within .card-actions button,
#recent-grid .doc-card:focus-within .card-actions button,
#tasks-list .doc-card:focus-within .task-check {
  border-color: var(--line);
}

#tasks-list .open-card { padding-right: 48px; }

#tasks-list .task-check {
  display: grid;
  place-items: center;
  border-radius: 50%;
  opacity: 1;
  cursor: pointer;
}

#tasks-list .task-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

#tasks-list .card-edited.task-due-label { font-weight: 500; }

#tasks-list .card-edited.task-due-label.is-overdue,
#tasks-list .card-edited.task-due-label.is-today { font-weight: 600; }

#tasks-list .doc-card.is-overdue { box-shadow: inset 3px 0 0 var(--red); }

#tasks-list .doc-card.is-today { box-shadow: inset 3px 0 0 var(--blue); }

#tasks-list .task-due {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 12px 10px;
}

.card-actions button.danger:hover { color: var(--red); }

.empty-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.menu {
  position: fixed;
  z-index: 30;
  min-width: 240px;
  margin: 0;
  padding: 6px 0;
  background: #fff;
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 14px;
  color: var(--ink);
  padding: 8px 16px 8px 12px;
}

.menu button .check {
  width: 18px;
  flex: 0 0 18px;
  color: var(--ink-soft);
}

.menu button .label { flex: 1; }

.menu button:hover { background: var(--hover); }

.menu button.danger,
.menu button.danger .check { color: var(--red); }

.menu .kbd {
  color: var(--placeholder);
  font-size: 12px;
}

.menu-sep {
  height: 1px;
  margin: 6px 0;
  background: #e8eaed;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(32, 33, 36, 0.45);
  padding: 16px;
}

.dialog {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.dialog h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
}

.dialog p {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.company-dialog { width: min(480px, 100%); }

.company-search {
  width: 100%;
  height: 40px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
}

.company-search:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.company-status {
  min-height: 1.2em;
  margin: 10px 0 0;
}

.company-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.company-list:empty { display: none; }

.company-list li { margin: 0; }

.company-option {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  font-size: 14px;
  color: var(--ink);
  padding: 10px 14px;
}

.company-list li:last-child .company-option { border-bottom: 0; }

.company-option:hover,
.company-option.is-active { background: var(--blue-wash); }

.btn-text {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 14px;
  font-weight: 500;
  border-radius: 20px;
  padding: 8px 12px;
}

.btn-text:hover { background: var(--blue-wash); }

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

.btn-text.danger:hover { background: var(--red-wash); }

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

.title-input:focus-visible,
.customer-input:focus-visible,
.contact-input:focus-visible,
.dt input:focus-visible,
.notes:focus-visible,
.home-search input:focus-visible,
.company-search:focus-visible {
  outline: none;
}

body[data-view="editor"] .page {
  width: min(1120px, calc(100% - 24px));
  margin: 8px auto 24px;
  padding: 16px 28px 28px;
  min-height: 0;
}

.note-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  column-gap: 40px;
  align-items: start;
}

.note-side .section { margin-bottom: 12px; }

.note-side .section:last-child { margin-bottom: 0; }

body[data-view="editor"] .field-label { margin-bottom: 4px; }

body[data-view="editor"] .customer-input {
  font-size: 22px;
  line-height: 1.2;
  padding-bottom: 2px;
}

body[data-view="editor"] .contacts-box {
  min-height: 34px;
  gap: 6px;
}

body[data-view="editor"] .hint { margin-top: 4px; }

body[data-view="editor"] .when { margin: 12px 0 2px; }

body[data-view="editor"] .length-value[data-state="ok"] { font-size: 18px; }

body[data-view="editor"] .divider { margin: 8px 0 10px; }

body[data-view="editor"] .notes-section { margin-bottom: 0; }

body[data-view="editor"] .notes { min-height: 220px; }

body[data-view="editor"] .deal-list,
body[data-view="editor"] #tech-create,
body[data-view="editor"] .deal-select,
body[data-view="editor"] #tech-create .dt { max-width: none; }

body[data-view="editor"] .deal-list { margin-bottom: 8px; }

body[data-view="editor"] #tech-create .dt,
body[data-view="editor"] #tech-save { margin-top: 6px; }

body[data-view="editor"] .deal-row { min-height: 36px; padding-top: 2px; padding-bottom: 2px; }

body[data-view="editor"] .dt input,
body[data-view="editor"] .deal-select { height: 32px; }

@media (min-width: 900px) {
  body[data-view="editor"] .when,
  #canvas.is-embedded .when {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(180px, 0.85fr);
    gap: 4px 12px;
  }

  body[data-view="editor"] .when .billable-set,
  body[data-view="editor"] .length-block,
  body[data-view="editor"] .when-summary,
  #canvas.is-embedded .when .billable-set,
  #canvas.is-embedded .length-block,
  #canvas.is-embedded .when-summary {
    grid-column: auto;
    margin: 0;
  }
}

@media (max-width: 800px) {
  .home-search { width: min(560px, calc(100% - 220px)); }
  .when { grid-template-columns: 1fr; }
  .note-sheet { grid-template-columns: 1fr; }
  .dt-row { flex-wrap: wrap; }
  .page {
    width: calc(100% - 16px);
    margin: 8px auto 24px;
    padding: 32px 20px 48px;
    min-height: 0;
  }
  body[data-view="editor"] .page {
    width: calc(100% - 12px);
    margin: 6px auto 16px;
    padding: 12px 14px 20px;
  }
  #canvas.is-embedded .page { padding: 8px 10px 10px; }
  .notes { min-height: 280px; }
  body[data-view="editor"] .notes { min-height: 180px; }
  #canvas.is-embedded .notes { min-height: 64px; }
  .home { padding: 20px 16px 48px; }
  body[data-view="home"] .home,
  body[data-view="tasks"] .home { padding: 8px 12px 28px; }
}

@media (max-width: 640px) {
  .save-status span { display: none; }
  .duration-chip { display: none; }
  .blank-card,
  .doc-card { width: calc(50% - 8px); }
  #starred-grid .doc-card,
  #recent-grid .doc-card { width: 100%; }
  .deal-list, #tech-create { max-width: none; }
  .deal-row { flex-wrap: wrap; }
  .deal-name, .deal-name-input { flex: 1 1 160px; }
}

@media (hover: none) {
  .card-actions button { opacity: 1; }
}

@media print {
  body { overflow: visible; background: #fff; display: block; }
  .topbar, .home, .backdrop, .menu, .alerts-panel, .tag-menu, .support-bar { display: none !important; }
  body[data-view="home"] #home {
    display: block !important;
    overflow: visible;
    height: auto;
    padding: 0;
    background: #fff;
  }
  body[data-view="home"] #home .home-section:not(#composer-section),
  body[data-view="home"] #company-notes,
  body[data-view="home"] #no-matches,
  body[data-view="home"] .composer-bar { display: none !important; }
  body[data-view="summary"] #canvas,
  body[data-view="editor"] #summary,
  body[data-view="home"] #summary { display: none !important; }
  body[data-view="home"] #canvas.is-embedded { display: block !important; }
  body[data-view="tasks"] #tasks {
    display: block !important;
    overflow: visible;
    height: auto;
    padding: 0;
    background: #fff;
  }
  #canvas.is-embedded .page {
    box-shadow: none;
    padding: 0;
    min-height: 0;
  }
  .canvas { overflow: visible; background: #fff; }
  .page {
    width: auto;
    min-height: 0;
    margin: 0;
    box-shadow: none;
    padding: 0;
  }
  .note-sheet,
  body[data-view="editor"] .when { display: block; }
  .summary-entry { cursor: default; }
  .summary-entry:hover { background: transparent; }
  .billable-toggle { display: none !important; }
  .when.is-collapsed > :not(.billable-toggle) { display: block !important; }
  .contact-input, .hint, .hint-plus, .contact-options, .chip button, .length-hint, .billable-hint, .save-note,
  #tech-create, .deal-remove, .deal-row-pick, .deal-row-new { display: none !important; }
  .deal-row-status {
    border: 0;
    background: transparent;
    padding: 0;
    min-width: 0;
    appearance: none;
  }
  .dt input {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding-left: 0;
  }
}

@page { margin: 0.7in; }

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