@font-face {
  font-family: Jakarta;
  src: url('jakarta.woff2') format('woff2');
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --border: #e4e8f1;
  --paper: #f8f9fc;
  --white: #fff;
  --ink: #191e2b;
  --muted: #52617b;
  --line: #e4e8f1;
  --blue: #264cd9;
  --blue-light: #edf1ff;
  --yellow: #ffe600;
  --green: #128565;
  --radius: 24px;
  --shadow: 0 4px 20px -8px #1b305118;
  font-family: Jakarta, 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font: inherit;
  box-sizing: border-box;
}

button, a, input, textarea, select {
  -webkit-tap-highlight-color: transparent;
}

button, a {
  touch-action: manipulation;
  cursor: pointer;
  color: inherit;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
}

button, a, input, textarea, select {
  outline-offset: 4px;
}

button:focus-visible, a:focus-visible {
  outline: 3px solid var(--blue);
}

button:not(:disabled):active {
  transform: translateY(1px);
}

h1, h2, h3, h4, p {
  margin: 0;
  overflow-wrap: anywhere;
}

h1 {
  font-size: 32px;
  letter-spacing: -1.2px;
  line-height: 1.25;
  font-weight: 800;
}

h2 {
  font-size: var(--text-heading);
  letter-spacing: -.5px;
  line-height: 1.35;
  font-weight: 800;
}

h3 {
  font-size: var(--text-subheading);
  letter-spacing: -.4px;
  line-height: 1.4;
}

img {
  max-width: 100%;
  display: block;
}

button svg, a svg {
  flex-shrink: 0;
}

.icon {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  flex-shrink: 0;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: -100px;
  left: 20px;
  padding: 12px 20px;
  background: var(--yellow);
  border-radius: 20px;
  font-size: var(--text-action);
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  background: #ffffffed;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  z-index: 20;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.header-inner {
  max-width: 1100px;
  margin: auto;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 1;
}

.brand-art {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid #d3ddff;
  background: #f0f4ff;
  padding: 5px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wordmark {
  font-family: Jakarta, 'Arial Black', sans-serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1.8px;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.wordmark > span {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  margin: 6px 0 0 2px;
}

.header-tagline {
  font-size: var(--text-label);
  color: var(--muted);
  margin-left: 14px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.icon-button {
  background: transparent;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  transition: background .15s;
}

.icon-button:hover {
  background: #f1f3f8;
}

.help-button {
  background: var(--yellow);
  width: 44px;
  height: 44px;
  font-size: var(--text-heading);
  font-weight: 800;
}

.help-button:hover {
  background: #f2db00;
}

.avatar-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0f2f7;
  color: #647087;
  font-weight: 750;
  font-size: var(--text-action);
}

.avatar-button:hover {
  background: #e6ebf5;
}

/* Workspace */
.workspace {
  max-width: 1100px;
  width: 100%;
  padding: 32px 24px 150px;
  margin: 0 auto;
  min-height: calc(100dvh - 86px);
  overflow-x: hidden;
}

.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  font-size: var(--text-small);
  letter-spacing: 1.1px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.4;
  text-transform: uppercase;
}

.page-heading .eyebrow {
  margin-bottom: 6px;
}

/* Buttons */
.button {
  border-radius: 999px;
  min-height: 56px;
  padding: 12px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: var(--text-action);
  font-weight: 750;
  line-height: 1.4;
  transition: background .15s, box-shadow .15s;
  white-space: normal;
  text-align: center;
}

.button .icon {
  width: 20px;
  height: 20px;
}

.primary {
  background: var(--yellow);
  color: #191c1e;
}

.primary:hover {
  background: #f3dc00;
  box-shadow: 0 4px 12px #ffe60033;
}

.secondary {
  background: var(--white);
  border: 1px solid var(--line);
}

.secondary:hover {
  background: #f3f5f9;
}

.button-small {
  min-height: 42px;
  padding: 8px 18px;
  font-size: var(--text-label);
  font-weight: 700;
}

.text-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: var(--text-label);
  line-height: 1.4;
  background: transparent;
  font-weight: 700;
  padding: 8px 0;
  color: var(--blue);
}

.text-button:hover {
  text-decoration: underline;
}

.text-button .icon {
  width: 18px;
  height: 18px;
}

/* Customer Card */
.customer-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
}

.customer-top {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.customer-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: var(--blue-light);
  border-radius: 18px;
  font-size: var(--text-heading);
  font-weight: 750;
  color: var(--blue);
  flex-shrink: 0;
}

.customer-name {
  min-width: 0;
  flex: 1;
}

.customer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  font-size: var(--text-small);
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--blue);
  flex-wrap: wrap;
}

.demo-tag {
  font-size: var(--text-caption);
  letter-spacing: 0;
  font-weight: 600;
  color: var(--muted);
  background: #f5f6f9;
  border-radius: 6px;
  padding: 2px 8px;
}

.customer-name h2 {
  font-size: var(--text-title);
  letter-spacing: -.6px;
  line-height: 1.3;
}

.customer-name p {
  font-size: var(--text-action);
  color: #647087;
  margin-top: 3px;
}

.edit-customer {
  margin-left: auto;
  color: #8792a7;
  flex-shrink: 0;
}

.customer-contact {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  align-items: center;
  gap: 20px;
  border-top: 1px solid #f0f2f7;
  margin-top: 20px;
  padding-top: 20px;
  min-width: 0;
}

.address {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-action);
  color: #3b465a;
  min-width: 0;
}

.address > .icon {
  width: 21px;
  height: 21px;
  color: #8490a5;
  flex-shrink: 0;
}

.address > span > span {
  color: #7f8899;
}

.contact-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

.contact-link {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: var(--text-label);
  font-weight: 650;
  border: 1px solid var(--line);
  padding: 11px 14px;
  border-radius: 13px;
  min-width: 0;
}

.contact-link:hover {
  border-color: #b8c7f8;
  background: #fafbff;
}

.contact-link .icon {
  color: var(--blue);
  width: 19px;
  height: 19px;
}

.contact-link:first-child .icon {
  color: var(--green);
}

.contact-link span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.contact-missing {
  font-size: var(--text-label);
  color: var(--muted);
  align-self: center;
}

/* Tabs */
.section-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin: 26px 0 24px;
  min-height: 48px;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.section-tabs::-webkit-scrollbar {
  display: none;
}

.section-tabs button {
  border-radius: 0;
  background: transparent;
  font-size: var(--text-action);
  font-weight: 700;
  height: 48px;
  color: #9299a8;
  position: relative;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.section-tabs button.selected:after {
  content: '';
  height: 3px;
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  background: var(--blue);
  border-radius: 4px;
}

.section-tabs .icon {
  width: 17px;
  height: 17px;
}

.tab-hint {
  margin-left: auto;
  color: #9aa2b0;
  font-size: var(--text-small);
  white-space: nowrap;
}

/* Overview Layout */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
  width: 100%;
  min-width: 0;
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  min-width: 0;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
  min-width: 0;
  flex-wrap: wrap;
}

.section-heading > .icon-button {
  width: 38px;
  height: 38px;
  color: #939daf;
}

.heading-with-icon, .heading-with-count {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.section-icon {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-light);
  border-radius: 12px;
  flex-shrink: 0;
}

.section-icon .icon {
  width: 22px;
  height: 22px;
}

/* Equipment Card */
.equipment-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: #f8f9fc;
  border: 1px solid #ebeff7;
  border-radius: 17px;
  width: 100%;
  min-width: 0;
}

.equipment-card > div {
  flex: 1;
  min-width: 0;
}

.equipment-card .eyebrow {
  font-size: var(--text-caption);
  letter-spacing: 1px;
}

.equipment-card h3 {
  font-size: var(--text-subheading);
  margin: 6px 0 8px;
  font-weight: 800;
}

.serial {
  font-size: var(--text-label);
  color: var(--muted);
  display: flex;
  gap: 10px;
  letter-spacing: .2px;
}

.serial span {
  color: #4f5a70;
  font-family: ui-monospace, Consolas, monospace;
  font-size: var(--text-label);
  font-weight: 650;
}

.equipment-art {
  width: 65px;
  height: 80px;
  object-fit: contain;
  opacity: .85;
  flex-shrink: 0;
}

.equipment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0 20px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-small);
  font-weight: 700;
  color: #0e8765;
  background: #effbf6;
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.maintenance {
  background: #fff7df;
  color: #966912;
}

.status-pill.offline {
  background: #f9edeb;
  color: #a4433b;
}

.location-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #939daf;
  font-size: var(--text-small);
  font-weight: 600;
  text-align: right;
}

.location-label .icon {
  width: 16px;
  height: 16px;
}

/* Notes & Basic Editor */
.notes-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.notes-heading label {
  font-size: var(--text-emphasis);
  font-weight: 800;
  color: var(--ink);
}

.notes-heading > span {
  font-size: var(--text-label);
  color: var(--muted);
}

.editor-container {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 16px;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  background: #f1f4fa;
  border: 1px solid #dfe5ef;
  border-bottom: 1px solid #e5eaf2;
  border-radius: 16px 16px 0 0;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.editor-toolbar::-webkit-scrollbar {
  display: none;
}

.editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #fff;
  border: 1px solid #d4dceb;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: var(--text-label);
  font-weight: 750;
  color: #334155;
  white-space: nowrap;
  min-height: 38px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px #00000008;
  transition: all .15s;
}

.editor-btn:hover {
  background: #eef2ff;
  border-color: #b8c7f8;
  color: var(--blue);
}

.editor-btn .icon {
  width: 16px;
  height: 16px;
}

.editor-btn-preview {
  margin-left: auto;
  background: #edf1ff;
  color: var(--blue);
  border-color: #c7d5fc;
}

.editor-btn-preview.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.notes-area {
  border: 1px solid #dfe5ef;
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: #fcfcfe;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  transition: border-color .2s;
}

.notes-area:focus-within {
  border-color: #b7c6f5;
  box-shadow: 0 0 0 3px #264cd90b;
}

.notes-area textarea {
  border: 0;
  background: transparent;
  width: 100%;
  padding: 16px 18px 8px;
  min-height: 160px;
  resize: vertical;
  outline: none;
  box-shadow: none;
  font-size: var(--text-body);
  line-height: 1.8;
  color: var(--ink);
  display: block;
}

.notes-preview {
  padding: 16px 18px;
  min-height: 160px;
  font-size: var(--text-body);
  line-height: 1.8;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.notes-preview-empty {
  color: var(--muted);
  font-style: italic;
}

.notes-preview h4 {
  font-size: var(--text-emphasis);
  margin: 14px 0 6px;
  color: var(--blue);
  font-weight: 850;
}

.notes-preview p {
  margin: 6px 0;
}

.preview-time {
  display: inline-block;
  background: #eef2ff;
  color: var(--blue);
  font-weight: 800;
  font-size: var(--text-small);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #d9e3fe;
  vertical-align: middle;
}

.preview-task {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  font-size: var(--text-body);
}

.preview-task.done {
  text-decoration: line-through;
  color: #8b94a6;
}

.preview-task input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
  cursor: default;
  margin: 0;
  flex-shrink: 0;
}

.notes-preview ul {
  margin: 6px 0;
  padding-left: 24px;
}

.notes-preview li {
  margin: 4px 0;
}

.notes-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 12px;
  color: #a4acb9;
  font-size: var(--text-small);
  border-top: 1px solid #f0f3f8;
}

.notes-footer > span {
  display: flex;
  gap: 5px;
  align-items: center;
}

.notes-footer .icon {
  width: 15px;
  height: 15px;
}

.save-status {
  color: var(--green);
  font-size: var(--text-small);
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.save-status.saving {
  color: #9c7b09;
}

.save-status.error {
  color: #b44238;
}

.another-installation {
  font-size: var(--text-label);
  font-weight: 700;
  color: #8b96aa;
  margin-top: 14px;
}

/* Photos Panel */
.count-pill {
  font-size: var(--text-small);
  font-weight: 750;
  background: #f0f2f7;
  color: #647087;
  min-width: 28px;
  height: 28px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

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

.photos-panel .section-heading {
  margin-bottom: 20px;
}

.upload-empty {
  width: 100%;
  min-height: 230px;
  padding: 26px 16px;
  border: 1px dashed #d8dfec;
  border-radius: 16px;
  background: #fcfcfe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.camera-bubble {
  background: var(--blue-light);
  color: var(--blue);
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  margin-bottom: 16px;
}

.camera-bubble .icon {
  width: 28px;
  height: 28px;
}

.upload-empty > strong {
  font-size: var(--text-emphasis);
  letter-spacing: -.3px;
  font-weight: 800;
}

.upload-empty > span:not(.camera-bubble) {
  color: #8b95a7;
  font-size: var(--text-label);
  line-height: 1.6;
  margin-top: 6px;
  max-width: 280px;
}

.upload-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 260px;
  margin-top: 18px;
}

.upload-buttons .button {
  width: 100%;
}

.photo-help {
  font-size: var(--text-small);
  color: #a1aaba;
  margin-top: 14px;
  text-align: center;
}

.invoice-shortcut {
  background: #eff2fc;
  border: 1px solid #e1e7fa;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 20px;
  padding: 20px;
  text-align: left;
  width: 100%;
}

.shortcut-icon {
  background: #fff;
  border-radius: 13px;
  width: 46px;
  height: 50px;
  display: grid;
  place-items: center;
  color: var(--blue);
  flex-shrink: 0;
}

.invoice-shortcut > span:nth-child(2) {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.invoice-shortcut strong {
  font-size: var(--text-body);
  font-weight: 750;
}

.invoice-shortcut > span:nth-child(2) > span {
  color: #7a89af;
  font-size: var(--text-label);
}

.invoice-shortcut > .icon {
  width: 20px;
  height: 20px;
  color: var(--blue);
  flex-shrink: 0;
}

.invoice-shortcut:hover {
  background: #e7ecfc;
}

.workspace-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--text-small);
  color: #a3aaba;
  margin-top: 32px;
}

.footer-dot {
  background: #c5cfe4;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

/* Bottom Navigation (Fixed & Centered) */
.bottom-nav {
  position: fixed;
  z-index: 30;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 6px;
  width: calc(100% - 24px);
  max-width: 520px;
  height: 76px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 12px;
  box-shadow: 0 12px 38px #24345514;
}

.nav-item {
  flex: 1;
  max-width: none;
  min-width: 0;
  min-height: 60px;
  padding: 5px 2px;
  background: transparent;
  color: #52617b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: var(--text-caption);
  font-weight: 750;
  border-radius: 12px;
}

.nav-item > .icon {
  width: 22px;
  height: 22px;
}

.nav-item span:last-child {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
  line-height: 1.25;
  min-height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item.active {
  color: #173fb5;
  background: var(--blue-light);
  box-shadow: inset 0 -3px 0 var(--blue);
}

.nav-item:hover {
  background: #f3f5fa;
}
.nav-item.active:hover { background: var(--blue-light); }
.nav-item .icon { width: 23px; height: 23px; }

.start-page { max-width: 600px; margin: 64px auto; padding: 12px 0; }
.start-page h1 { font-size: clamp(29px, 5vw, 42px); line-height: 1.2; letter-spacing: -.03em; }
.start-page > p { max-width: 46ch; margin-top: 20px; color: #52617b; font-size: var(--text-emphasis); }
.start-page > .primary { display: flex; margin-top: 32px; width: fit-content; min-height: 54px; }
.start-page > .text-button { display: flex; margin-top: 12px; min-height: 48px; }
.start-page > .start-note { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-size: var(--text-label); }
.customers-page { max-width: 900px; margin: 0 auto; }
.customers-page .search-field { background: #fff; }
.customers-page .search-caption { padding: 20px 0 12px; }
.customers-page .search-results { padding: 0; }
.customers-page .search-result { min-width: 0; }
.customers-page .search-empty .text-button { display: flex; margin: 16px auto 0; }
.customer-documents { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 32px 0 20px; }
.customer-documents h2 { font-size: var(--text-heading); }
.customer-documents .text-button { min-height: 44px; }
.settings-group { border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.settings-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; list-style: none; cursor: pointer; padding: 20px; min-height: 86px; }
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group > summary strong, .settings-group > summary small { display: block; }
.settings-group > summary strong { font-size: var(--text-emphasis); }
.settings-group > summary small { font-size: var(--text-small); font-weight: 400; color: #52617b; margin-top: 4px; }
.settings-group > summary > .icon { flex: 0 0 22px; }
.settings-group[open] > summary { border-bottom: 1px solid var(--line); }
.settings-group[open] > summary > .icon { transform: rotate(180deg); }
.settings-group > summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 16px; }
.settings-group-body { padding: 20px; }
.profile-layout .settings-group-body > .panel { padding: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.profile-layout .settings-group-body > .panel + .panel { padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--line); }
.print-help { font-size: var(--text-action); }
.print-help h2 { font-size: var(--text-subheading); }
.print-help ol { padding-left: 22px; margin: 20px 0; }
.print-help li + li, .print-help p + p { margin-top: 16px; }
.print-help p { color: #52617b; }
@media (max-width: 600px) {
  .start-page { margin: 32px auto; }
  .start-page > .primary { width: 100%; }
  .start-page > p { font-size: var(--text-body); }
  .start-page > .start-note { margin-top: 40px; }
  .settings-group > summary, .settings-group-body { padding: 16px; }
  .settings-group > summary strong { font-size: var(--text-body); }
}

.nav-add {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  background: var(--yellow);
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 3px solid white;
  box-shadow: 0 3px 14px #ffe6003d;
}

.nav-add .icon {
  width: 28px;
  height: 28px;
  stroke-width: 2.2;
}

.nav-add:hover {
  background: #f1db00;
}

/* Search Panel */
.search-panel {
  border-top: 1px solid #f0f2f7;
  box-shadow: 0 10px 22px #1c335908;
  width: 100%;
}

.search-inner {
  max-width: 1100px;
  padding: 20px 24px 24px;
  margin: auto;
  width: 100%;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f6f8fc;
  border: 1px solid #e2e7f1;
  border-radius: 999px;
  padding: 0 18px;
  height: 52px;
  width: 100%;
}

.search-field .icon {
  color: var(--blue);
  width: 21px;
}

.search-field input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  box-shadow: none;
  padding: 0;
  min-width: 0;
  font-size: var(--text-body);
  height: 50px;
}

.search-field kbd {
  color: #a0a9bb;
  font-size: var(--text-caption);
  border: 1px solid #e1e5ef;
  padding: 2px 6px;
  border-radius: 5px;
}

.search-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: var(--text-small);
  color: var(--muted);
}

.search-caption .text-button {
  font-size: var(--text-small);
}

.search-results {
  max-height: 270px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  width: 100%;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  padding: 12px 8px;
  text-align: left;
  border-radius: 12px;
  min-width: 0;
}

.search-result:hover {
  background: var(--blue-light);
}

.result-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f0f3fa;
  color: var(--blue);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: var(--text-label);
  font-weight: 750;
}

.search-result > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.search-result strong {
  font-size: var(--text-action);
}

.search-result > span:nth-child(2) > span {
  font-size: var(--text-small);
  color: var(--muted);
}

.search-result > .icon {
  width: 18px;
  color: #9ba8bf;
  flex-shrink: 0;
}

.search-empty {
  padding: 25px 10px;
  grid-column: 1 / -1;
  color: #65728b;
  font-size: var(--text-label);
}

.search-empty > span {
  font-size: var(--text-small);
  color: var(--muted);
}

/* Modals & Forms */
.modal {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  width: 530px;
  max-width: calc(100% - 24px);
  max-height: calc(100dvh - 48px);
  box-shadow: 0 30px 100px #1c2c4d26;
  overscroll-behavior: contain;
  margin: auto;
}

.modal::backdrop {
  background: #18243b52;
  backdrop-filter: blur(4px);
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.modal-heading .eyebrow {
  font-size: var(--text-small);
  margin-bottom: 4px;
}

.modal-heading h2 {
  font-size: var(--text-title);
}

.modal-heading > .icon-button {
  color: #8c97ad;
  background: #f7f8fb;
}

.modal-intro {
  font-size: var(--text-action);
  color: var(--muted);
  margin: -8px 0 22px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 17px;
  width: 100%;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: var(--text-label);
  font-weight: 700;
  color: #3f4a5e;
}

input, select, textarea {
  color: var(--ink);
  border: 1px solid #e2e7f0;
  border-radius: 12px;
  background: #fcfcfe;
  padding: 12px 14px;
  min-width: 0;
  width: 100%;
  font-size: var(--text-body);
  transition: box-shadow .15s, border-color .15s;
}

input, select {
  min-height: 50px;
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

input::placeholder, textarea::placeholder {
  color: #5b6880;
  opacity: 1;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #c2b328;
  box-shadow: 0 0 0 3px #ffe60027;
}

select {
  cursor: pointer;
  padding-right: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

.postcode-row {
  grid-template-columns: 1fr 2fr;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.form-actions .button {
  padding: 12px 22px;
}

.form-error {
  font-size: var(--text-label);
  color: #b6463c;
  overflow-wrap: anywhere;
}

.form-error:empty {
  display: none;
}

.field-help {
  font-size: var(--text-small);
  color: var(--muted);
}

.form-divider {
  height: 1px;
  background: var(--line);
  margin: 5px 0;
}

.action-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-menu > button {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  background: #f8f9fc;
  padding: 18px 18px;
  border-radius: 17px;
  width: 100%;
}

.action-menu > button:hover {
  background: #f0f3fc;
}

.action-menu > button > .icon:first-child {
  color: var(--blue);
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.action-menu > button > span {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.action-menu strong {
  font-size: var(--text-action);
}

.action-menu span span {
  font-size: var(--text-small);
  color: var(--muted);
}

.action-menu > button > .icon:last-child {
  width: 18px;
  color: #91a0bb;
  flex-shrink: 0;
}

/* Photos Grid & Viewer */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.photo-tile {
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: left;
  overflow: hidden;
  width: 100%;
  min-width: 0;
}

.photo-tile img {
  width: 100%;
  height: 135px;
  object-fit: cover;
  background: #f1f4fc;
}

.photo-caption {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 12px;
}

.photo-caption strong {
  font-size: var(--text-label);
  font-weight: 750;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.photo-caption > span {
  font-size: var(--text-small);
  color: var(--muted);
}

.photo-viewer > img {
  max-height: 55dvh;
  width: 100%;
  object-fit: contain;
  border-radius: 16px;
  background: #f4f6fb;
}

.photo-viewer p {
  font-size: var(--text-label);
  margin: 14px 0 20px;
  overflow-wrap: anywhere;
}

.photo-viewer p span {
  color: var(--muted);
}

.danger {
  background: #fff3f2;
  color: #b54439;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 105px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1f293b;
  color: #fff;
  border-radius: 16px;
  padding: 14px 20px;
  box-shadow: 0 12px 30px #15233a29;
  font-size: var(--text-label);
  font-weight: 600;
  max-width: calc(100vw - 32px);
  width: max-content;
}

.toast .icon {
  color: #c8e6a6;
  width: 20px;
  height: 20px;
}

.toast.error {
  background: #7c352f;
}

.toast.error .icon {
  color: #ffc7b9;
}

/* Profile Panel */
.profile-panel {
  max-width: 690px;
  margin: 0 auto;
}

.profile-intro {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 28px;
}

.profile-intro p {
  font-size: var(--text-label);
  color: var(--muted);
  margin-top: 3px;
}

.profile-panel .button {
  align-self: flex-start;
  margin-top: 8px;
}

.logout-button {
  display: flex;
  margin: 20px auto;
}

.installation-select {
  margin-bottom: 17px;
  font-size: var(--text-label);
}

.empty-state {
  padding: 35px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.empty-state > .icon {
  width: 42px;
  height: 42px;
  color: #8199e9;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: var(--text-heading);
}

.empty-state p {
  font-size: var(--text-action);
  color: var(--muted);
  margin: 8px 0 22px;
  max-width: 320px;
}

.welcome-card {
  padding: 32px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 650px;
  margin: auto;
  width: 100%;
}

.welcome-card > img {
  height: 220px;
  object-fit: contain;
  margin: 0 auto 20px;
}

.welcome-card > p {
  max-width: 360px;
  margin: 14px auto 24px;
  color: var(--muted);
  font-size: var(--text-action);
}

.welcome-card h2 {
  font-size: var(--text-title);
}

.loading-state {
  padding: 40px 10px;
  text-align: center;
  color: var(--muted);
  font-size: var(--text-action);
}

.loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 9px;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  to { opacity: .25; }
}

.connection-error {
  max-width: 650px;
  margin: auto;
  text-align: center;
}

.connection-error h1 {
  font-size: var(--text-title);
  margin-top: 15px;
}

.connection-error p {
  margin: 18px 0;
  color: #78869e;
  font-size: var(--text-action);
}

.mobile-only {
  display: none;
}

/* Invoices */
.compact {
  padding: 20px 24px;
  margin-bottom: 24px;
}

.compact .customer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  font-size: var(--text-emphasis);
}

.compact .customer-name h2 {
  font-size: var(--text-heading);
}

.compact .customer-contact {
  margin-top: 16px;
  padding-top: 16px;
}

.invoice-list-panel {
  margin-top: 24px;
}

.invoice-list-panel > .section-heading > h2 {
  font-size: var(--text-subheading);
}

.invoice-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 0;
  border-bottom: 1px solid #eef1f6;
  background: transparent;
  text-align: left;
}

.invoice-list-item:last-child {
  border-bottom: 0;
}

.invoice-list-item:hover .invoice-list-name strong {
  color: var(--blue);
}

.document-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 48px;
  background: #f3f5fc;
  border-radius: 12px;
  color: var(--blue);
  flex-shrink: 0;
}

.invoice-list-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.invoice-list-name > strong {
  font-size: var(--text-body);
}

.invoice-list-name > span {
  font-size: var(--text-label);
  color: var(--muted);
}

.inline-status {
  margin-left: 8px;
  font-size: var(--text-caption);
  font-weight: 700;
  background: #f1f3f8;
  color: #788398;
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
}

.inline-status.issued {
  color: var(--green);
  background: #edf9f4;
}

.invoice-list-price {
  font-size: var(--text-emphasis);
  font-weight: 800;
  white-space: nowrap;
}

.invoice-list-item > .icon {
  width: 18px;
  color: #9cabc1;
  flex-shrink: 0;
}

.back-button {
  margin-bottom: 18px;
  font-size: var(--text-label);
}

.draft-badge {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: var(--text-small);
  color: #7a8497;
}

.invoice-dates {
  margin-bottom: 19px;
}

.invoice-installation {
  max-width: 100%;
  margin-bottom: 26px;
}

.positions-heading {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.positions-heading h2 {
  display: flex;
  gap: 8px;
  align-items: center;
}

.muted {
  font-size: var(--text-small);
  color: var(--muted);
}

.invoice-item {
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 20px;
  width: 100%;
  min-width: 0;
}

.invoice-item legend {
  padding: 0 8px;
  font-size: var(--text-small);
  letter-spacing: 1.1px;
  color: var(--blue);
  font-weight: 750;
}

.item-description-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
}

.item-description-row > input {
  font-weight: 650;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 9px 0;
  font-size: var(--text-body);
}

.item-description-row > .icon-button {
  color: #a5acba;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.item-fields {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.3fr 1fr;
  gap: 14px;
  width: 100%;
}

.item-fields input, .item-fields select {
  background: #f8f9fc;
  font-size: var(--text-action);
}

.item-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  font-size: var(--text-label);
  color: #98a1b1;
}

.item-subtotal strong {
  color: var(--ink);
  font-size: var(--text-emphasis);
}

.add-position {
  border: 1px dashed #d6deec;
  border-radius: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  background: #fcfcfe;
  width: 100%;
  min-height: 50px;
  font-size: var(--text-action);
  font-weight: 700;
  color: #667999;
}

.add-position:hover {
  background: #f1f4ff;
  color: var(--blue);
}

.add-position .icon {
  width: 19px;
}

.invoice-bottom {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 22px;
  margin-top: 22px;
  align-items: start;
  width: 100%;
}

.invoice-message {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.invoice-message > label:last-child {
  max-width: 220px;
}

.totals-panel > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  font-size: var(--text-action);
  color: #8a94a7;
}

.totals-panel strong {
  color: #4e5d78;
  font-weight: 650;
}

.totals-panel > .total-row {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 19px;
  color: var(--ink);
  font-size: var(--text-body);
  font-weight: 700;
  align-items: center;
}

.total-row > strong {
  font-size: 28px;
  color: var(--ink);
  font-weight: 850;
  letter-spacing: -.9px;
}

.tax-help {
  font-size: var(--text-small);
  color: var(--muted);
}

.invoice-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.invoice-actions .primary {
  margin-left: auto;
}

.invoice-hint {
  text-align: right;
  font-size: var(--text-small);
  color: var(--muted);
  margin: 14px 0;
}

.issued-panel {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 40px;
}

.issued-check {
  display: grid;
  place-items: center;
  background: #edf9f3;
  color: var(--green);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 5px;
}

.issued-panel p {
  font-size: var(--text-action);
  color: var(--muted);
  max-width: 360px;
}

.issued-total {
  font-size: 38px;
  letter-spacing: -1px;
  margin-top: 10px;
}

.issued-panel .button {
  margin-top: 14px;
}

/* ==========================================================================
   Responsive / Mobile Breakpoints (Guaranteed no horizontal overflow)
   ========================================================================== */

@media (min-width: 1400px) {
  .workspace { padding-top: 44px; }
  .header-inner { height: 96px; }
  .overview-grid { gap: 26px; }
  .panel { padding: 28px; }
  .customer-card { padding: 28px 32px; }
}

@media (max-width: 850px) {
  .header-tagline { display: none !important; }
  .customer-contact {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  .contact-links {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .overview-grid {
    grid-template-columns: 100%;
    gap: 20px;
    width: 100%;
  }
  .panel { padding: 20px; }
  .equipment-art { width: 56px; }
  .photo-grid { gap: 10px; }
  .photo-tile img { height: 120px; }
  .header-inner { height: 80px; }
  .workspace { padding-top: 22px; }
  .invoice-bottom { grid-template-columns: 100%; gap: 18px; }
}

@media (max-width: 650px) {
  body {
    font-size: var(--text-body);
  }
  .header-inner {
    height: 76px;
    padding: 0 16px;
    gap: 10px;
  }
  .brand {
    gap: 10px;
  }
  .brand-art {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    padding: 5px;
  }
  .wordmark {
    font-size: var(--text-title);
    letter-spacing: -1.5px;
    gap: 5px;
  }
  .header-actions {
    gap: 8px;
  }
  .help-button, .avatar-button {
    width: 40px;
    height: 40px;
  }
  .workspace {
    padding: 18px 14px 140px;
    width: 100%;
    min-height: calc(100dvh - 76px);
  }
  .page-heading {
    margin-bottom: 18px;
  }
  .page-heading h1 {
    font-size: var(--text-title);
    letter-spacing: -.7px;
  }
  .page-heading .eyebrow {
    font-size: var(--text-small);
    margin-bottom: 4px;
  }
  .desktop-add {
    display: none;
  }
  .customer-card {
    padding: 18px 16px;
    border-radius: 20px;
    width: 100%;
  }
  .customer-avatar {
    width: 52px;
    height: 52px;
    font-size: var(--text-subheading);
  }
  .customer-name h2 {
    font-size: var(--text-heading);
  }
  .customer-name p {
    font-size: var(--text-label);
  }
  .customer-meta {
    font-size: var(--text-small);
  }
  .customer-contact {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 16px;
    margin-top: 16px;
    width: 100%;
  }
  .address {
    font-size: var(--text-label);
  }
  .contact-links {
    grid-template-columns: 100%;
    gap: 8px;
    width: 100%;
  }
  .contact-link {
    font-size: var(--text-label);
    padding: 11px 13px;
  }
  .section-tabs {
    margin: 16px 0 20px;
    gap: 18px;
  }
  .section-tabs button {
    font-size: var(--text-action);
  }
  .tab-hint {
    display: none;
  }
  .panel {
    padding: 18px 16px;
    border-radius: 20px;
    width: 100%;
  }
  .section-heading {
    margin-bottom: 16px;
  }
  .section-heading h2 {
    font-size: var(--text-subheading);
  }
  .equipment-card {
    padding: 16px;
    gap: 12px;
    width: 100%;
  }
  .equipment-card h3 {
    font-size: var(--text-subheading);
  }
  .serial {
    font-size: var(--text-small);
  }
  .serial span {
    font-size: var(--text-small);
  }
  .equipment-meta {
    margin: 14px 0 18px;
    gap: 8px;
  }
  .status-pill {
    font-size: var(--text-small);
  }
  .location-label {
    font-size: var(--text-small);
  }
  .notes-heading label {
    font-size: var(--text-body);
  }
  .notes-heading > span {
    font-size: var(--text-small);
  }
  .editor-toolbar {
    padding: 8px;
    gap: 5px;
  }
  .editor-btn {
    font-size: var(--text-small);
    padding: 6px 10px;
    min-height: 36px;
  }
  .notes-area textarea {
    font-size: var(--text-body);
    line-height: 1.75;
    padding: 14px 14px 6px;
  }
  .notes-preview {
    font-size: var(--text-action);
    padding: 14px;
  }
  .notes-footer {
    padding: 8px 12px 10px;
    font-size: var(--text-caption);
  }
  .save-status {
    font-size: var(--text-caption);
  }
  .upload-empty {
    min-height: 210px;
    padding: 22px 12px;
  }
  .upload-empty > strong {
    font-size: var(--text-emphasis);
  }
  .upload-empty > span:not(.camera-bubble) {
    font-size: var(--text-label);
  }
  .photo-help {
    font-size: var(--text-caption);
  }
  .photo-tile img {
    height: 125px;
  }
  .photo-caption strong {
    font-size: var(--text-label);
  }
  .photo-caption > span {
    font-size: var(--text-caption);
  }
  .invoice-shortcut {
    padding: 16px 16px;
  }
  .invoice-shortcut strong {
    font-size: var(--text-action);
  }
  .invoice-shortcut > span:nth-child(2) > span {
    font-size: var(--text-small);
  }
  .workspace-footer {
    font-size: var(--text-caption);
    margin-top: 22px;
  }
  .bottom-nav {
    bottom: max(12px, env(safe-area-inset-bottom));
    height: 74px;
    gap: 4px;
    padding: 5px 8px;
    width: calc(100% - 20px);
    max-width: 420px;
  }
  .nav-item {
    font-size: var(--text-caption);
    padding: 4px 1px;
  }
  .nav-item .icon {
    width: 22px;
    height: 22px;
  }
  .nav-add {
    width: 56px;
    height: 56px;
  }
  .nav-add .icon {
    width: 26px;
    height: 26px;
  }
  .search-inner {
    padding: 14px 16px 18px;
  }
  .search-results {
    grid-template-columns: 100%;
    gap: 2px;
  }
  .search-field {
    padding: 0 14px;
  }
  .search-field input {
    font-size: var(--text-body);
  }
  .search-field kbd {
    display: none;
  }
  .search-caption {
    font-size: var(--text-small);
  }
  .modal {
    max-width: calc(100% - 20px);
    padding: 22px 16px;
    border-radius: 22px;
  }
  .modal-heading h2 {
    font-size: var(--text-heading);
  }
  .form-actions .button {
    font-size: var(--text-label);
    padding: 12px 18px;
    min-height: 48px;
  }
  input, select, textarea {
    font-size: var(--text-body);
  }
  label {
    font-size: var(--text-label);
  }
  .form-stack {
    gap: 15px;
  }
  .form-row {
    gap: 10px;
  }
  .mobile-only {
    display: inline-grid;
  }
  .invoice-list-item {
    padding: 16px 0;
  }
  .invoice-list-name > strong {
    font-size: var(--text-action);
  }
  .invoice-list-price {
    font-size: var(--text-body);
  }
  .invoice-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .invoice-actions .button {
    padding: 12px;
    font-size: var(--text-label);
    min-height: 48px;
  }
  .invoice-actions .primary {
    margin-left: 0;
  }
  .invoice-actions:has(.print-link) .primary {
    grid-column: 1 / -1;
  }
  .item-fields {
    grid-template-columns: 1fr 1.2fr;
    gap: 10px;
  }
}

@media (max-width: 370px) {
  .header-inner {
    padding: 0 12px;
    gap: 6px;
  }
  .brand-art {
    width: 36px;
    height: 36px;
  }
  .wordmark {
    font-size: var(--text-title);
  }
  .workspace {
    padding-left: 10px;
    padding-right: 10px;
  }
  .customer-card, .panel {
    padding: 15px 12px;
  }
  .customer-name h2 {
    font-size: var(--text-subheading);
  }
  .bottom-nav {
    gap: 2px;
    padding: 4px 6px;
    width: calc(100% - 16px);
  }
  .nav-item {
    font-size: var(--text-caption);
  }
  .nav-add {
    width: 50px;
    height: 50px;
  }
}

/* ==========================================================================
   Auth / Startseite (Login & Registrierung)
   ========================================================================== */

.auth-page {
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 36px 24px 60px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.auth-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
}

.auth-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 10px 0 28px;
}

.auth-hero img {
  width: 100%;
  max-width: 280px;
  height: auto;
  max-height: 270px;
  object-fit: contain;
  display: block;
}

.auth-card {
  width: 100%;
  background: transparent;
  display: flex;
  flex-direction: column;
  text-align: left;
  box-sizing: border-box;
}

.auth-brand {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.auth-brand .wordmark {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -2px;
  color: #111827;
  transform: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-brand .wordmark > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  margin: 4px 0 0 2px;
}

.auth-card .eyebrow {
  font-size: var(--text-small);
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #8b96aa;
  margin: 2px 0 10px;
  text-transform: uppercase;
}

.auth-card h1 {
  font-size: 34px;
  font-weight: 850;
  letter-spacing: -1.2px;
  line-height: 1.2;
  color: #111827;
  margin: 0 0 12px;
}

.auth-intro {
  font-size: var(--text-emphasis);
  line-height: 1.55;
  color: #4b5563;
  margin-bottom: 26px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  background: #f1f4f9;
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 22px;
  width: 100%;
}

.auth-tabs button {
  flex: 1;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: var(--text-action);
  font-weight: 750;
  color: #6b7280;
  background: transparent;
  transition: all .15s;
  text-align: center;
  border: 0;
}

.auth-tabs button[aria-pressed="true"] {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 2px 8px #00000010;
}

.auth-card .form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.auth-card label {
  font-size: var(--text-action);
  font-weight: 750;
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-card input {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0 16px;
  font-size: var(--text-body);
  box-shadow: inset 0 1px 2px #00000005;
  width: 100%;
}

.auth-card input:focus {
  border-color: #ffd700;
  box-shadow: 0 0 0 3px #ffe60033;
  outline: none;
}

.auth-card .button.primary {
  width: 100%;
  min-height: 54px;
  border-radius: 999px;
  background: #ffe600;
  color: #111827;
  font-size: var(--text-emphasis);
  font-weight: 800;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 3px 12px #ffe6003d;
  border: 0;
}

.auth-card .button.primary:hover {
  background: #f3dc00;
}

.auth-footer {
  font-size: var(--text-label);
  color: #64748b;
  line-height: 1.5;
  margin-top: 20px;
  text-align: left;
}

.legacy-claim {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: var(--text-label);
  color: #374151;
}

.legacy-claim input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

@media (max-width: 650px) {
  .auth-page {
    padding: 24px 18px 48px;
  }
  .auth-hero {
    padding: 8px 0 20px;
  }
  .auth-hero img {
    max-width: 250px;
    max-height: 240px;
  }
  .auth-card h1 {
    font-size: 28px;
    letter-spacing: -.9px;
  }
  .auth-intro {
    font-size: var(--text-body);
    margin-bottom: 22px;
  }
}

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

/* Room for the shared, larger type at every viewport size. */
small { font-size: var(--text-caption); }
.workspace { padding-bottom: calc(10rem + env(safe-area-inset-bottom)); }
.bottom-nav { height: auto; min-height: 104px; align-items: stretch; }
.nav-item { min-height: 90px; justify-content: flex-start; padding: 10px 2px 6px; font-size: var(--text-caption); }
.nav-item > .icon { margin-bottom: 3px; }
.text-button { min-height: 48px; white-space: normal; text-align: left; }
.search-field { height: auto; min-height: 64px; }
.search-field input { height: auto; min-height: 60px; }
.search-caption { flex-wrap: wrap; gap: 8px 16px; }
.customers-page .search-results { max-height: none; }
.section-tabs button { height: auto; min-height: 56px; padding-top: 10px; padding-bottom: 10px; }
.section-tabs button:not(.selected) { color: #52617b; }
.form-stack { gap: 22px; }
.form-actions { flex-wrap: wrap; }
.modal-heading { align-items: flex-start; }
.modal-heading > div { min-width: 0; }
.modal .form-actions > .button { min-height: 56px; }
.start-page > .primary { max-width: 100%; white-space: normal; }
.start-page > p { max-width: 46ch; }
input, select { min-height: 60px; }
.notes-footer { flex-wrap: wrap; gap: 8px; }

@media (max-width: 650px) {
  .workspace { padding-bottom: calc(10rem + env(safe-area-inset-bottom)); }
  .bottom-nav { height: auto; min-height: 104px; max-width: 500px; }
  .nav-item { font-size: var(--text-caption); padding: 10px 1px 6px; }
  .page-heading > .button { width: 100%; }
  .form-row, .postcode-row { grid-template-columns: minmax(0, 1fr); }
  .photo-grid { grid-template-columns: minmax(0, 1fr); }
  .photo-caption strong { white-space: normal; }
  .invoice-actions { grid-template-columns: minmax(0, 1fr); }
}

