:root {
  --bg: #f8f5ee;
  --surface: #ffffff;
  --surface-soft: #fffaf0;
  --ink: #172b2d;
  --muted: #6f7568;
  --line: #e3d9c8;
  --nav: #123c3c;
  --nav-soft: #1f5a55;
  --accent: #0f766e;
  --accent-dark: #0a5f59;
  --red: #b42318;
  --red-bg: #fff0ee;
  --amber: #9a5b00;
  --amber-bg: #fff3c4;
  --green: #177245;
  --green-bg: #eaf8ed;
  --blue-bg: #eaf6ff;
  --blue: #1f6f8b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  background: var(--bg);
  color: var(--ink);
}

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

body.settings-mode .settings-only {
  display: inline-flex !important;
}

.hidden-module {
  display: none !important;
}

.settings-edge {
  position: fixed;
  top: 42%;
  right: 0;
  z-index: 80;
  padding: 14px 0 14px 14px;
  transition: opacity 0.18s ease;
  opacity: 0.55;
}

.settings-edge:hover,
body.settings-mode .settings-edge {
  opacity: 1;
}

.settings-mode-button {
  width: 36px;
  height: 48px;
  border: 1px solid #bfd1d4;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: #eef8fa;
  color: #264b55;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(28, 57, 64, 0.16);
  transform: translateX(14px);
  transition: transform 0.18s ease;
}

body.settings-mode .settings-mode-button {
  background: #d6f0f5;
  border-color: #6fb6c7;
}

.settings-edge:hover .settings-mode-button,
body.settings-mode .settings-mode-button {
  transform: translateX(0);
}

.floating-back-button {
  position: fixed;
  left: 246px;
  top: 92px;
  z-index: 120;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  display: none;
  place-items: center;
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.floating-back-button.visible {
  display: grid;
}

.floating-back-button:focus-visible {
  outline: 2px solid #5eead4;
  outline-offset: 2px;
}

@media (max-width: 650px) {
  .floating-back-button {
    left: 12px;
    top: 86px;
    width: 42px;
    height: 42px;
    font-size: 32px;
  }
}

.settings-panel {
  position: fixed;
  top: 86px;
  right: 14px;
  width: min(520px, calc(100vw - 28px));
  z-index: 90;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(23, 45, 51, 0.18);
  padding: 14px;
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.settings-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.quote-price-settings {
  border: 1px solid var(--line);
  background: #f8fbfa;
  padding: 12px;
  display: grid;
  gap: 10px;
}

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

.settings-check {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  color: var(--ink) !important;
}

.mail-panel {
  padding: 0;
  overflow: hidden;
  border-radius: 0;
}

.mail-panel > .panel-head {
  display: none;
}

.mail-module-content {
  min-height: calc(100vh - 96px);
}

.ari-mail-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: calc(100vh - 96px);
  background: #fff;
  color: #1f2933;
  font-size: 13px;
}

body.mail-view-active main {
  padding-top: 20px;
}

body.mail-view-active .topbar,
body.mail-view-active #appModeNotice {
  display: none !important;
}

body.mail-view-active .mail-panel {
  margin-top: 0;
}

body.mail-view-active .mail-module-content,
body.mail-view-active .ari-mail-shell {
  min-height: calc(100vh - 40px);
}

.ari-mail-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 14px;
  background: #126fb3;
  color: #fff;
}

.ari-mail-titlebar strong {
  font-size: 0.9rem;
  font-weight: 850;
}

.ari-mail-titlebar span {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.92;
}

.ari-mail-ribbon {
  border-bottom: 1px solid #c8cdd2;
  background: #f3f3f3;
}

.ari-mail-toolbar {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 78px;
  padding: 7px 8px 6px;
  background: #f3f3f3;
  overflow-x: auto;
}

.ari-mail-toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border-right: 1px solid #d2d2d2;
}

.ari-mail-toolbar button {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 58px;
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #1f2933;
  padding: 5px 6px;
  font-size: 0.72rem;
  font-weight: 760;
  white-space: nowrap;
}

.ari-mail-toolbar button:hover,
.ari-mail-toolbar button.primary {
  border-color: #b8c8d8;
  background: #fff;
}

.ari-mail-toolbar button span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border: 1px solid #b8c8d8;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #edf6ff 100%);
  color: #126fb3;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ari-mail-toolbar button.primary span {
  background: linear-gradient(180deg, #e9f5ff 0%, #d7ecff 100%);
  border-color: #85b9df;
}

.ari-mail-layout {
  display: grid;
  grid-template-columns: 172px 318px minmax(560px, 1fr);
  min-height: 0;
  background: #fff;
}

.ari-mail-account-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #d7d7d7;
  background: #f8fbff;
}

.ari-mail-account-switch button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #bdd2e8;
  border-radius: 6px;
  background: #ffffff;
  color: #12324f;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.ari-mail-account-switch button.active {
  border-color: #0f6ec7;
  background: #0f6ec7;
  color: #ffffff;
}

.ari-mail-folders {
  border-right: 1px solid #d7d7d7;
  background: #f5f5f5;
  padding: 8px 0;
  overflow-y: auto;
}

.ari-mail-account {
  padding: 6px 10px 8px;
  border-bottom: 1px solid #d7d7d7;
}

.ari-mail-account strong,
.ari-mail-account span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ari-mail-account strong {
  font-size: 0.78rem;
  font-weight: 900;
}

.ari-mail-account span {
  margin-top: 3px;
  color: #65727d;
  font-size: 0.7rem;
  font-weight: 760;
}

.ari-mail-account-switch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 7px;
}

.ari-mail-folders .ari-mail-account-switch button {
  min-height: 26px;
  border: 1px solid #c8d4e0;
  border-radius: 4px;
  background: #fff;
  color: #17324d;
  padding: 4px 7px;
  font-size: 0.72rem;
  font-weight: 850;
  text-align: left;
}

.ari-mail-folders .ari-mail-account-switch button.active {
  border-color: #1473c8;
  background: #dceeff;
  color: #073b67;
}

.ari-mail-folders button {
  width: 100%;
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1f2933;
  padding: 4px 10px 4px 16px;
  font-size: 0.76rem;
  font-weight: 760;
  text-align: left;
}

.ari-mail-folders button.active,
.ari-mail-folders button:hover {
  background: #dceefa;
  color: #0f5f9d;
}

.ari-mail-folders small {
  color: #126fb3;
  font-weight: 900;
}

.ari-mail-list {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid #d7d7d7;
  background: #fff;
  min-width: 0;
}

.ari-mail-list-search {
  border-bottom: 1px solid #d7d7d7;
  background: #fafafa;
}

.ari-mail-list-search label {
  display: block;
  padding: 8px;
}

.ari-mail-list-search input {
  width: 100%;
  min-height: 27px;
  border: 1px solid #bfc7ce;
  border-radius: 2px;
  padding: 5px 8px;
  font-size: 0.76rem;
  background: #fff;
}

.ari-mail-list-search div {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 28px;
  padding: 0 10px;
  color: #65727d;
  font-size: 0.72rem;
  font-weight: 820;
}

.ari-mail-list-search strong {
  color: #126fb3;
}

.ari-mail-list-search small {
  justify-self: end;
  color: #65727d;
  font-weight: 820;
}

.ari-mail-list-scroll {
  overflow-y: auto;
}

.ari-mail-row {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 38px;
  gap: 6px;
  border: 0;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #e4e7ea;
  background: #fff;
  color: #1f2933;
  padding: 9px 8px;
  text-align: left;
}

.ari-mail-row:hover,
.ari-mail-row.selected {
  background: #dff0fb;
  border-left-color: #126fb3;
}

.ari-mail-row.unread {
  background: #fafdff;
}

.ari-mail-row-status {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  margin-top: 5px;
  background: transparent;
}

.ari-mail-row.unread .ari-mail-row-status {
  background: var(--accent);
}

.ari-mail-row-main,
.ari-mail-row-head,
.ari-mail-row-subject,
.ari-mail-row-preview {
  min-width: 0;
}

.ari-mail-row-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.ari-mail-row-head strong,
.ari-mail-row-subject,
.ari-mail-row-preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ari-mail-row-head strong {
  font-size: 0.78rem;
}

.ari-mail-row.unread .ari-mail-row-head strong,
.ari-mail-row.unread .ari-mail-row-subject {
  font-weight: 950;
}

.ari-mail-row-head time {
  flex: 0 0 auto;
  color: #5f6d78;
  font-size: 0.68rem;
  font-weight: 800;
}

.ari-mail-row-subject {
  margin-top: 3px;
  font-size: 0.75rem;
  font-weight: 820;
}

.ari-mail-row-preview {
  margin-top: 2px;
  color: #667782;
  font-size: 0.7rem;
  line-height: 1.3;
}

.ari-mail-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  min-width: 0;
}

.ari-mail-row-tags span {
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #cfe1ee;
  border-radius: 2px;
  background: #f4f9fd;
  color: #27506d;
  padding: 1px 5px;
  font-size: 0.62rem;
  font-weight: 850;
}

.ari-mail-row-tags span.warn {
  border-color: #ead8ad;
  background: #fff8e8;
  color: #815a00;
}

.ari-mail-row-icons {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 4px;
  color: #63717c;
  font-size: 0.82rem;
}

.ari-mail-star {
  color: #c1c8c4;
  font-size: 1rem;
  line-height: 1.2;
}

.ari-mail-star.active {
  color: #d99a00;
}

.ari-mail-reading-pane {
  min-width: 0;
  background: #fff;
  overflow-y: auto;
}

.ari-mail-empty-state,
.ari-mail-reading-empty {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 6px;
  min-height: 120px;
  border: 1px dashed #cfdce7;
  background: #fbfdff;
  color: #526372;
  margin: 10px;
  padding: 16px;
}

.ari-mail-reading-empty {
  min-height: 240px;
  margin: 18px;
}

.ari-mail-empty-state > span,
.ari-mail-reading-empty > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #bfd4e4;
  border-radius: 4px;
  background: #eef7ff;
  color: #126fb3;
  font-size: 1.1rem;
  font-weight: 950;
}

.ari-mail-empty-state.loading > span,
.ari-mail-reading-empty.loading > span {
  animation: ariMailSpin 1.1s linear infinite;
}

.ari-mail-empty-state strong,
.ari-mail-reading-empty strong {
  color: #22303b;
  font-size: 0.86rem;
  font-weight: 900;
}

.ari-mail-empty-state p,
.ari-mail-reading-empty p {
  margin: 0;
  color: #65727d;
  font-size: 0.74rem;
  line-height: 1.45;
}

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

.ari-mail-message {
  display: grid;
  gap: 12px;
  padding: 18px 22px 36px;
}

.ari-mail-message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.ari-mail-message-actions button,
.ari-mail-preview-actions button {
  min-height: 29px;
  border: 1px solid #bfc7ce;
  border-radius: 2px;
  background: #fff;
  color: #24313a;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

.ari-mail-message-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e4e7;
}

.ari-mail-category {
  display: inline-flex;
  margin-top: 7px;
  border-radius: 2px;
  background: #edf7ff;
  color: #126fb3;
  padding: 4px 7px;
  font-size: 0.68rem;
  font-weight: 900;
}

.ari-mail-message h3 {
  margin: 0;
  color: #24313a;
  font-size: 1.18rem;
  line-height: 1.2;
}

.ari-mail-sender-line {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 3px 0 4px;
}

.ari-mail-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 2px;
  background: #d7dde2;
  color: #fff;
  font-weight: 950;
}

.ari-mail-sender-line strong,
.ari-mail-sender-line span {
  display: block;
}

.ari-mail-sender-line strong {
  font-size: 0.82rem;
  font-weight: 900;
}

.ari-mail-sender-line span,
.ari-mail-sender-line time {
  color: #65727d;
  font-size: 0.72rem;
  font-weight: 760;
}

.ari-mail-meta-grid {
  display: grid;
  gap: 5px;
  margin: 0;
  font-size: 0.76rem;
}

.ari-mail-meta-grid div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
}

.ari-mail-meta-grid dt {
  color: #65727d;
  font-weight: 900;
}

.ari-mail-meta-grid dd {
  margin: 0;
  min-width: 0;
}

.ari-mail-meta-grid dd span {
  display: inline-flex;
  margin: 0 6px 6px 0;
  border-radius: 2px;
  background: #eef2f4;
  padding: 4px 7px;
  font-weight: 800;
}

.ari-mail-meta-grid dd a {
  display: inline-flex;
  margin: 0 6px 6px 0;
  border: 1px solid #cddbe7;
  border-radius: 2px;
  background: #f7fbff;
  color: #126fb3;
  padding: 4px 7px;
  font-weight: 850;
  text-decoration: none;
}

.ari-mail-body {
  min-height: 260px;
  border-top: 1px solid #e0e4e7;
  padding-top: 18px;
  color: #1f2933;
  line-height: 1.58;
  font-size: 0.82rem;
}

.ari-mail-body.loading {
  color: #617180;
  font-weight: 850;
}

.ari-mail-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ari-mail-ai-panel {
  border: 1px solid #d7e4ef;
  border-radius: 2px;
  background: #f7fbff;
  padding: 12px;
}

.ari-mail-ai-grid {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px 12px;
}

.ari-mail-ai-grid span {
  color: #65727d;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.ari-mail-ai-grid strong,
.ari-mail-ai-grid p {
  margin: 0;
  min-width: 0;
  color: #1f2933;
  font-size: 0.76rem;
  line-height: 1.35;
}

.ari-mail-compose-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: end center;
  background: rgba(9, 25, 42, 0.28);
  padding: 24px;
}

.ari-mail-compose {
  width: min(760px, calc(100vw - 32px));
  max-height: min(84vh, 720px);
  display: grid;
  gap: 10px;
  overflow: auto;
  border: 1px solid #b9c7d3;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(13, 34, 56, 0.22);
  padding: 14px;
}

.ari-mail-compose-head,
.ari-mail-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ari-mail-compose-head strong {
  color: #102a43;
  font-size: 1rem;
}

.ari-mail-compose-head button {
  border: 0;
  background: transparent;
  color: #126fb3;
  font-weight: 900;
}

.ari-mail-compose label {
  display: grid;
  gap: 5px;
  color: #5d6d78;
  font-size: 0.75rem;
  font-weight: 900;
}

.ari-mail-compose input,
.ari-mail-compose textarea {
  width: 100%;
  border: 1px solid #c9d5df;
  border-radius: 3px;
  background: #fff;
  color: #1f2933;
  padding: 9px 10px;
  font: inherit;
}

.ari-mail-compose textarea {
  resize: vertical;
  line-height: 1.5;
}

.ari-mail-compose-actions {
  flex-wrap: wrap;
}

.ari-mail-compose-actions span {
  color: #647480;
  font-size: 0.74rem;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .ari-mail-layout {
    grid-template-columns: 158px 292px minmax(430px, 1fr);
  }
}

@media (max-width: 920px) {
  .ari-mail-toolbar {
    min-height: 0;
  }

  .ari-mail-layout {
    grid-template-columns: 1fr;
  }

  .ari-mail-folders {
    display: flex;
    gap: 6px;
    border-right: 0;
    border-bottom: 1px solid #dbe3df;
    overflow-x: auto;
  }

  .ari-mail-folders button {
    width: auto;
    min-width: max-content;
  }

  .ari-mail-list {
    max-height: 320px;
    border-right: 0;
    border-bottom: 1px solid #d7d7d7;
  }

}

@media (max-width: 620px) {
  .ari-mail-message {
    padding: 14px;
  }

  .ari-mail-meta-grid div,
  .ari-mail-ai-grid {
    grid-template-columns: 1fr;
  }
}

.app-nav {
  min-height: 100vh;
  background: var(--nav);
  color: #f1f5f4;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #ffd27a;
  background: #ffd166;
  color: #172b2d;
  font-weight: 800;
}

.brand span:last-child {
  display: block;
  color: #d4e8df;
  font-size: 13px;
  margin-top: 2px;
}

nav {
  display: grid;
  gap: 7px;
}

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

button {
  border: 0;
  cursor: pointer;
}

.nav-button {
  min-height: 42px;
  text-align: left;
  padding: 0 13px;
  color: #edf8f3;
  background: transparent;
  border: 1px solid transparent;
  font-weight: 750;
}

.nav-button.active,
.nav-button:hover {
  background: var(--nav-soft);
  border-color: #67c7aa;
}

.source-box {
  margin-top: auto;
  border: 1px solid #67c7aa;
  padding: 14px;
  background: #0f4b48;
}

.source-box span,
.eyebrow,
.meta,
.muted {
  color: var(--muted);
}

.source-box span {
  color: #b8c4c1;
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.source-box p {
  color: #cdd7d4;
  line-height: 1.35;
  margin: 8px 0 0;
  font-size: 13px;
}

main {
  min-width: 0;
  padding: 20px;
}

.app-mode-notice {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #c9e4dc;
  background: #f8fffc;
  color: #28524c;
  font-size: 13px;
}

.app-mode-notice strong {
  font-size: 13px;
}

.app-mode-notice span {
  color: var(--muted);
}

.app-mode-notice code {
  width: fit-content;
  padding: 3px 6px;
  background: white;
  border: 1px solid var(--line);
  color: #0f4f49;
}

.app-mode-notice.warning {
  border-color: #e3c06f;
  background: #fff8e8;
  color: #684b12;
}

.app-mode-notice.ok {
  border-color: #b9dcd3;
  background: #f4fffb;
}

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

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

.voice-button {
  min-height: 36px;
  white-space: nowrap;
  border-color: #0f766e;
  color: #0f4f49;
  background: #e9f7f4;
}

.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;
}

.mic-icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  font-size: 19px;
  line-height: 1;
}

.mic-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #0f7a65;
  color: #fff;
  font-size: 16px;
}

.voice-panel {
  margin-bottom: 14px;
  background: linear-gradient(180deg, #f2fbf8 0%, #fffdf7 100%);
  border: 1px solid #8fcfc2;
  box-shadow: 0 8px 22px rgba(20, 83, 75, 0.08);
  padding: 12px;
}

.voice-panel:not(.mobile-open) {
  display: none;
}

.voice-panel.mobile-open {
  max-height: 42vh;
  overflow: auto;
}

.voice-panel.mobile-open .ai-settings-grid,
.voice-panel.mobile-open .voice-capability-status,
.voice-panel.mobile-open .voice-grid {
  display: none;
}

.deployment-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.deployment-mic-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #0f7a65;
  border-radius: 999px;
  background: #0f7a65;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 6px 16px rgba(15, 122, 101, 0.18);
}

.deployment-mic-button:hover {
  background: #0d6b59;
}

.mobile-voice-compact,
.mobile-dashboard-summary,
.mobile-calendar-summary {
  display: none;
}

.voice-panel.is-listening {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12), 0 8px 22px rgba(20, 83, 75, 0.1);
}

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

.voice-head h2 {
  color: #0f3f3a;
  font-size: 17px;
}

.voice-grid {
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: 12px;
}

.voice-panel.has-command .voice-grid {
  display: grid;
}

.voice-grid label {
  display: grid;
  gap: 5px;
}

.voice-grid span,
.voice-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.voice-grid textarea {
  min-height: 54px;
  resize: vertical;
}

.ari-conversation {
  max-height: 150px;
  overflow: auto;
  display: grid;
  gap: 8px;
  margin: 6px 0 8px;
  padding: 8px;
  border: 1px solid #c9e4dc;
  background: #ffffff;
}

.ari-message {
  max-width: 86%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  font-size: 12.5px;
  line-height: 1.4;
  white-space: normal;
}

.ari-message strong {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.ari-message.user {
  justify-self: end;
  background: #eaf7f4;
  border-color: #b8ded8;
}

.ari-message.assistant {
  justify-self: start;
  background: #fffdf8;
  border-color: #eadbb5;
}

.ari-talk-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  margin-bottom: 8px;
}

.ari-talk-form input {
  min-height: 40px;
  border-color: #8fcfc2;
  font-size: 14px;
}

.ari-mini-dialog {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid #b9dcd3;
  border-radius: 6px;
  background: #f7fffc;
  box-shadow: 0 4px 14px rgba(15, 63, 58, 0.08);
}

.ari-mini-dialog[hidden] {
  display: none;
}

.ari-mini-dialog strong {
  color: #0f3f3a;
}

.ari-mini-dialog .mini-question {
  font-size: 14px;
  font-weight: 900;
}

.ari-mini-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ari-mini-fields span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.ari-mini-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.ari-mini-actions button {
  min-height: 34px;
}

.voice-capability-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 5px 8px;
  border: 1px solid #c9e4dc;
  background: #f8fffc;
  color: #35635c;
  font-size: 12px;
  font-weight: 800;
}

.voice-capability-status.warning {
  border-color: #ead6a7;
  background: #fff8e8;
  color: #7a5b16;
}

.ari-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.ari-quick-prompts button {
  border: 1px solid #b9dcd3;
  background: #f7fffc;
  color: #15554e;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.voice-command-preview {
  min-height: 54px;
  border: 1px solid var(--line);
  background: white;
  padding: 10px;
  font-size: 13px;
}

.voice-command-preview p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

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

.voice-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.voice-toggle input {
  width: auto;
  min-height: auto;
}

.register-note-panel {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #fffdf7;
  border-color: #eadbb5;
}

.dashboard-note-panel {
  margin: 10px 0 0;
  border: 1px solid #eadbb5;
  border-radius: 6px;
  box-shadow: none;
}

.dashboard-month-panel .register-note-form {
  grid-template-columns: 1fr;
}

.dashboard-month-panel .register-note-actions {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.time-view-layout,
.time-project-list {
  display: grid;
  gap: 10px;
}

.time-project-list button {
  align-items: center;
  border: 1px solid var(--line);
  background: #f8fbfb;
  display: grid;
  gap: 2px;
  min-height: 44px;
  padding: 9px 10px;
  text-align: left;
}

.time-project-list span {
  color: var(--muted);
  font-size: 12px;
}

.register-note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: end;
}

.register-note-form label {
  display: grid;
  gap: 5px;
}

.register-note-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.register-note-form textarea {
  min-height: 42px;
  resize: vertical;
}

.register-note-actions {
  display: grid;
  gap: 5px;
}

.register-note-actions small {
  color: var(--muted);
  font-size: 11px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.back-button:disabled {
  opacity: 0.45;
  cursor: default;
}

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

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 16px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 850;
  margin-bottom: 6px;
}

.app-title-mark {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid #f5c85f;
  background: #fff3c4;
  color: #17423f;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.global-project-switch {
  min-width: 260px;
  max-width: 420px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #9ad8c5;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 760;
  color: #344044;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 0 15px;
  font-weight: 800;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.primary-button:hover {
  background: var(--accent-dark);
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric-card,
.panel,
.item-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(64, 48, 24, 0.05);
}

.metric-card {
  padding: 13px 14px;
  border-top: 3px solid #f5c85f;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.metric-card strong {
  font-size: 25px;
}

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

.dashboard-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  align-items: start;
}

.dashboard-week-panel,
.dashboard-month-panel {
  min-width: 0;
}

.quick-filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-filter {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  font-weight: 850;
  font-size: 12px;
}

.quick-filter.active {
  border-color: var(--accent);
  background: #edf8f6;
  color: var(--ink);
}

.dashboard-week-plan {
  display: grid;
  gap: 10px;
}

.dashboard-week-block {
  display: grid;
  gap: 6px;
}

.dashboard-week-block-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-week-days {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.week-day {
  min-width: 150px;
  border: 1px solid #d8e1e2;
  background: #f7faf9;
  border-radius: 5px;
  overflow: hidden;
}

.week-day.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(50, 131, 121, 0.12);
}

.week-day.calendar-drop-target,
.calendar-month-days .week-day.calendar-drop-target {
  border-color: #0b63f6 !important;
  background: #e7f0ff !important;
  box-shadow: inset 0 0 0 2px rgba(11, 99, 246, 0.22), 0 10px 24px rgba(11, 99, 246, 0.16) !important;
}

.week-day-head {
  width: 100%;
  min-height: 48px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 7px 9px;
  border: 0;
  border-bottom: 1px solid #d8e1e2;
  background: #dff3fb;
  color: var(--ink);
  text-align: left;
}

.week-day-head span {
  color: #24424a;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.week-day-head strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
}

.weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  color: #24424a;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.weather-badge small {
  color: #51727a;
  font-size: 11px;
  font-weight: 800;
}

.simple-disabled {
  display: none !important;
}

.simple-calendar-form {
  display: grid;
  grid-template-columns: 140px minmax(180px, 1.2fr) minmax(160px, 1fr) 130px 105px 105px auto;
  gap: 7px;
  align-items: center;
  margin: 0 0 10px;
}

.simple-calendar-form input,
.simple-calendar-form select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.simple-calendar-form .primary-button {
  min-height: 34px;
  padding: 6px 10px;
}

.simple-day-view {
  grid-template-columns: minmax(260px, 520px);
}

.dashboard-month-plan:empty {
  display: none;
}

.simple-project-row span small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.project-table.project-table-head,
.project-table.simple-project-row {
  grid-template-columns: 82px minmax(190px, 1.4fr) 110px minmax(130px, 0.9fr) minmax(190px, 1fr) minmax(190px, 0.8fr);
}

.week-day-items {
  display: grid;
  gap: 5px;
  padding: 6px;
  min-height: 82px;
  align-content: start;
}

.week-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  border: 1px solid #91caec;
  background: #cfeefe;
  color: #173b4a;
  border-left: 4px solid #61aede;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  min-width: 0;
}

.week-item[draggable="true"] {
  cursor: grab;
}

.week-item[draggable="true"]:active {
  cursor: grabbing;
}

.week-item span,
.week-item small,
.week-item em {
  color: #315a68;
  font-size: 11px;
  font-style: normal;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-item .week-item-time {
  color: #173b4a;
  font-size: 12px;
  font-weight: 950;
}

.week-item .week-item-range {
  color: #43606b;
  font-size: 10px;
  font-weight: 800;
}

.week-item strong {
  color: #173b4a;
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-item.critical {
  border-color: #ef9c94;
  border-left-color: #d35b50;
  background: #ffd9d6;
}

.week-item.urgent {
  border-color: #e6c363;
  border-left-color: #c49a2d;
  background: #fff2bd;
}

.week-item.done {
  border-left-color: var(--green);
  opacity: 0.78;
}

.week-item-tools {
  display: none;
  gap: 3px;
  margin-top: 3px;
}

.week-item:hover .week-item-tools,
.week-item:focus-within .week-item-tools {
  display: flex;
}

.week-item-tools button {
  min-width: 18px;
  min-height: 16px;
  border: 1px solid rgba(31, 111, 139, 0.28);
  background: rgba(255, 255, 255, 0.78);
  color: #173b4a;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 3px;
  cursor: pointer;
}

.week-item-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.week-item-mobile-actions button,
.task-mobile-delete,
.danger-soft {
  border: 1px solid #e4b4ac;
  background: #fff3f0;
  color: #8a1f13;
  font-weight: 800;
  min-height: 34px;
  padding: 6px 10px;
}

.week-item-mobile-actions button:not(.danger) {
  border-color: #d7c39a;
  background: #fff8e8;
  color: #704d00;
}

.ari-context-menu {
  position: fixed;
  z-index: 10000;
  min-width: 170px;
  padding: 6px;
  border: 1px solid rgba(22, 68, 77, 0.18);
  background: white;
  border-radius: 6px;
  box-shadow: 0 16px 40px rgba(16, 42, 48, 0.2);
  display: grid;
  gap: 3px;
}

.ari-context-menu strong {
  padding: 6px 8px 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.ari-context-menu button {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 8px 9px;
  border-radius: 4px;
  font-weight: 800;
  cursor: pointer;
}

.ari-context-menu button:hover {
  background: #e9f5f7;
}

.ari-context-menu button.danger {
  color: var(--red);
  background: #fff0ee;
  border-left: 3px solid #c64032;
}

.ari-context-menu button.danger:hover {
  background: #fff0ee;
}

.calendar-popup-edit {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: #f8fbfb;
  border-radius: 6px;
}

.calendar-popup-edit label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.calendar-popup-edit input,
.calendar-popup-edit textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 4px;
  padding: 7px 8px;
  font: inherit;
}

.calendar-popup-edit .wide,
.calendar-popup-actions {
  grid-column: 1 / -1;
}

.calendar-popup-actions {
  display: flex;
  justify-content: flex-end;
}

.mobile-critical-actions {
  gap: 8px;
  align-items: center;
}

.save-action-button,
.cancel-action-button,
.danger-action-button {
  min-height: 24px;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.save-action-button {
  border: 1px solid #0f7a65;
  background: #0f7a65;
  color: #fff;
}

.cancel-action-button {
  border: 1px solid #d9b35b;
  background: #fff6df;
  color: #6b4a00;
}

.danger-action-button {
  border: 1px solid #c64032;
  background: #c64032;
  color: #fff;
}

.save-action-button::before {
  content: "✓ ";
}

.cancel-action-button::before {
  content: "! ";
}

.danger-action-button::before {
  content: "× ";
}

.week-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 16px 4px;
}

.month-weekdays,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.month-weekdays {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 6px;
  text-align: center;
}

.month-cell {
  min-height: 34px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  display: grid;
  place-items: center;
  position: relative;
  font-size: 12px;
}

.month-cell.muted {
  border-color: transparent;
  background: transparent;
}

.month-cell.today {
  border-color: var(--accent);
  background: #edf8f6;
  font-weight: 900;
}

.month-cell.selected {
  outline: 2px solid var(--accent);
}

.month-cell.critical {
  border-color: #f3b7b0;
  background: #fff6f5;
}

.month-cell small {
  position: absolute;
  right: 3px;
  bottom: 2px;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
}

.dashboard-day-details {
  display: none;
}

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

.dashboard-day-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: white;
  padding: 7px 8px;
  font-size: 12px;
}

.dashboard-projects-panel {
  margin-bottom: 12px;
}

.dashboard-project-table,
.dashboard-project-row {
  display: grid;
  grid-template-columns: 82px minmax(180px, 1.4fr) 110px minmax(120px, 0.8fr) minmax(180px, 1fr) minmax(150px, 0.8fr);
  gap: 8px;
  align-items: center;
}

.dashboard-project-table-head {
  min-height: 30px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.dashboard-project-row {
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 4px;
  font-size: 12px;
}

.dashboard-project-row.selected,
.dashboard-detail-card {
  border-color: var(--accent);
  background: #f7f9f9;
}

.dashboard-project-row strong,
.dashboard-project-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-project-inline {
  display: grid;
  gap: 3px;
}

.dashboard-project-inline input,
.dashboard-inline-select,
.dashboard-small-input {
  width: 100%;
  min-height: 26px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 2px 4px;
  font-size: 12px;
}

.dashboard-project-inline input:focus,
.dashboard-inline-select:focus,
.dashboard-small-input:focus {
  border-color: var(--accent);
  background: white;
  outline: 0;
}

.project-timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: #0f1822;
  color: #f7fbfa;
  border-radius: 8px;
  overflow-x: auto;
}

.project-timeline-shell {
  overflow: hidden;
}

.project-timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  min-width: 760px;
}

.project-timeline-head div {
  display: grid;
  gap: 3px;
}

.project-timeline-head strong {
  font-size: 18px;
}

.project-timeline-head span {
  color: #a9b8bc;
  font-size: 12px;
  font-weight: 800;
}

.project-timeline-grid {
  display: grid;
  gap: 8px;
  min-width: 760px;
}

.project-timeline-axis,
.project-timeline-row {
  display: grid;
  grid-template-columns: 210px minmax(520px, 1fr);
  gap: 12px;
  align-items: center;
}

.project-timeline-days,
.project-timeline-track,
.mini-project-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--timeline-days), minmax(10px, 1fr));
}

.project-timeline-days {
  min-height: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.project-timeline-days span {
  color: #9fb0b4;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.project-timeline-row {
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 8px;
  cursor: pointer;
}

.project-timeline-row:hover,
.project-timeline-row.selected {
  border-color: #2dd4bf;
  background: rgba(45, 212, 191, 0.08);
}

.project-timeline-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-timeline-label strong {
  color: #2dd4bf;
  font-size: 12px;
}

.project-timeline-label span {
  color: #ffffff;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-timeline-label small {
  color: #9fb0b4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-timeline-track {
  min-height: 34px;
  align-items: center;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px calc(100% / var(--timeline-days))),
    rgba(8, 16, 24, 0.5);
  border-radius: 6px;
  overflow: hidden;
}

.timeline-segment {
  min-width: 6px;
  min-height: 22px;
  display: grid;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  color: white;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.timeline-segment em {
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-segment.compact {
  min-height: 8px;
  padding: 0;
  border-radius: 99px;
}

.timeline-planning {
  background: #3b82f6;
}

.timeline-production {
  background: #f59e0b;
}

.timeline-montage {
  background: #10b981;
}

.timeline-quote {
  background: #8b5cf6;
}

.timeline-appointment {
  background: #06b6d4;
}

.timeline-today {
  grid-row: 1;
  width: 2px;
  height: 100%;
  align-self: stretch;
  background: #ef4444;
  z-index: 2;
}

.dashboard-project-progress {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.mini-project-timeline {
  min-height: 8px;
  align-items: center;
  background: #dce6e2;
  border-radius: 999px;
  overflow: hidden;
}

.mini-project-timeline.empty {
  display: block;
  padding: 2px 6px;
  color: #52635f;
  font-size: 11px;
}

@media (max-width: 760px) {
  .project-timeline {
    margin: 10px 0 14px;
    padding: 10px;
    border-radius: 8px;
  }

  .project-timeline-head,
  .project-timeline-grid {
    min-width: 680px;
  }

  .project-timeline-axis,
  .project-timeline-row {
    grid-template-columns: 160px minmax(500px, 1fr);
    gap: 8px;
  }

  .project-timeline-row {
    min-height: 54px;
  }

  .project-timeline-label span {
    font-size: 12px;
  }

  .timeline-segment {
    min-height: 20px;
    font-size: 10px;
    padding-inline: 6px;
  }

  .dashboard-project-progress {
    width: 100%;
  }
}

.dashboard-next-action {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.dashboard-next-action span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-period,
.dashboard-time-summary {
  color: var(--muted);
  font-weight: 750;
}

.dashboard-row-actions,
.time-entry-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

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

.time-entry-actions details {
  position: relative;
}

.time-entry-actions summary {
  align-items: center;
  border: 1px solid var(--line);
  background: #f7fbfa;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 850;
  min-height: 34px;
  padding: 6px 10px;
}

.time-entry-edit-form {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(20, 34, 39, 0.15);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  padding: 10px;
  position: absolute;
  right: 0;
  top: 38px;
  width: min(520px, 86vw);
  z-index: 20;
}

.time-entry-edit-form label {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: 800;
  gap: 3px;
}

.time-entry-edit-form input,
.time-entry-edit-form select {
  border: 1px solid var(--line);
  min-height: 32px;
  padding: 5px 7px;
}

.time-entry-edit-form .wide {
  grid-column: 1 / -1;
}

.dashboard-project-detail-panel {
  margin-bottom: 12px;
}

.dashboard-team-window {
  margin-bottom: 12px;
}

.dashboard-team-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.dashboard-team-summary::-webkit-details-marker {
  display: none;
}

.dashboard-team-summary strong {
  display: block;
  font-size: 14px;
}

.dashboard-team-summary small {
  color: var(--muted);
  font-weight: 700;
}

.dashboard-team-window[open] .dashboard-team-summary {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.compact-team-columns {
  margin-top: 10px;
}

.dashboard-detail-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.dashboard-detail-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: 8px;
}

.dashboard-circle-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  gap: 10px;
  align-items: center;
}

.progress-circle,
.metric-circle {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  justify-self: center;
}

.progress-circle {
  background: conic-gradient(var(--accent) var(--progress), #e4e9e7 0deg);
}

.progress-circle-inner,
.metric-circle {
  background: white;
  border: 1px solid var(--line);
}

.progress-circle-inner {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
}

.metric-circle {
  border: 1px solid var(--line);
  color: var(--ink);
}

.metric-circle.danger {
  border-color: #f3b7b0;
  background: #fff8f7;
  color: var(--red);
}

.progress-circle strong,
.metric-circle strong {
  font-size: 18px;
  line-height: 1;
}

.progress-circle span,
.metric-circle span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.dashboard-hours-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr)) 96px;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  background: white;
  padding: 9px;
}

.project-time-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: white;
  padding: 8px 10px;
  font-size: 12px;
}

.project-time-summary.ok {
  border-color: #b9d8c8;
  background: #f3fbf7;
}

.project-time-summary.risk {
  border-color: #f1d18a;
  background: #fffaf0;
}

.project-time-summary.over {
  border-color: #f3b7b0;
  background: #fff6f5;
  color: var(--red);
}

.project-time-summary span {
  color: var(--muted);
}

.dashboard-hours-form input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.dashboard-hours-form .secondary-button {
  min-height: 34px;
}

.dashboard-pendency-list {
  display: grid;
  gap: 5px;
}

.dashboard-pendency-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: white;
  padding: 6px 8px;
  font-size: 12px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  padding: 14px;
}

.detail-panel {
  margin-top: 16px;
}

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

.calendar-connect {
  display: grid;
  gap: 14px;
}

.notice {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 10px;
  font-size: 13px;
  line-height: 1.4;
}

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

.rule-grid ul {
  margin: 9px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.calendar-proposal {
  border-left: 0;
}

.calendar-proposal.duplicate {
  border-color: #ebcf8b;
}

.calendar-proposal.created {
  border-color: #b7dfbf;
}

.edit-card {
  border-color: #ebcf8b;
  background: #fffdf5;
}

.calendar-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.calendar-month-panel {
  min-height: 520px;
}

.ari-calendar-grid {
  display: grid;
  grid-template-columns: 54px repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekday {
  min-height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  border-bottom: 1px solid var(--line);
}

.calendar-week-number-head,
.calendar-week-number {
  background: #f4f6f5;
  color: var(--muted);
}

.calendar-week-number {
  min-height: 82px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 850;
}

.calendar-day {
  min-height: 82px;
  border: 1px solid var(--line);
  background: white;
  padding: 6px;
  display: grid;
  align-content: start;
  gap: 5px;
}

.calendar-day.today {
  border-color: var(--accent);
  background: #f7f9f9;
}

.muted-day {
  background: #f4f6f5;
}

.calendar-day-events {
  display: grid;
  gap: 3px;
}

.calendar-dot,
.calendar-more {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #f7f8f8;
  color: #465157;
  font-size: 10px;
  font-weight: 850;
}

.calendar-installation {
  background: #fff7df;
  border-color: #ebcf8b;
}

.calendar-customer {
  background: #edf5ff;
  border-color: #b9d5ef;
}

.calendar-quote {
  background: #f4f5f5;
}

.calendar-project-range {
  background: #e8f8f2;
  border-color: #86d7b6;
}

.calendar-critical {
  background: #fff0ee;
  border-color: #f3b7b0;
}

.calendar-manual {
  background: #f4f5f5;
  border-color: #ccd3d6;
}

.ari-calendar-event {
  background: white;
}

.calendar-event-edit-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) 140px 95px minmax(140px, 1fr) 150px;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.calendar-event-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.calendar-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  margin-bottom: 8px;
}

.chat-panel {
  max-width: 980px;
}

.chat-messages {
  height: min(62vh, 620px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  background: #f7f9f8;
  border: 1px solid var(--line);
}

.chat-message {
  max-width: 78%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: white;
  line-height: 1.45;
  font-size: 14px;
}

.chat-message strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.chat-message.user {
  justify-self: end;
  background: #edf8f6;
  border-color: #b8ded8;
}

.chat-message.assistant {
  justify-self: start;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  margin-top: 10px;
}

.file-storage-card {
  background: #fbfcfb;
}

.file-storage-card .folder-grid,
.file-storage-card .file-area-grid {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 160ms ease, opacity 140ms ease;
}

.file-storage-card:hover .folder-grid,
.file-storage-card:hover .file-area-grid,
.file-storage-card:focus-within .folder-grid,
.file-storage-card:focus-within .file-area-grid {
  max-height: 420px;
  opacity: 1;
  pointer-events: auto;
}

.project-focus-card .file-storage-card .folder-grid,
.project-focus-card .file-storage-card .file-area-grid {
  max-height: none;
  opacity: 1;
  pointer-events: auto;
}

.project-focus-card .file-storage-card {
  border: 0;
  padding: 0;
  background: transparent;
}

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

.folder-grid span {
  border: 1px solid var(--line);
  background: white;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-area-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.file-area {
  border: 1px solid var(--line);
  background: white;
  padding: 8px;
  display: grid;
  gap: 3px;
}

.file-area span,
.file-area small {
  color: var(--muted);
  font-size: 12px;
}

.simple-file-storage {
  display: grid;
  gap: 14px;
}

.project-file-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 20px;
  border: 2px dashed #9ec5ff;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
  text-align: center;
  color: #0f172a;
}

.project-file-dropzone.is-dragover {
  border-color: #0b63f6;
  background: #e7f0ff;
}

.project-file-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.project-file-dropzone strong {
  font-size: 20px;
}

.project-file-dropzone span {
  color: #64748b;
  font-size: 14px;
}

.project-file-status {
  min-height: 18px;
}

.project-file-groups {
  display: grid;
  gap: 12px;
}

.project-file-group {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.project-file-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  background: #f8fbff;
  border-bottom: 1px solid #dbe4ef;
}

.project-file-group-head strong {
  color: #0f172a;
}

.project-file-group-head span {
  min-width: 28px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef5ff;
  color: #0b63f6;
  font-size: 12px;
  font-weight: 900;
}

.project-file-list {
  display: grid;
}

.project-file-item {
  display: grid;
  grid-template-columns: auto 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #eef2f7;
}

.project-file-check {
  width: 18px;
  height: 18px;
}

.project-file-item:last-child {
  border-bottom: 0;
}

.project-file-icon {
  width: 44px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0b63f6;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.project-file-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: #0f172a;
}

.project-file-item small {
  color: #64748b;
}

.project-file-delete {
  justify-self: end;
  white-space: nowrap;
  color: #b91c1c;
}

.project-file-actions,
.project-file-bulkbar,
.project-pdf-actions,
.project-pdf-markup-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

.project-file-bulkbar {
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #cfe0f5;
  border-radius: 10px;
  background: #eef6ff;
}

.project-pdf-workspace {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cfe0f5;
  border-radius: 12px;
  background: #f8fbff;
  margin: 10px 0 18px;
  min-height: min(920px, calc(100vh - 120px));
}

.project-pdf-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 10px;
  margin: -10px -10px 0;
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.96);
  backdrop-filter: blur(8px);
}

.project-pdf-toolbar small {
  display: block;
  color: #64748b;
}

.project-pdf-markup-tools button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  padding: 8px 10px;
  font-weight: 800;
}

.project-pdf-frame-wrap {
  min-height: min(820px, calc(100vh - 210px));
  overflow: auto;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #e5edf6;
}

.project-pdf-frame-wrap iframe {
  width: calc(100% * var(--pdf-zoom, 1));
  min-width: 100%;
  height: min(980px, calc(100vh - 190px));
  border: 0;
  transform-origin: top left;
}

.project-mail-panel {
  display: grid;
  gap: 14px;
}

.project-mail-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #f8fbff;
}

.project-mail-form[hidden] {
  display: none;
}

.project-mail-form label {
  display: grid;
  gap: 5px;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.project-mail-list {
  display: grid;
  gap: 10px;
}

.project-mail-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #ffffff;
}

.project-mail-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.project-mail-card-head > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.project-mail-card span,
.project-mail-card p {
  color: #334155;
}

.project-mail-card p {
  margin: 0;
  white-space: pre-wrap;
}

.project-mail-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.project-mail-attachments span {
  padding: 5px 8px;
  border: 1px solid #cfd9e6;
  border-radius: 999px;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 800;
}

.project-activity-timeline {
  display: grid;
  gap: 8px;
}

.project-activity-timeline span {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f7;
}

.project-activity-timeline span:last-child {
  border-bottom: 0;
}

.project-activity-timeline strong {
  color: #0b63f6;
}

.project-activity-timeline small {
  color: #334155;
}

.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: 12px;
  align-items: start;
}

.quote-result {
  display: grid;
  gap: 12px;
}

.quote-side-panel {
  position: sticky;
  top: 14px;
}

.quote-library {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.quote-library-head h3 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 18px;
}

.quote-library-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.55fr);
  gap: 8px;
}

.quote-library-list {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.quote-library-group {
  display: grid;
  gap: 6px;
}

.quote-library-group + .quote-library-group {
  margin-top: 5px;
}

.quote-library-group-title {
  border: 1px solid #d8e5df;
  background: #eef7f4;
  color: #123a38;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 7px 9px;
  text-transform: uppercase;
}

.quote-library-group--addon .quote-library-group-title {
  border-color: #bad7ff;
  background: #eaf3ff;
  color: #173b73;
}

.quote-library-group--surface .quote-library-group-title {
  border-color: #bfe8d8;
  background: #ecfdf5;
  color: #14543a;
}

.quote-library-group--material .quote-library-group-title {
  border-color: #d5dbe4;
  background: #f4f7fb;
  color: #334155;
}

.quote-library-item {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 1px solid #cfe0da;
  background: #f8fbfa;
  color: #172b2d;
  padding: 9px 10px;
  border-left-width: 5px;
}

.quote-library-item:hover,
.quote-library-item:focus-visible {
  border-color: #2dd4bf;
  background: #eafaf7;
}

.quote-library-item span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.quote-library-item strong,
.quote-library-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-library-item small {
  color: #52635f;
  font-size: 12px;
}

.quote-library-item em {
  color: #0f3f3c;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.quote-library-item--planning {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.quote-library-item--fixing {
  border-left-color: #d97706;
  background: #fffbeb;
}

.quote-library-item--transport {
  border-left-color: #7c3aed;
  background: #f5f3ff;
}

.quote-library-item--surface {
  border-left-color: #059669;
  background: #ecfdf5;
}

.quote-library-item--montage {
  border-left-color: #0f766e;
  background: #f0fdfa;
}

.quote-library-item--material {
  border-left-color: #475569;
  background: #f8fafc;
}

.quote-lines {
  display: grid;
  gap: 6px;
}

.quote-positions {
  display: grid;
  gap: 7px;
}

.quote-position-head,
.quote-position-row {
  display: grid;
  grid-template-columns: 54px minmax(110px, 0.8fr) minmax(220px, 1.6fr) 86px 90px 118px 86px 118px;
  gap: 8px;
  align-items: center;
}

.quote-position-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.quote-position-row {
  border: 1px solid var(--line);
  background: white;
  padding: 7px;
  position: relative;
}

.quote-field {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.quote-field > span {
  color: #52635f;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-position-head + .quote-positions .quote-field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.quote-position-row input,
.quote-position-row select,
.quote-position-row textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.quote-position-row textarea {
  resize: vertical;
}

.quote-description-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  align-items: stretch;
}

.quote-description-picker select {
  align-self: stretch;
  background: #eefaf7;
  border-color: #6fcfbe;
  border-left: 5px solid #0f766e;
  color: #0f3f3c;
  font-weight: 850;
}

.quote-delete-button {
  grid-column: 1 / -1;
  justify-self: end;
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.quote-measure-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 8px;
  border-top: 1px solid #e1e8e4;
  padding-top: 8px;
}

.quote-field-formula {
  min-width: 180px;
}

.quote-unit {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #f4f6f5;
  color: var(--muted);
  font-weight: 850;
  font-size: 12px;
}

.quote-line-total {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border: 1px solid var(--line);
  background: #f4f6f5;
  color: var(--ink);
  font-weight: 900;
  padding: 0 8px;
}

.quote-mini-preview {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  background: #f7fbfa;
  padding: 12px;
}

.quote-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 120px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 8px;
  font-size: 13px;
}

.quote-line span:first-child {
  overflow-wrap: anywhere;
}

.quote-line small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

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

.quote-card {
  border-color: #b7dfbf;
}

.quote-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quote-full-view {
  margin-top: 14px;
}

.quote-customer-view {
  display: grid;
  gap: 12px;
}

.quote-preview-toolbar {
  border: 1px solid var(--line);
  background: #f8fbfa;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.quote-preview-toolbar > div:first-child {
  display: grid;
  gap: 2px;
}

.quote-preview-toolbar strong {
  color: #172b2d;
}

.quote-preview-toolbar span {
  color: #52635f;
  font-size: 12px;
}

.quote-internal-note-field textarea {
  background: #fffdf2;
  border-color: #eadfbc;
}

.quote-review-form {
  display: grid;
  gap: 16px;
}

.quote-review-form input,
.quote-review-form textarea {
  width: 100%;
  background: #fffdf8;
  border: 1px solid #d9e2de;
  padding: 7px 8px;
  color: #172b2d;
}

.quote-review-form label {
  display: grid;
  gap: 5px;
  color: #52635f;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-review-form label small {
  color: #6b7b76;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.quote-review-meta {
  min-width: 220px;
  text-align: left;
}

.quote-review-lines {
  display: grid;
  gap: 9px;
}

.quote-review-line {
  border: 1px solid #d9e2de;
  background: #ffffff;
  display: grid;
  grid-template-columns: 58px 88px 78px minmax(220px, 1fr) 112px 116px;
  gap: 8px;
  padding: 9px;
  align-items: start;
}

.quote-review-description textarea {
  min-height: 82px;
}

.quote-review-total {
  display: grid;
  gap: 5px;
}

.quote-review-total span {
  color: #52635f;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-review-total strong {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: #f4f6f5;
  border: 1px solid #d9e2de;
  padding: 0 8px;
}

.quote-review-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 10px;
  justify-content: end;
}

.quote-document {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 14px 34px rgba(21, 31, 35, 0.08);
  max-width: 980px;
  margin-inline: auto;
}

.quote-document-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.quote-document-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  border-bottom: 0;
  padding-bottom: 10px;
}

.quote-logo-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.quote-logo-block--selected {
  display: grid;
  gap: 8px;
  align-items: start;
}

.quote-logo-placeholder {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid #d7e2df;
  background: #f4f7f6;
  color: #52635f;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-logo-image {
  width: min(156px, 30vw);
  height: auto;
  object-fit: contain;
  background: white;
  border: 1px solid #d7e2df;
  padding: 10px;
}

.quote-logo-address {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.quote-document-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
  color: var(--ink);
}

.quote-document-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.quote-document-meta {
  display: grid;
  gap: 4px;
  text-align: right;
  color: var(--muted);
}

.quote-document-meta strong {
  color: var(--ink);
  font-size: 20px;
}

.quote-address-line {
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.quote-hero-visual {
  min-height: 180px;
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
  margin: 18px 0;
  border: 1px solid #d5e2de;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.08), rgba(37, 99, 235, 0.08)),
    #f7fbfa;
  color: #52635f;
  padding: 18px;
}

.quote-hero-visual strong {
  color: #172b2d;
  font-size: 22px;
}

.quote-visual-sketch {
  width: 100%;
  max-width: 300px;
  justify-self: center;
}

.quote-visual-sketch svg {
  width: 100%;
  height: auto;
  display: block;
}

.quote-visual-copy {
  display: grid;
  gap: 6px;
}

.quote-visual-copy span {
  line-height: 1.45;
}

.quote-document-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.quote-document-intro {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  line-height: 1.5;
}

.quote-document-intro h3 {
  font-size: 20px;
}

.quote-document-info div {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 10px;
}

.quote-document-info p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.quote-document-info span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

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

.quote-document-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.quote-document-table th:nth-child(1),
.quote-document-table td:nth-child(1) {
  width: 60px;
}

.quote-document-table th:nth-child(3),
.quote-document-table td:nth-child(3) {
  width: 130px;
}

.quote-document-table th,
.quote-document-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.quote-document-table th {
  background: #172b2d;
  color: white;
  font-size: 12px;
}

.quote-document-table td:last-child,
.quote-document-table th:last-child {
  text-align: right;
  font-weight: 850;
}

.quote-pos-cell {
  width: 70px;
}

.quote-pos-cell span,
.quote-description-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.quote-description-cell p {
  margin-top: 8px;
  color: #3d4742;
  line-height: 1.45;
  max-width: 620px;
}

.quote-description-cell > strong {
  display: block;
  color: #172b2d;
  font-size: 15px;
  margin-bottom: 6px;
}

.quote-line-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.quote-line-title-row > strong {
  color: #172b2d;
  font-size: 15px;
}

.quote-line-edit-key {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cbd8d3;
  background: #f8fbfa;
  color: #172b2d;
  font-size: 9px;
  line-height: 1;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.quote-document-table tr:hover .quote-line-edit-key,
.quote-line-edit-key:focus-visible {
  opacity: 1;
}

.quote-description-cell small {
  display: block;
  margin-top: 5px;
  color: #62736f;
  font-size: 11px;
  line-height: 1.35;
}

.quote-pdf-attribute-editor {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed #cbd8d3;
  background: #f8fbfa;
}

.quote-pdf-attribute-editor label {
  display: grid;
  gap: 5px;
  color: #52635f;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-pdf-attribute-editor textarea {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  font-size: 13px;
  text-transform: none;
}

.quote-pdf-line-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(7, 18, 24, 0.48);
  padding: 18px;
}

.quote-pdf-line-editor {
  width: min(560px, 100%);
  display: grid;
  gap: 12px;
  border: 1px solid #d7e2df;
  background: #ffffff;
  color: #172b2d;
  padding: 16px;
  box-shadow: 0 18px 42px rgba(7, 18, 24, 0.22);
}

.quote-pdf-line-editor label {
  display: grid;
  gap: 5px;
  color: #52635f;
  font-size: 12px;
  font-weight: 900;
}

.quote-pdf-line-editor input,
.quote-pdf-line-editor textarea {
  width: 100%;
  color: #172b2d;
}

.quote-line-description-edit {
  width: 100%;
  min-height: 78px;
  margin-top: 9px;
  background: #fffdf8;
  resize: vertical;
}

.quote-line-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.danger-text-button {
  color: var(--red);
  background: var(--red-bg);
}

.quote-document-total {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--ink);
}

.quote-total-box {
  display: grid;
  grid-template-columns: minmax(160px, 1fr);
  justify-items: end;
  margin-left: auto;
  max-width: 360px;
}

.quote-document-terms {
  margin-top: 20px;
  border: 1px solid #d4dfdb;
  background: #f8fbfa;
  padding: 14px;
}

.quote-document-terms--compact {
  color: #172b2d;
  line-height: 1.45;
}

.quote-terms-head {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid #d4dfdb;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.quote-terms-head span,
.quote-document-terms article > span {
  color: #52635f;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-terms-head strong {
  color: #172b2d;
  font-size: 18px;
}

.quote-terms-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.4fr 1.25fr;
  gap: 12px;
}

.quote-document-terms article {
  background: white;
  border: 1px solid #e1e8e4;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.quote-document-terms article strong {
  color: #172b2d;
  font-size: 22px;
}

.quote-document-terms p,
.quote-document-terms ol {
  margin: 0;
  color: #34423e;
  line-height: 1.45;
}

.quote-document-terms ol {
  padding-left: 18px;
}

.quote-document-terms li + li {
  margin-top: 4px;
}

.quote-document-notes {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  line-height: 1.5;
}

.quote-document-notes p {
  margin: 0;
}

.quote-signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}

.quote-signature-grid div {
  min-height: 72px;
  border-top: 1px solid #172b2d;
  padding-top: 8px;
  color: #52635f;
  font-size: 12px;
  font-weight: 800;
}

@media print {
  body {
    background: white !important;
  }

  .app-nav,
  .top-actions,
  .quote-document-toolbar,
  .quote-preview-toolbar,
  .quote-pdf-attribute-editor,
  .quote-line-edit-key,
  .quote-pdf-line-editor-backdrop,
  .quote-layout,
  #quote > .panel > .panel-head,
  #quote > .panel > #quoteList,
  .nav-bottom,
  .settings-edge,
  .settings-panel {
    display: none !important;
  }

  .app-shell,
  .main-area,
  main,
  #quote,
  .quote-full-view {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
  }

  .quote-document {
    border: 0;
    box-shadow: none;
    max-width: none;
    padding: 0;
  }
}

.montage-layout {
  display: grid;
  gap: 14px;
}

.import-info {
  display: grid;
  gap: 10px;
}

.import-info-grid,
.montage-total-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.montage-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 150px 140px;
  gap: 8px;
  margin-bottom: 10px;
}

.montage-price-library {
  display: grid;
  gap: 6px;
}

.montage-price-table {
  display: grid;
  grid-template-columns: 130px minmax(240px, 1.4fr) 70px 110px 110px 90px 86px;
  gap: 8px;
  align-items: center;
}

.montage-price-table-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  padding: 0 7px 5px;
  border-bottom: 1px solid var(--line);
}

.montage-price-row {
  border: 1px solid var(--line);
  background: white;
  padding: 7px;
}

.montage-price-row.inactive {
  opacity: 0.55;
  background: #f7f2ea;
}

.montage-price-row input {
  min-height: 32px;
  padding: 5px 7px;
  font-size: 12px;
}

.montage-price-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.toggle-label {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.toggle-label input {
  width: auto;
  min-height: auto;
}

.montage-calc-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.csv-import-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 170px;
  gap: 8px;
  margin-bottom: 8px;
}

.montage-calc-form label {
  gap: 4px;
  font-size: 12px;
}

.montage-calculation-result,
.montage-calc-lines {
  display: grid;
  gap: 8px;
}

.montage-calc-line {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 100px 100px 110px 110px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 8px;
  font-size: 13px;
}

.csv-calculation-rows {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.csv-row {
  display: grid;
  grid-template-columns: 60px minmax(240px, 1fr) 110px minmax(260px, 1.1fr) 82px 110px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: white;
  padding: 7px;
  font-size: 13px;
}

.csv-row-head {
  background: #172b2d;
  color: white;
  font-size: 12px;
  font-weight: 850;
}

.csv-row.review {
  border-left: 4px solid #d6b15f;
}

.csv-row.matched {
  border-left: 4px solid #8fb99a;
}

.csv-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.csv-row select {
  min-height: 32px;
  padding: 5px 7px;
  font-size: 12px;
}

.montage-calc-line small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.learning-schema {
  display: grid;
  gap: 10px;
}

.learning-schema-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.learning-schema-grid span {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
}

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

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

.span-2 {
  grid-column: span 2;
}

.stack {
  display: grid;
  gap: 7px;
}

.item-card {
  padding: 10px;
  display: grid;
  gap: 8px;
  background: var(--surface-soft);
}

.compact-panel {
  padding: 12px;
}

.project-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.project-form-panel {
  margin-bottom: 12px;
}

#projects.view.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

#projects .project-toolbar,
#projects .project-form-panel,
#projects .project-timeline-shell,
#projects .project-detail-shell,
#projects .project-list-shell,
#projects > .project-list-shell + .panel {
  grid-column: 1 / -1;
}

#projects .project-list-shell {
  margin: 0;
}

#projects .project-detail-shell {
  margin: 0;
  position: static;
}

#projects .project-workspace {
  display: none;
}

.project-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}

.project-detail-shell {
  margin-top: 12px;
}

.project-lead-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8fbfb;
  border-radius: 6px;
  margin-bottom: 10px;
}

.project-lead-hero h3 {
  margin: 2px 0 4px;
  font-size: 22px;
}

.project-lead-hero p,
.project-next-action-card small {
  margin: 0;
  color: var(--muted);
}

.project-lead-number {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
}

.project-lead-status {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-lead-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.project-lead-metric,
.project-next-action-card,
.project-focus-card {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 11px;
}

.project-lead-metric {
  display: grid;
  gap: 2px;
  min-height: 74px;
}

.project-lead-metric span,
.project-next-action-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-lead-metric strong {
  font-size: 20px;
}

.project-lead-metric small,
.project-task-line small,
.project-check-list small {
  color: var(--muted);
}

.project-next-action-card {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--accent);
  margin-bottom: 10px;
}

.project-next-action-card strong {
  font-size: 18px;
}

.project-tab-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.project-tab-button {
  border: 1px solid var(--line);
  background: #f9fbfb;
  color: var(--ink);
  border-radius: 5px;
  padding: 7px 10px;
  font-weight: 850;
  cursor: pointer;
}

.project-tab-button.active {
  border-color: var(--accent);
  background: #e8f5f7;
  color: #123d48;
}

.project-tab-panel {
  display: grid;
  gap: 10px;
}

.project-tab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 10px;
}

.project-focus-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.project-simple-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.project-plain-list,
.project-check-list {
  display: grid;
  gap: 7px;
}

.project-plain-list span,
.project-check-list span,
.project-task-line {
  border: 1px solid var(--line);
  background: #f8fbfb;
  border-radius: 5px;
  padding: 8px;
}

.project-plain-list span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.project-plain-list span small {
  color: var(--muted);
  white-space: nowrap;
}

.project-check-list span.done {
  border-color: #b9d8c8;
  background: #f3fbf7;
}

.project-task-group {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  overflow: hidden;
}

.project-task-group summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
  background: #f7faf9;
}

.project-task-group .stack {
  padding: 8px;
}

.project-task-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 100px;
  gap: 8px;
  align-items: center;
}

.task-mobile-delete {
  justify-self: end;
}

.time-tracking-card {
  border-color: #c8ded8;
}

.time-form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.time-form-grid label,
.time-form-grid input {
  width: 100%;
}

.time-week-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.time-week-grid span {
  border: 1px solid var(--line);
  background: #f6fbfa;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.time-week-grid small {
  color: var(--muted);
}

.time-entry-list {
  display: grid;
  gap: 8px;
}

.time-entry-row {
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  padding: 10px;
}

.time-entry-row div {
  display: grid;
  gap: 3px;
}

.time-entry-row span,
.time-entry-row small {
  color: var(--muted);
}

.project-soft-details {
  margin-top: 10px;
}

.project-soft-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 850;
}

.project-register-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.project-register-strip span,
.project-register-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  background: #f4f8f7;
  color: #476066;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 900;
}

.project-register-label {
  margin-bottom: 8px;
  background: #eaf6f4;
  border-color: #c9dfdc;
}

.mini-explorer,
.file-browser {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 230px;
}

.mini-explorer {
  width: 100%;
  max-width: 300px;
  padding: 8px;
  overflow: auto;
}

.mini-explorer-head,
.file-browser-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.explorer-tree {
  display: grid;
  gap: 2px;
  font-size: 13px;
}

.tree-node {
  width: 100%;
  min-height: 28px;
  display: grid;
  grid-template-columns: 16px 20px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  text-align: left;
  background: transparent;
  color: var(--ink);
  padding: 3px 5px;
  border-radius: 4px;
}

.tree-node:hover,
.tree-node.selected {
  background: #edf8f6;
  color: var(--accent-dark);
}

.tree-icon,
.tree-spacer {
  color: var(--muted);
  font-size: 12px;
}

.folder-icon {
  position: relative;
  width: 16px;
  height: 12px;
  font-size: 0;
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 4px;
  width: 14px;
  height: 9px;
  border: 1px solid #caa24f;
  background: #f5cf70;
}

.folder-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 1px;
  width: 7px;
  height: 5px;
  border: 1px solid #caa24f;
  border-bottom: 0;
  background: #f7dc95;
}

.tree-children {
  display: grid;
  gap: 1px;
  padding-left: 12px;
}

.folder-children {
  margin-bottom: 4px;
}

.tree-folder-name {
  color: var(--muted);
  font-size: 11px;
  padding: 2px 5px 3px 41px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-node {
  grid-template-columns: 16px 20px minmax(0, 1fr);
}

.file-browser {
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.file-browser-list {
  display: grid;
  gap: 7px;
}

.file-browser-folders {
  display: grid;
  grid-template-columns: repeat(4, minmax(95px, 1fr));
  gap: 8px;
}

.file-folder-tile {
  min-height: 58px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  padding: 7px;
  font-size: 12px;
}

.file-folder-tile:hover {
  border-color: var(--accent);
  background: #edf8f6;
}

.file-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 8px;
  font-size: 13px;
}

.file-icon {
  width: 24px;
  height: 28px;
  border: 1px solid var(--line);
  background: white;
  display: grid;
  place-items: center;
  color: transparent;
}

.archive-note {
  margin-bottom: 12px;
}

.archive-grid {
  display: grid;
  gap: 12px;
}

.archive-year {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.archive-year-head,
.archive-status-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

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

.archive-status {
  border: 1px solid var(--line);
  background: white;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 8px;
  font-size: 13px;
}

.archive-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.archive-row strong {
  overflow-wrap: anywhere;
}

.project-table {
  display: grid;
  grid-template-columns: 82px minmax(105px, 0.8fr) minmax(130px, 1.1fr) 120px 82px 82px 58px 54px 78px 62px minmax(185px, 0.8fr);
  gap: 5px;
  align-items: center;
}

.project-table-head {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.project-row {
  min-height: 34px;
  padding: 5px 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
}

.project-manage-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-manage-actions .text-button {
  min-height: 24px;
  padding: 0 5px;
  font-size: 11px;
}

.project-row.selected {
  border-color: var(--accent);
  background: #f4f6f5;
}

.project-row span,
.project-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-type-badge {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #f7f8f8;
  color: #465157;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.order-production {
  background: #f5f8fb;
  border-color: #cbd6e2;
}

.order-planning {
  background: #f8f7fb;
  border-color: #d8d2e5;
}

.order-installation {
  background: #f7f8f3;
  border-color: #d8dcc5;
}

.order-consulting {
  background: #fbf8f2;
  border-color: #e2d6be;
}

.order-complete {
  background: #f3f7f6;
  border-color: #c7d8d4;
}

.order-undefined {
  background: #f4f5f5;
  color: #6b7478;
}

.mini-metric {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: white;
  color: #465157;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 800;
}

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

.item-card.selected {
  border-color: var(--accent);
  background: #f4f6f5;
}

.item-top,
.inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.item-title strong {
  overflow-wrap: anywhere;
}

.meta {
  font-size: 13px;
  line-height: 1.35;
}

.pill,
.traffic-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.traffic-light {
  width: 70px;
}

.red {
  color: var(--red);
  background: var(--red-bg);
  border-color: #f3b7b0;
}

.amber {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: #ebcf8b;
}

.green {
  color: var(--green);
  background: var(--green-bg);
  border-color: #b7dfbf;
}

.neutral {
  color: #536166;
  background: #f2f5f4;
}

.blue {
  color: var(--blue);
  background: var(--blue-bg);
  border-color: #b9d5ef;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.status-box {
  border: 1px solid var(--line);
  background: white;
  padding: 10px;
}

.status-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  gap: 14px;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 1.2fr 120px 110px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: white;
  padding: 9px 10px;
}

.pendency-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: white;
  padding: 9px 10px;
}

.task-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.manual-task-form,
.task-edit-form {
  display: grid;
  gap: 8px;
  align-items: center;
}

.manual-task-form {
  grid-template-columns: minmax(160px, 0.9fr) minmax(190px, 1fr) minmax(190px, 1fr) 150px 120px 120px 105px 105px;
  margin-bottom: 10px;
}

.ari-reminder-panel {
  display: grid;
  gap: 10px;
}

.ari-reminder-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.4fr) 130px 105px 115px 120px 100px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.ari-reminder-form input,
.ari-reminder-form select {
  min-width: 0;
}

.ari-reminder-list {
  display: grid;
  gap: 8px;
}

.ari-reminder-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  background: #fff;
  border-radius: 6px;
  padding: 9px 10px;
}

.ari-reminder-card.red {
  border-left-color: #ef4444;
  background: #fff7f7;
}

.ari-reminder-card.amber {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.ari-reminder-card.blue {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.ari-reminder-main {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.ari-reminder-main strong,
.ari-reminder-main small {
  display: block;
  min-width: 0;
}

.ari-reminder-main small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.ari-reminder-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.small-action-button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

@media (max-width: 760px) {
  .ari-reminder-form {
    grid-template-columns: 1fr;
  }

  .ari-reminder-card {
    grid-template-columns: 1fr;
  }

  .ari-reminder-actions {
    justify-content: flex-start;
  }
}

.task-project-group {
  border: 1px solid var(--line);
  background: #fbfcfb;
  border-radius: 4px;
  padding: 7px;
  display: grid;
  gap: 5px;
  border-left: 4px solid #cfd7d4;
}

.task-group-overdue {
  border-left-color: #d36b62;
}

.task-group-open {
  border-left-color: #d6b15f;
}

.task-group-done {
  border-left-color: #8fb99a;
}

.task-project-group.collapsed {
  background: #f7f9f8;
}

.task-project-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 6px;
  border-bottom: 1px solid var(--line);
}

.task-project-head h3 {
  font-size: 14px;
}

.compact-toggle {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.task-edit-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-row-head {
  display: grid;
  grid-template-columns: 10px minmax(180px, 1.4fr) 150px 110px 105px 115px 70px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  padding: 0 6px;
}

.task-edit-card {
  min-height: 34px;
  border: 1px solid var(--line);
  background: white;
  padding: 0;
  border-radius: 3px;
  overflow: hidden;
}

.task-summary-row {
  display: grid;
  grid-template-columns: 10px minmax(170px, 1.4fr) 130px 105px minmax(130px, 1fr) 100px 110px 70px;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  cursor: pointer;
  list-style: none;
}

.task-summary-row::-webkit-details-marker {
  display: none;
}

.task-summary-row strong,
.task-summary-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.task-summary-meta {
  color: var(--muted);
}

.linked-calendar-note {
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.12);
  color: #bfdbfe;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
}

.task-edit-card[open] .task-summary-row {
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
}

.task-detail-form {
  padding: 8px;
}

.task-detail-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.task-detail-form .span-2 {
  grid-column: 1 / -1;
}

.task-state-dot {
  width: 8px;
  height: 24px;
  border-radius: 999px;
  justify-self: center;
  border: 0;
}

.task-phase {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #f4f6f5;
  color: #526066;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-edit-form input,
.task-edit-form select,
.manual-task-form input,
.manual-task-form select {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 12px;
}

.task-edit-form .secondary-button,
.task-edit-form .danger-text-button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.chef-dashboard-panel {
  margin-top: 0;
  margin-bottom: 14px;
}

#morning > .metric-grid {
  display: none;
}

.team-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.team-metric {
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 8px 10px;
  border-radius: 4px;
}

.team-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.team-metric strong {
  font-size: 22px;
  line-height: 1.1;
}

.team-metric.red {
  border-left: 4px solid #d36b62;
}

.team-metric.amber {
  border-left: 4px solid #d6b15f;
}

.team-metric.green {
  border-left: 4px solid #80b58d;
}

.team-metric.blue {
  border-left: 4px solid #6da7c8;
}

.team-dashboard-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.team-dashboard-columns h3 {
  font-size: 13px;
  margin-bottom: 6px;
}

.team-message-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 8px 10px;
}

.team-message-card p {
  margin: 6px 0 8px;
  line-height: 1.35;
}

.team-load-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 80px 70px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 7px 9px;
  font-size: 12px;
}

.calendar-workblock {
  border-left-color: #6da7c8;
}

.workblock-detail {
  align-items: flex-start;
}

.workblock-task-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.workblock-task {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: #f8fbfa;
  border-radius: 3px;
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1.2;
}

.workblock-task.done {
  color: var(--muted);
  background: #eef5ef;
  text-decoration: line-through;
}

.ai-settings-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(90px, 0.6fr) minmax(180px, 1fr);
  gap: 8px;
  align-items: end;
  margin: 8px 0;
}

.ai-settings-grid label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.ai-settings-grid .ai-toggle {
  min-height: 32px;
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 4px 8px;
  color: var(--ink);
}

.ai-settings-grid select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 4px 8px;
  color: var(--ink);
}

.ai-connection-status {
  min-height: 32px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid #d6b15f;
  background: #fffaf0;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
  color: #6c5620;
}

.ai-connection-status.ready {
  border-left-color: #80b58d;
  background: #f2fbf4;
  color: #245f36;
}

.ai-connection-status.error {
  border-left-color: #d36b62;
  background: #fff4f3;
  color: #8c2b25;
}

.project-workblock-detail {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 8px;
}

.calendar-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(24, 32, 35, 0.28);
  padding: 18px;
}

.calendar-popup {
  width: min(620px, 100%);
  max-height: 86vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 18px 44px rgba(18, 32, 38, 0.22);
}

.calendar-popup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.calendar-popup-grid div,
.calendar-popup-section {
  border: 1px solid var(--line);
  background: #fbfcfb;
  border-radius: 4px;
  padding: 8px;
}

.calendar-popup-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calendar-popup-section {
  margin-top: 8px;
}

.capacity-suggestion-card {
  border: 1px solid #e2c26f;
  border-left: 4px solid #d6b15f;
  background: #fffaf0;
  border-radius: 4px;
  padding: 9px 10px;
}

.capacity-suggestion-card p {
  margin: 6px 0;
  line-height: 1.35;
}

.tab-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.tab-button.active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #edf8f6;
}

.empty {
  border: 1px dashed var(--line);
  background: #fbfcfb;
  color: var(--muted);
  padding: 14px;
}

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

.text-button {
  min-height: 30px;
  padding: 0 10px;
  background: #eef2f1;
  color: #344044;
  font-weight: 800;
}

@media (max-width: 1050px) {
  body {
    grid-template-columns: 1fr;
  }

  .app-nav {
    min-height: auto;
    position: static;
  }

  nav,
  .metric-grid,
  .dashboard-calendar-layout,
  .dashboard-grid,
  .dashboard-project-table,
  .dashboard-project-row,
  .dashboard-detail-grid,
  .dashboard-circle-grid,
  .dashboard-hours-form,
  .dashboard-week-days,
  .project-time-summary,
  .split-layout,
  .detail-grid,
  .calendar-layout,
  .calendar-event-edit-form,
  .voice-grid,
  .project-workspace,
  .archive-status-grid,
  .register-note-form,
  .quote-document-head,
  .quote-document-info,
  .import-info-grid,
  .team-metric-grid,
  .team-dashboard-columns,
  .montage-total-grid,
  .montage-filter-grid,
  .montage-calc-form,
  .montage-calc-line,
  .csv-import-grid,
  .csv-row {
    grid-template-columns: 1fr;
  }

  .montage-price-table {
    grid-template-columns: 110px minmax(220px, 1fr) 60px 90px 90px 80px 74px;
    overflow-x: auto;
  }

  .quote-document-meta {
    text-align: left;
  }

  .mini-explorer {
    max-width: none;
  }

  .project-table {
    grid-template-columns: 78px minmax(100px, 1fr) minmax(120px, 1.1fr) 110px 76px 78px 54px 50px 70px 58px 66px;
  }

  .topbar,
  .title-row,
  .top-actions,
  .voice-head,
  .voice-actions,
  .quick-filter-group,
  .task-project-head {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 650px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  main {
    padding: 10px;
  }

  .app-nav {
    gap: 8px;
    padding: 10px;
  }

  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-button {
    justify-content: center;
    min-height: 40px;
    padding: 0 5px;
    text-align: center;
    font-size: 12px;
  }

  .source-box {
    display: none;
  }

  .topbar {
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
  }

  .title-row {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .title-row h1 {
    font-size: 24px;
  }

  .back-button {
    min-height: 36px;
  }

  .topbar,
  .top-actions,
  .voice-head,
  .voice-actions,
  .ari-quick-prompts {
    gap: 8px;
  }

  .top-actions input,
  .ari-talk-form {
    width: 100%;
  }

  .top-actions {
    display: none;
  }

  .mobile-dashboard-summary {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
  }

  .mobile-dashboard-head {
    align-items: center;
    border: 1px solid #b9dcd3;
    background: #f4fffb;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 9px;
  }

  .mobile-dashboard-head div {
    display: grid;
    gap: 2px;
  }

  .mobile-dashboard-head span {
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-quick-actions,
  .mobile-metric-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-quick-actions button,
  .mobile-calendar-summary button {
    border: 1px solid #b9dcd3;
    background: #f7fffc;
    color: #124b43;
    font-weight: 850;
    min-height: 40px;
    padding: 7px 8px;
  }

  .mobile-metric-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mobile-metric-grid article {
    border: 1px solid var(--line);
    background: var(--paper);
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 7px 5px;
    text-align: center;
  }

  .mobile-metric-grid span {
    color: var(--muted);
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-metric-grid strong {
    font-size: 14px;
  }

  .ari-talk-form,
  .voice-actions,
  .ai-settings-grid {
    grid-template-columns: 1fr;
  }

  .voice-actions button,
  .ari-quick-prompts button,
  .primary-button,
  .secondary-button,
  .ghost-button {
    min-height: 40px;
  }

  .voice-panel {
    margin-bottom: 10px;
    padding: 8px;
  }

  .voice-panel:not(.mobile-open) {
    display: block;
  }

  .voice-panel.mobile-open .ai-settings-grid,
  .voice-panel.mobile-open .voice-capability-status,
  .voice-panel.mobile-open .voice-grid {
    display: grid;
  }

  .deployment-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .deployment-mic-button {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
  }

  .mobile-voice-compact {
    align-items: center;
    border: 1px solid #b9dcd3;
    background: #f7fffc;
    color: #0f3f3a;
    display: grid;
    gap: 3px;
    grid-template-columns: 1fr auto;
    min-height: 46px;
    padding: 8px;
    text-align: left;
    width: 100%;
  }

  .mobile-voice-compact span {
    color: var(--muted);
    font-size: 11px;
    grid-column: 1;
  }

  .mobile-voice-compact em {
    font-style: normal;
    font-weight: 850;
    grid-row: 1 / span 2;
    grid-column: 2;
  }

  .voice-panel:not(.mobile-open) .voice-head,
  .voice-panel:not(.mobile-open) .ari-conversation,
  .voice-panel:not(.mobile-open) .ari-quick-prompts,
  .voice-panel:not(.mobile-open) .ari-talk-form,
  .voice-panel:not(.mobile-open) .ari-mini-dialog,
  .voice-panel:not(.mobile-open) .ai-settings-grid,
  .voice-panel:not(.mobile-open) .voice-capability-status,
  .voice-panel:not(.mobile-open) .voice-grid,
  .voice-panel:not(.mobile-open) .voice-actions {
    display: none;
  }

  .voice-panel.mobile-open {
    max-height: 62vh;
    overflow: auto;
  }

  .voice-panel.mobile-open .mobile-voice-compact {
    display: none;
  }

  .ari-conversation {
    max-height: 120px;
    padding: 6px;
  }

  .ari-message {
    max-width: 96%;
    font-size: 12px;
    padding: 6px 7px;
  }

  .ari-quick-prompts {
    max-height: 82px;
    overflow: auto;
  }

  .voice-grid textarea,
  .voice-command-preview {
    min-height: 44px;
  }

  .voice-actions {
    gap: 6px;
  }

  .dashboard-week-panel {
    padding: 10px;
  }

  .dashboard-week-panel .panel-head {
    align-items: flex-start;
    gap: 6px;
  }

  .dashboard-week-panel .quick-filter-group {
    display: none;
  }

  .simple-calendar-form {
    grid-template-columns: 1fr 1fr;
  }

  .simple-calendar-form input[name="title"],
  .simple-calendar-form select[name="projectId"],
  .simple-calendar-form button {
    grid-column: 1 / -1;
  }

  .mobile-calendar-summary {
    display: grid;
    gap: 8px;
  }

  .mobile-calendar-cards {
    display: grid;
    gap: 6px;
  }

  .mobile-calendar-cards article {
    border: 1px solid var(--line);
    background: #f8fbfb;
    display: grid;
    gap: 3px;
    padding: 8px;
  }

  .mobile-calendar-cards span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-calendar-cards strong {
    font-size: 13px;
    line-height: 1.25;
  }

  .dashboard-week-panel:not(.mobile-calendar-open) .dashboard-week-plan {
    display: none;
  }

  .dashboard-week-plan {
    margin-top: 8px;
  }

  .week-day-items {
    min-height: 46px;
  }

  .time-entry-actions {
    align-items: stretch;
    justify-content: stretch;
  }

  .time-entry-actions > button,
  .time-entry-actions summary {
    justify-content: center;
    width: 100%;
  }

  .time-entry-edit-form {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    box-shadow: none;
    margin-top: 8px;
  }

  .calendar-popup-backdrop {
    align-items: stretch;
    padding: 8px;
  }

  .calendar-popup {
    width: 100%;
    max-height: 92vh;
    padding: 10px;
  }

  .calendar-popup-grid,
  .calendar-popup-edit {
    grid-template-columns: 1fr;
  }

  .mobile-critical-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 8px;
    padding: 9px 0 0;
    background: linear-gradient(180deg, rgba(248, 251, 251, 0.9), #f8fbfb);
  }

  .mobile-critical-actions .save-action-button {
    grid-column: 1 / -1;
  }

  .mobile-critical-actions .save-action-button,
  .mobile-critical-actions .cancel-action-button,
  .mobile-critical-actions .danger-action-button {
    min-height: 42px;
    padding: 9px 12px;
    font-size: 14px;
  }

  .mobile-critical-actions .danger-action-button {
    background: #b91c1c;
    border-color: #b91c1c;
  }

  .task-summary-row {
    grid-template-columns: auto 1fr auto;
    gap: 7px;
  }

  .task-summary-row > span:not(.task-state-dot):not(.pill):not(.text-button),
  .task-summary-row .pill {
    font-size: 11px;
  }

  .task-mobile-delete {
    grid-column: 1 / -1;
    justify-self: stretch;
    min-height: 38px;
  }

  .form-grid,
  .manual-task-form,
  .task-edit-form,
  .time-form-grid,
  .time-week-grid,
  .time-entry-row,
  .task-row-head,
  .dashboard-detail-grid,
  .dashboard-circle-grid,
  .dashboard-hours-form,
  .status-grid,
  .timeline-row,
  .rule-grid,
  .calendar-meta-grid {
    grid-template-columns: 1fr;
  }

  .project-table,
  .project-table-head,
  .dashboard-project-table,
  .dashboard-project-row,
  .montage-price-table {
    grid-template-columns: 1fr;
  }

  .project-table-head,
  .dashboard-project-table-head {
    display: none;
  }

  .project-row {
    gap: 4px;
    padding: 10px;
  }

  .dashboard-project-row {
    gap: 6px;
    padding: 10px;
  }

  .task-row-head {
    display: none;
  }

  .task-card,
  .task-project-group,
  .project-detail-card,
  .voice-panel {
    padding: 12px;
  }

  .chat-message {
    max-width: 100%;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .folder-grid,
  .file-area-grid,
  .file-browser-folders,
  .quote-layout,
  .quote-summary,
  .quote-position-head,
  .quote-position-row,
  .quote-line {
    grid-template-columns: 1fr;
  }

  .quote-document {
    padding: 14px;
  }

  .quote-preview-toolbar,
  .quote-preview-toolbar .quote-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .quote-review-line,
  .quote-review-totals {
    grid-template-columns: 1fr;
  }

  .quote-review-total strong {
    justify-content: flex-start;
  }

  .quote-review-meta {
    min-width: 0;
  }

  .quote-document-total {
    justify-content: flex-start;
  }

  .quote-hero-visual {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .quote-visual-sketch {
    max-width: 240px;
  }

  .quote-document-table-wrap {
    overflow: visible;
  }

  .quote-document-table,
  .quote-document-table thead,
  .quote-document-table tbody,
  .quote-document-table tr,
  .quote-document-table th,
  .quote-document-table td {
    display: block;
    width: 100% !important;
  }

  .quote-document-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
  }

  .quote-document-table thead {
    display: none;
  }

  .quote-document-table tr {
    border: 1px solid #d9e2de;
    background: #ffffff;
    padding: 10px;
    margin-bottom: 10px;
  }

  .quote-document-table td {
    border-bottom: 0;
    padding: 6px 0;
    text-align: left !important;
  }

  .quote-document-table td:not(.quote-description-cell) {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .quote-document-table td::before {
    content: attr(data-label);
    color: #52635f;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .quote-description-cell {
    display: grid !important;
    gap: 5px;
  }

  .quote-description-cell::before {
    margin-bottom: 2px;
  }

  .quote-description-cell p {
    margin-top: 0;
    max-width: none;
    color: #172b2d;
    font-size: 14px;
    line-height: 1.45;
  }

  .quote-description-cell small {
    color: #52635f;
    font-size: 12px;
  }

  .quote-pdf-attribute-editor {
    padding: 8px;
  }

  .quote-line-edit-key {
    opacity: 1;
  }

  .quote-pdf-line-editor {
    max-height: calc(100vh - 36px);
    overflow: auto;
  }

  .quote-document-table td:nth-child(3) {
    font-weight: 900;
  }

  .quote-document-terms {
    padding: 12px;
  }

  .quote-terms-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quote-document-terms article {
    padding: 10px;
  }

  .quote-document-terms article strong {
    font-size: 20px;
  }

  .quote-position-head {
    display: none;
  }

  .span-2 {
    grid-column: span 1;
  }

  .settings-price-grid,
  .quote-description-picker {
    grid-template-columns: 1fr;
  }
}

/* Phase 1/3: Premium Dark design foundation */
body {
  background:
    radial-gradient(circle at 20% 0%, rgba(33, 90, 130, 0.16), transparent 34%),
    linear-gradient(135deg, #081016 0%, #0d151d 48%, #111827 100%);
  color: #edf4f7;
}

.app-nav {
  background: linear-gradient(180deg, #07121c 0%, #0b1722 55%, #081018 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 16px 0 34px rgba(0, 0, 0, 0.28);
}

.brand {
  padding: 4px 2px 16px;
}

.brand strong {
  display: block;
  color: #f7fbff;
  font-size: 20px;
  letter-spacing: 0;
}

.brand span:last-child {
  color: #8fb4c8;
  font-size: 14px;
  font-weight: 750;
}

.nav-button {
  border-radius: 8px;
  color: #c8d5de;
  min-height: 44px;
  padding: 0 14px;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.nav-button.active,
.nav-button:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(14, 116, 144, 0.74));
  border-color: rgba(96, 165, 250, 0.55);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

.nav-bottom {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.sidebar-style {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  color: #d9e7ef;
}

.sidebar-style summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.sidebar-style summary::-webkit-details-marker {
  display: none;
}

.sidebar-style summary::after {
  content: "⌄";
  color: #8fb4c8;
}

.sidebar-style[open] summary::after {
  content: "⌃";
}

.sidebar-style label {
  display: grid;
  gap: 5px;
  padding: 0 12px 12px;
  color: #9fb2c1;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-style select {
  min-height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 7px;
  background: #0b1520;
  color: #edf4f7;
  padding: 0 9px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.62);
}

.user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #d9a55d, #64748b);
  color: #081016;
  font-weight: 900;
}

.user-box strong {
  display: block;
  color: #ffffff;
}

.user-box button {
  margin-top: 2px;
  padding: 0;
  background: transparent;
  color: #91a4b3;
  font-size: 12px;
  font-weight: 750;
}

main {
  background:
    radial-gradient(circle at 88% 8%, rgba(79, 70, 229, 0.13), transparent 28%),
    linear-gradient(135deg, #0d141c 0%, #111923 100%);
}

.topbar {
  color: #f8fbff;
}

.topbar h1 {
  color: #f8fbff;
  font-size: clamp(28px, 2.6vw, 38px);
}

.app-title-mark {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.24);
}

.top-actions input,
.ari-talk-form input,
.simple-calendar-form input,
.simple-calendar-form select,
.dashboard-inline-select,
.dashboard-project-inline input,
input,
select,
textarea {
  background: rgba(15, 23, 42, 0.74);
  border-color: rgba(148, 163, 184, 0.22);
  color: #edf4f7;
}

input::placeholder,
textarea::placeholder {
  color: #788b9b;
}

.panel,
.metric-card,
.item-card,
.project-lead-hero,
.project-focus-card,
.calendar-popup {
  background: linear-gradient(180deg, rgba(22, 31, 43, 0.94), rgba(14, 22, 32, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
  color: #eef5f8;
}

.compact-panel {
  padding: 14px;
}

.panel-head h2,
.voice-head h2,
.project-focus-card h3,
.calendar-popup h3,
.project-lead-hero h3 {
  color: #f8fbff;
}

.meta,
.muted,
.panel-head p,
.project-focus-card small,
.project-lead-metric small,
.metric-card small {
  color: #94a8b7;
}

.dashboard-kpi-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.premium-kpi {
  min-height: 126px;
  padding: 17px;
  border-top: 0;
  display: grid;
  align-content: space-between;
}

.premium-kpi .metric-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 9px;
  background: rgba(37, 99, 235, 0.18);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 900;
}

.premium-kpi.amber .metric-icon {
  background: rgba(245, 158, 11, 0.17);
  color: #fbbf24;
}

.premium-kpi.violet .metric-icon {
  background: rgba(124, 58, 237, 0.18);
  color: #c4b5fd;
}

.premium-kpi.green .metric-icon {
  background: rgba(16, 185, 129, 0.16);
  color: #86efac;
}

.premium-kpi.teal .metric-icon {
  background: rgba(20, 184, 166, 0.16);
  color: #5eead4;
}

.metric-card span {
  color: #a6b6c3;
  font-weight: 800;
}

.metric-card strong {
  color: #ffffff;
  font-size: 30px;
}

.dashboard-week-panel,
.dashboard-projects-panel,
.voice-panel {
  border-color: rgba(148, 163, 184, 0.18);
}

.week-day,
.month-cell,
.dashboard-project-row,
.project-table.project-row,
.task-row,
.quote-result,
.time-entry-row {
  background: rgba(15, 23, 42, 0.52);
  border-color: rgba(148, 163, 184, 0.14);
  color: #edf4f7;
}

.week-day-head {
  background: rgba(30, 41, 59, 0.78);
  color: #f8fbff;
}

.week-item {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(14, 165, 233, 0.18));
  border-color: rgba(96, 165, 250, 0.44);
  color: #eaf6ff;
}

.week-item small,
.week-item em {
  color: #b8d6e8;
}

.primary-button {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: white;
  border-radius: 8px;
}

.secondary-button,
.text-button,
.back-button {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #dce8ef;
  border-radius: 8px;
}

.pill.neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #dce8ef;
  border-color: rgba(148, 163, 184, 0.2);
}

.voice-panel {
  margin-bottom: 16px;
}

.ai-settings-grid {
  display: none;
}

@media (max-width: 1050px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  body {
    background: #0d141c;
  }

  .app-nav {
    background: #07121c;
  }

  .dashboard-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .premium-kpi {
    min-height: 96px;
    padding: 12px;
  }

  .metric-card strong {
    font-size: 23px;
  }
}

/* Phase 2/3: Premium Dark dashboard composition */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(420px, 1.65fr) minmax(260px, 0.9fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.dashboard-task-overview-panel,
.dashboard-two-week-panel,
.dashboard-assistant-panel {
  min-width: 0;
  min-height: 100%;
}

.dashboard-task-overview-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.dashboard-task-overview {
  display: grid;
  place-items: center;
  min-height: 315px;
}

.task-donut-wrap {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(120px, 1fr);
  gap: 22px;
  align-items: center;
}

.task-donut {
  width: min(220px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  justify-self: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #111923 0 48%, transparent 49%),
    conic-gradient(var(--task-donut));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 22px 38px rgba(0, 0, 0, 0.26);
}

.task-donut strong {
  color: #ffffff;
  font-size: 34px;
  line-height: 1;
}

.task-donut span {
  margin-top: 6px;
  color: #b9c9d6;
  font-size: 12px;
  font-weight: 850;
}

.task-donut-legend {
  display: grid;
  gap: 10px;
  align-content: center;
}

.task-donut-legend span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #dbe8ef;
  font-size: 13px;
  font-weight: 800;
}

.task-donut-legend i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.dashboard-two-week-panel {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 10px;
}

.dashboard-two-week-panel .panel-head {
  margin-bottom: 0;
}

.dashboard-two-week-panel .simple-calendar-form {
  grid-template-columns: 1.05fr 1.2fr 1.35fr 1fr 0.72fr 0.72fr auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.38);
}

.calendar-entry-drawer {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.28);
}

.calendar-entry-drawer summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: pointer;
  color: #dbe8ef;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.calendar-entry-drawer summary::-webkit-details-marker {
  display: none;
}

.calendar-entry-drawer summary::after {
  content: "+";
  color: #93c5fd;
  font-size: 16px;
}

.calendar-entry-drawer[open] summary::after {
  content: "-";
}

.calendar-entry-drawer .simple-calendar-form {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 0 0 10px 10px;
  background: rgba(15, 23, 42, 0.4);
}

.dashboard-two-week-panel .dashboard-week-plan {
  gap: 12px;
}

.dashboard-two-week-panel .dashboard-week-block-title {
  color: #b9c9d6;
  font-size: 12px;
  letter-spacing: 0;
}

.dashboard-two-week-panel .dashboard-week-days {
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 8px;
  overflow: visible;
}

.dashboard-two-week-panel .week-day {
  min-width: 0;
  min-height: 148px;
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.44);
  border-radius: 10px;
}

.dashboard-two-week-panel .week-day-head {
  min-height: 46px;
  background: rgba(14, 116, 144, 0.18);
  border-color: rgba(148, 163, 184, 0.13);
  color: #eff8ff;
}

.dashboard-two-week-panel .week-day-head span {
  color: #a9c4d5;
  font-size: 11px;
}

.dashboard-two-week-panel .week-day-head strong {
  color: #ffffff;
  font-size: 17px;
}

.dashboard-two-week-panel .week-day-items {
  padding: 8px;
  display: grid;
  gap: 7px;
}

.dashboard-two-week-panel .week-item {
  padding: 9px;
  border-radius: 8px;
  box-shadow: none;
}

.dashboard-two-week-panel .week-item-time {
  font-size: 11px;
}

.dashboard-two-week-panel .week-item strong {
  font-size: 12px;
}

.dashboard-two-week-panel .week-item small,
.dashboard-two-week-panel .week-item em {
  font-size: 11px;
}

.calendar-open-button {
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
  font-weight: 900;
}

.dashboard-assistant-panel {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 12px;
}

.dashboard-assistant-panel .panel-head {
  width: 100%;
}

.online-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.65);
}

.assistant-mic-button {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.16), transparent 32%),
    linear-gradient(135deg, #2563eb, #6d5dfc);
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.28);
  color: #ffffff;
  font-size: 34px;
}

.assistant-title {
  color: #ffffff;
  font-size: 18px;
}

.assistant-subtitle {
  margin: -6px 0 4px;
  color: #a8bbc8;
  font-weight: 750;
}

.dashboard-assistant-form {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.dashboard-assistant-form input {
  min-height: 42px;
  border-radius: 8px;
}

.dashboard-assistant-form button {
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.32);
  color: #dbeafe;
  font-weight: 900;
}

.dashboard-assistant-buttons {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dashboard-assistant-buttons button {
  min-height: 36px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #dce8ef;
  font-size: 12px;
  font-weight: 850;
}

.dashboard-day-details {
  display: none;
}

@media (max-width: 1350px) {
  .dashboard-main-grid {
    grid-template-columns: minmax(260px, 0.95fr) minmax(390px, 1.5fr);
  }

  .dashboard-assistant-panel {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(180px, 260px) minmax(260px, 1fr);
    align-items: center;
    justify-items: start;
  }

  .dashboard-assistant-panel .panel-head {
    grid-column: 1 / -1;
  }

  .assistant-mic-button {
    width: 76px;
    height: 76px;
    font-size: 28px;
  }

  .dashboard-assistant-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .task-donut-wrap {
    grid-template-columns: 1fr;
  }

  .dashboard-task-overview {
    min-height: 260px;
  }

  .task-donut {
    width: 190px;
  }

  .dashboard-two-week-panel .simple-calendar-form {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-two-week-panel .dashboard-week-days {
    overflow-x: auto;
    grid-template-columns: repeat(6, minmax(155px, 1fr));
  }

  .dashboard-assistant-panel {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .dashboard-assistant-buttons {
    grid-template-columns: 1fr 1fr;
  }
}

/* Phase 2 layout correction: prevent dashboard overlap and restore KPI row */
#morning > .dashboard-kpi-grid {
  display: grid;
}

.dashboard-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}

.premium-kpi {
  min-height: 112px;
}

.dashboard-main-grid {
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.48fr) minmax(280px, 0.85fr);
  overflow: hidden;
}

.dashboard-main-grid > .panel {
  overflow: hidden;
}

.dashboard-two-week-panel {
  min-width: 0;
}

.dashboard-two-week-panel .deployment-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dashboard-two-week-panel .quick-filter-group {
  display: none;
}

.dashboard-two-week-panel .dashboard-week-plan {
  min-width: 0;
  overflow: hidden;
}

.dashboard-two-week-panel .dashboard-week-days {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
}

.dashboard-two-week-panel .week-day {
  min-width: 0;
}

.dashboard-two-week-panel .week-day-head {
  padding: 7px 8px;
}

.dashboard-two-week-panel .week-day-head strong {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 16px;
  white-space: nowrap;
}

.dashboard-two-week-panel .weather-badge {
  font-size: 10px;
  white-space: nowrap;
}

.dashboard-two-week-panel .week-empty {
  font-size: 12px;
}

.dashboard-two-week-panel .week-item {
  min-width: 0;
}

.dashboard-two-week-panel .week-item-tools,
.dashboard-two-week-panel .week-item-mobile-actions {
  display: none !important;
}

.calendar-open-button {
  max-width: 100%;
}

.dashboard-assistant-panel {
  position: relative;
  z-index: 1;
}

@media (max-width: 1250px) {
  .dashboard-main-grid {
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.35fr);
  }

  .dashboard-assistant-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  #morning > .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Calendar entry plus and editor */
.week-day,
.month-cell-wrap {
  position: relative;
}

.calendar-day-add {
  position: absolute;
  z-index: 5;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, 0.38);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #dbeafe;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.calendar-day-add:hover,
.calendar-day-add:focus-visible {
  background: #2563eb;
  color: #ffffff;
}

.month-cell-wrap {
  min-height: 64px;
}

.month-cell-wrap .month-cell {
  width: 100%;
  height: 100%;
}

.month-add {
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  font-size: 14px;
}

.calendar-entry-modal {
  width: min(820px, calc(100vw - 28px));
  max-height: min(88vh, 820px);
  overflow: auto;
}

.calendar-entry-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.calendar-entry-form label {
  display: grid;
  gap: 5px;
  color: #a8bbc8;
  font-size: 12px;
  font-weight: 850;
}

.calendar-entry-form .wide {
  grid-column: 1 / -1;
}

.calendar-entry-form input,
.calendar-entry-form select,
.calendar-entry-form textarea {
  width: 100%;
  min-height: 38px;
}

.calendar-entry-form select[multiple] {
  min-height: 86px;
  padding: 7px;
}

.calendar-entry-form textarea {
  resize: vertical;
}

.calendar-entry-form .calendar-popup-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.task-date-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-date-add {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
  color: #dbeafe;
  font-size: 14px;
  font-weight: 900;
}

@media (max-width: 720px) {
  .calendar-day-add {
    width: 32px;
    height: 32px;
    top: 8px;
    right: 8px;
  }

  .calendar-entry-modal {
    width: calc(100vw - 18px);
    max-height: 92vh;
  }

  .calendar-entry-form {
    grid-template-columns: 1fr;
  }

  .calendar-entry-form .calendar-popup-actions {
    justify-content: stretch;
  }

  .calendar-entry-form .calendar-popup-actions button {
    width: 100%;
  }
}

/* Ari simple mobile layer: final override for phone usability */
@media (max-width: 650px) {
  body {
    display: block;
    min-width: 0;
    background: #0b1118;
  }

  .app-nav {
    position: sticky;
    top: 0;
    z-index: 70;
    min-height: auto;
    padding: 10px;
    gap: 10px;
  }

  .brand {
    padding: 0;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand span:last-child {
    font-size: 12px;
  }

  nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-button {
    min-height: 38px;
    padding: 0 6px;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    border-radius: 8px;
  }

  .nav-bottom {
    display: none;
  }

  main {
    padding: 10px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
  }

  .title-row {
    min-width: 0;
  }

  .title-row h1 {
    font-size: 24px;
    line-height: 1.05;
  }

  .back-button {
    display: none;
  }

  .top-actions {
    display: flex;
    width: auto;
  }

  .top-actions input {
    display: none;
  }

  .top-actions .mic-icon-button {
    width: 42px;
    height: 42px;
    padding: 0;
  }

  #morning > .dashboard-kpi-grid {
    display: none;
  }

  .mobile-dashboard-summary {
    display: grid;
  }

  .dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    overflow: visible;
  }

  .dashboard-task-overview-panel,
  .dashboard-assistant-panel {
    display: none;
  }

  .dashboard-two-week-panel {
    padding: 10px;
  }

  .dashboard-two-week-panel .panel-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .dashboard-two-week-panel .deployment-head-actions {
    justify-content: flex-end;
  }

  .dashboard-two-week-panel .dashboard-week-plan {
    overflow: visible;
  }

  .dashboard-two-week-panel .dashboard-week-days {
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: visible;
  }

  .dashboard-two-week-panel .week-day {
    min-height: 112px;
  }

  .dashboard-two-week-panel .week-day-head {
    min-height: 42px;
  }

  .dashboard-week-panel:not(.mobile-calendar-open) .dashboard-week-plan {
    display: none;
  }

  .calendar-entry-drawer .simple-calendar-form,
  .simple-calendar-form {
    grid-template-columns: 1fr;
  }

  .simple-calendar-form input,
  .simple-calendar-form select,
  .simple-calendar-form button {
    min-height: 42px;
    grid-column: 1 / -1;
  }

  .mobile-calendar-summary {
    display: grid;
  }

  .calendar-open-button {
    min-height: 44px;
  }

  .dashboard-projects-panel {
    margin-top: 10px;
  }

  .dashboard-project-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .voice-panel {
    padding: 8px;
  }

  .voice-panel.mobile-open {
    max-height: 70vh;
  }

  .calendar-popup {
    width: calc(100vw - 16px);
    max-height: 92vh;
    padding: 10px;
  }

  .calendar-popup-edit,
  .calendar-entry-form {
    grid-template-columns: 1fr;
  }

  .calendar-popup-actions button,
  .mobile-critical-actions button {
    min-height: 44px;
  }

  .quote-layout,
  .quote-position-row,
  .time-form-grid,
  .time-entry-row,
  .project-table,
  .project-row {
    grid-template-columns: 1fr;
  }
}

/* Sprachassistent und KI-Anbindung sind bewusst deaktiviert. */
.voice-panel,
.voice-button,
.mobile-voice-compact,
.mic-icon-button,
.deployment-mic-button,
.dashboard-assistant-panel,
.assistant-mic-button,
.dashboard-assistant-form,
.dashboard-assistant-buttons,
.ai-settings-grid,
.ai-connection-status,
.voice-capability-status {
  display: none !important;
}

/* Kompakte Ari-Oberfläche nach Entfernen von Sprach-/KI-Assistent */
body {
  grid-template-columns: 230px minmax(0, 1fr);
}

main {
  padding: 16px;
}

.app-nav {
  padding: 18px 14px;
  gap: 18px;
}

.topbar {
  margin-bottom: 12px;
}

.topbar h1 {
  font-size: clamp(30px, 3.1vw, 42px);
  line-height: 1;
}

.app-mode-notice {
  margin-bottom: 12px;
  padding: 9px 12px;
}

#morning > .dashboard-kpi-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric-card,
.premium-kpi {
  min-height: 82px;
  padding: 12px;
  border-radius: 10px;
}

.metric-card strong {
  font-size: 25px;
  line-height: 1.05;
}

.metric-card span,
.metric-card small {
  font-size: 12px;
}

.dashboard-main-grid {
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.55fr) !important;
  gap: 12px;
  align-items: start;
  overflow: visible;
}

.dashboard-main-grid > .panel,
.panel {
  border-radius: 10px;
}

.dashboard-task-overview-panel,
.dashboard-two-week-panel {
  min-height: 0;
}

.dashboard-task-overview {
  min-height: 220px;
  align-content: center;
}

.task-donut-wrap {
  grid-template-columns: 1fr;
  gap: 12px;
  justify-items: center;
}

.task-donut {
  width: min(170px, 100%);
}

.task-donut strong {
  font-size: 28px;
}

.task-donut-legend {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.task-donut-legend span {
  font-size: 12px;
}

.dashboard-two-week-panel {
  gap: 8px;
}

.dashboard-two-week-panel .panel-head {
  align-items: start;
}

.dashboard-two-week-panel .dashboard-week-plan {
  gap: 9px;
}

.dashboard-two-week-panel .dashboard-week-block-title {
  margin-top: 2px;
  margin-bottom: 2px;
}

.dashboard-two-week-panel .dashboard-week-days {
  gap: 7px;
}

.dashboard-two-week-panel .week-day {
  min-height: 112px;
  border-radius: 9px;
}

.dashboard-two-week-panel .week-day-head {
  min-height: 40px;
  padding: 6px 8px;
}

.dashboard-two-week-panel .week-day-head span {
  font-size: 10px;
}

.dashboard-two-week-panel .week-day-head strong {
  font-size: 15px;
}

.dashboard-two-week-panel .week-day-items {
  min-height: 54px;
  padding: 7px;
  gap: 5px;
}

.dashboard-two-week-panel .week-empty {
  min-height: 36px;
  display: grid;
  place-items: center;
  opacity: 0.55;
}

.dashboard-two-week-panel .week-item {
  padding: 7px;
  border-radius: 7px;
}

.calendar-open-button {
  min-height: 40px;
}

.dashboard-projects-panel {
  margin-top: 12px;
}

.dashboard-project-row {
  min-height: 46px;
  padding: 9px 10px;
}

.dashboard-project-table-head {
  padding: 0 10px 5px;
}

.dashboard-project-detail-panel.simple-disabled,
.dashboard-team-window.simple-disabled {
  display: none !important;
}

@media (max-width: 1180px) {
  #morning > .dashboard-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
  }

  .dashboard-task-overview {
    min-height: 190px;
  }

  .task-donut-wrap {
    grid-template-columns: minmax(130px, 170px) minmax(0, 1fr);
  }
}

@media (max-width: 650px) {
  body {
    display: block;
    background: #0b1118;
  }

  main {
    padding: 8px;
  }

  .app-nav {
    padding: 8px;
    gap: 8px;
  }

  nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-button {
    min-height: 34px;
    font-size: 12px;
    padding: 0 5px;
  }

  .topbar {
    margin-bottom: 8px;
    gap: 6px;
  }

  .title-row h1,
  .topbar h1 {
    font-size: 25px;
  }

  .app-mode-notice {
    padding: 8px 9px;
    margin-bottom: 8px;
    font-size: 12px;
  }

  .mobile-dashboard-summary {
    margin-bottom: 8px;
    gap: 6px;
    padding: 8px;
  }

  .mobile-dashboard-head {
    min-height: 34px;
    padding: 0;
  }

  .mobile-dashboard-head strong {
    font-size: 13px;
  }

  .mobile-dashboard-head span {
    font-size: 11px;
  }

  .mobile-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-quick-actions button {
    min-height: 34px;
    padding: 0 6px;
    font-size: 11px;
  }

  .mobile-metric-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .mobile-metric-grid article {
    min-height: 46px;
    padding: 6px 4px;
    text-align: center;
  }

  .mobile-metric-grid span {
    font-size: 9px;
    line-height: 1.15;
  }

  .mobile-metric-grid strong {
    font-size: 14px;
    line-height: 1.15;
  }

  .dashboard-main-grid {
    gap: 8px;
  }

  .dashboard-two-week-panel {
    padding: 8px;
  }

  .dashboard-two-week-panel .panel-head {
    margin-bottom: 4px;
  }

  .dashboard-two-week-panel .week-day {
    min-height: 76px;
  }

  .dashboard-two-week-panel .week-day-head {
    min-height: 34px;
  }

  .dashboard-two-week-panel .week-day-items {
    min-height: 38px;
    padding: 6px;
  }

  .dashboard-two-week-panel .week-empty {
    min-height: 24px;
    font-size: 11px;
  }

  .calendar-open-button {
    min-height: 38px;
  }

  .dashboard-projects-panel {
    margin-top: 8px;
    padding: 8px;
  }

  .dashboard-project-table-head {
    display: none;
  }

  .dashboard-project-row {
    min-height: 0;
    padding: 8px;
  }

  .panel-head h2 {
    font-size: 16px;
  }
}

/* Final readability and phone/desktop sync polish */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  line-height: 1.45;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.panel,
.mobile-dashboard-summary,
.app-mode-notice,
.dashboard-project-row,
.task-edit-card,
.week-item {
  overflow-wrap: anywhere;
}

.app-mode-notice {
  border-radius: 8px;
}

.app-mode-notice span {
  color: inherit;
}

.dashboard-project-inline {
  min-width: 0;
}

.dashboard-project-inline input,
.dashboard-inline-select {
  min-width: 0;
}

.dashboard-row-actions {
  min-width: 0;
  flex-wrap: wrap;
}

@media (max-width: 1180px) {
  body {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  main {
    padding: 14px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-actions input {
    width: 100%;
  }
}

@media (max-width: 760px) {
  body {
    display: block;
    background: #f4f7f5;
    color: #172b2d;
  }

  .app-nav {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: auto;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .brand {
    align-items: center;
    justify-content: space-between;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .nav-button {
    min-height: 40px;
    padding: 0 4px;
    border-radius: 7px;
    text-align: center;
    font-size: 11px;
    line-height: 1.1;
  }

  .nav-bottom {
    display: none;
  }

  main {
    padding: 10px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .title-row {
    min-width: 0;
  }

  .title-row h1,
  .topbar h1 {
    font-size: 24px;
    line-height: 1.12;
  }

  .eyebrow {
    font-size: 11px;
  }

  .top-actions,
  .top-actions input {
    width: 100%;
  }

  .top-actions input {
    display: block;
    min-height: 42px;
    font-size: 16px;
  }

  .app-mode-notice {
    font-size: 12px;
    line-height: 1.35;
  }

  .mobile-dashboard-summary {
    background: #ffffff;
    color: #172b2d;
    border: 1px solid #dfe8e3;
    box-shadow: 0 8px 22px rgba(18, 60, 60, 0.08);
  }

  .mobile-quick-actions {
    grid-template-columns: 1fr;
  }

  .mobile-quick-actions button {
    min-height: 42px;
    font-size: 13px;
  }

  .mobile-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-metric-grid article {
    min-height: 64px;
    padding: 9px;
  }

  .mobile-metric-grid span {
    font-size: 11px;
  }

  .mobile-metric-grid strong {
    font-size: 18px;
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .dashboard-task-overview-panel {
    display: none;
  }

  .panel,
  .compact-panel,
  .dashboard-two-week-panel,
  .dashboard-projects-panel {
    padding: 10px;
    border-radius: 8px;
  }

  .panel-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
  }

  .panel-head h2 {
    font-size: 17px;
    line-height: 1.2;
  }

  .quick-filter-group {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-filter {
    min-height: 36px;
    text-align: center;
  }

  .dashboard-week-panel:not(.mobile-calendar-open) .dashboard-week-plan {
    display: grid;
  }

  .dashboard-two-week-panel .dashboard-week-days {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dashboard-two-week-panel .week-day {
    min-height: 86px;
  }

  .dashboard-two-week-panel .week-item {
    font-size: 12px;
    line-height: 1.3;
  }

  .dashboard-project-table-head {
    display: none;
  }

  .dashboard-project-row,
  .project-row,
  .time-entry-row,
  .task-summary-row {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .dashboard-project-inline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .dashboard-project-inline input,
  .dashboard-inline-select,
  .dashboard-row-actions button,
  .primary-button,
  .secondary-button {
    min-height: 42px;
  }

  .dashboard-time-summary,
  .dashboard-period,
  .meta,
  .muted {
    font-size: 12px;
    line-height: 1.35;
  }

  .form-grid,
  .task-edit-form,
  .quote-layout,
  .quote-library-filters,
  .quote-library-item,
  .quote-position-row,
  .quote-description-picker,
  .settings-price-grid,
  .time-form-grid,
  .calendar-popup-edit,
  .calendar-entry-form {
    grid-template-columns: 1fr !important;
  }

  .span-2,
  .span-3,
  .span-4 {
    grid-column: 1 / -1 !important;
  }

  .quote-library-list {
    max-height: none;
    overflow: visible;
  }

  .quote-measure-grid,
  .quote-signature-grid {
    grid-template-columns: 1fr;
  }

  .quote-library-item {
    min-height: 58px;
  }

  .quote-side-panel {
    position: static;
    order: -1;
  }

  .quote-form-panel {
    order: 1;
  }

  .quote-position-head + .quote-positions .quote-field > span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  .quote-position-row {
    padding: 10px;
    gap: 10px;
  }

  .quote-field-total {
    grid-template-columns: 1fr;
  }

  .quote-line-total {
    justify-content: flex-start;
    min-height: 42px;
  }

  .quote-library-item strong,
  .quote-library-item small {
    white-space: normal;
  }
}

/* Minimal readability stabilization: contrast only, no layout changes */
body,
input,
select,
textarea {
  color: #172b2d;
}

input,
select,
textarea {
  background: #ffffff;
  border-color: #cfd9d4;
}

.panel,
.compact-panel,
.mobile-dashboard-summary,
.calendar-popup,
.settings-panel {
  color: #172b2d;
}

.meta,
.muted,
.eyebrow {
  color: #4f5f5b;
}

.app-nav,
.app-nav .nav-button,
.app-nav .brand strong {
  color: #f7fbfa;
}

.app-nav .brand span:last-child {
  color: #d7e8e4;
}

.app-mode-notice.warning,
.app-mode-notice.ok {
  color: #24413d;
}

.status-box {
  color: #172b2d;
}

.status-box strong {
  color: #172b2d;
}

.status-box span,
.project-focus-card .empty,
.project-focus-card .empty-state {
  color: #4f5f5b;
}

.project-focus-card .project-plain-list span {
  color: #172b2d;
}

.project-focus-card .project-plain-list span small {
  color: #4f5f5b;
}

.dashboard-project-text {
  display: grid;
  gap: 2px;
}

.dashboard-project-text strong {
  color: #172b2d;
}

.dashboard-project-text small {
  color: #4f5f5b;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-status-pill {
  width: max-content;
  padding: 4px 8px;
  border: 1px solid #cfd9d4;
  border-radius: 6px;
  color: #24413d;
  font-size: 12px;
  font-weight: 800;
}

#calendar.view.active {
  display: block;
}

#calendar .calendar-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

#calendar .calendar-layout > .panel:not(.calendar-month-panel),
#calendar > .detail-panel {
  display: none;
}

#calendar .calendar-month-panel {
  min-height: 0;
  width: 100%;
}

.ari-google-day-panel {
  overflow: hidden;
}

.calendar-sync-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.calendar-sync-strip .notice {
  flex: 1 1 260px;
  margin: 0;
  padding: 8px 10px;
}

.ari-google-day-agenda {
  display: grid;
  gap: 12px;
}

.ari-google-day-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  align-items: center;
}

.ari-google-day-head strong {
  display: block;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.2;
}

.ari-google-source {
  display: block;
  margin-bottom: 3px;
  color: #0b63f6;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ari-work-target {
  display: grid;
  gap: 6px;
  color: #24413d;
  font-size: 12px;
  font-weight: 900;
}

.ari-work-target div {
  height: 10px;
  overflow: hidden;
  border: 1px solid #cdd9e5;
  border-radius: 999px;
  background: #eef2f7;
}

.ari-work-target i {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b63f6, #0ea5a3);
}

.ari-calendar-ribbon {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.ari-ribbon-tile {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 74px;
  padding: 9px 10px;
  border: 1px solid #d4deeb;
  border-radius: 7px;
  background: #f8fbff;
}

.ari-ribbon-tile span {
  color: #0b63f6;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ari-ribbon-tile strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ari-ribbon-tile small {
  color: #56677c;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.ari-google-day-body {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) minmax(220px, 300px);
  gap: 10px;
  min-height: 620px;
}

.ari-google-time-axis {
  display: grid;
  grid-template-rows: repeat(12, 1fr);
  padding-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.ari-google-timeline {
  position: relative;
  min-height: 620px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background:
    repeating-linear-gradient(to bottom, #ffffff 0, #ffffff 50px, #f6f9fc 51px, #f6f9fc 52px);
  overflow: hidden;
}

.ari-google-event {
  position: absolute;
  left: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid #8bbcff;
  border-left: 5px solid #0b63f6;
  border-radius: 7px;
  background: #eef5ff;
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.ari-google-event.work {
  border-left-color: #0ea5a3;
  background: #ecfdfb;
}

.ari-google-event.break {
  border-color: #d7c39a;
  border-left-color: #c49a2d;
  background: #fff8e8;
}

.ari-google-event span,
.ari-google-event small,
.ari-google-event em,
.ari-google-open-item span {
  display: block;
  color: #475569;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.ari-google-event strong,
.ari-google-open-item strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ari-google-event-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.ari-google-reminders {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.ari-google-reminders em,
.ari-google-open-item small {
  width: max-content;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid #cdd9e5;
  border-radius: 5px;
  background: #ffffff;
  color: #34516f;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.ari-google-event a,
.ari-google-open-item a {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #bcd2f4;
  border-radius: 5px;
  background: #ffffff;
  color: #0b63f6;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.ari-google-side-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fbff;
}

.ari-google-open-item {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid #dbe4ef;
  border-radius: 7px;
  background: #ffffff;
}

.ari-google-empty {
  margin: 14px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.ari-google-now-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  height: 2px;
  background: #ef4444;
}

.ari-google-now-line::before {
  content: "";
  position: absolute;
  left: 10px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ef4444;
}

.calendar-plan-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px;
}

.ari-proposal-reminders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.ari-proposal-reminders span {
  padding: 5px 8px;
  border: 1px solid #cdd9e5;
  border-radius: 6px;
  background: #f8fbff;
  color: #24413d;
  font-size: 11px;
  font-weight: 850;
}

.calendar-month-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  gap: 8px;
}

.calendar-month-days .week-day {
  min-height: 170px;
}

.calendar-month-days .week-item {
  min-height: 62px;
}

.calendar-month-item {
  cursor: pointer;
}

.calendar-month-item strong,
.calendar-month-item small,
.calendar-month-item em {
  display: block;
}

#calendar .calendar-month-item,
.dashboard-two-week-panel .week-item {
  color: #f8fbff;
}

#calendar .calendar-month-item .week-item-time,
.dashboard-two-week-panel .week-item .week-item-time {
  color: #c8f3ff;
}

#calendar .calendar-month-item strong,
.dashboard-two-week-panel .week-item strong {
  color: #ffffff;
}

#calendar .calendar-month-item small,
#calendar .calendar-month-item em,
.dashboard-two-week-panel .week-item small,
.dashboard-two-week-panel .week-item em {
  color: #e6f3ff;
}

#calendar .calendar-month-item.open,
.dashboard-two-week-panel .week-item.open {
  background: #123e68;
  border-color: #3b82c4;
}

#calendar .calendar-month-item.critical,
.dashboard-two-week-panel .week-item.critical {
  background: #6f1d1b;
  border-color: #f87171;
}

#calendar .calendar-month-item.urgent,
.dashboard-two-week-panel .week-item.urgent {
  background: #5f460b;
  border-color: #facc15;
}

@media (max-width: 760px) {
  .dashboard-week-panel .dashboard-week-plan {
    display: grid !important;
  }

  .ari-google-day-head,
  .ari-google-day-body {
    grid-template-columns: 1fr;
  }

  .ari-calendar-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ari-ribbon-tile {
    min-height: 68px;
  }

  .ari-google-time-axis {
    display: none;
  }

  .ari-google-timeline {
    min-height: 520px;
  }

  .ari-google-event {
    left: 8px;
    right: 8px;
    grid-template-columns: 1fr;
  }

  .ari-google-event-actions {
    justify-items: start;
  }
}

@media (max-width: 760px) {
  main > .view {
    display: none !important;
  }

  main > .view.active {
    display: block !important;
  }

  main > .view.hidden-module {
    display: none !important;
  }

  #calendar.view.active,
  #projects.view.active {
    display: block !important;
  }

  #morning.view.active {
    display: flex !important;
    flex-direction: column;
  }

  #morning > .dashboard-main-grid {
    order: 1;
  }

  #morning > .dashboard-kpi-grid {
    order: 2;
  }

  #morning > .dashboard-projects-panel {
    order: 3;
  }

  #morning > .dashboard-day-details,
  #morning > .dashboard-project-detail-panel,
  #morning > .dashboard-team-window {
    order: 4;
  }

  #morning > .dashboard-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .mobile-dashboard-summary {
    display: none !important;
  }

  .dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .dashboard-task-overview-panel {
    display: none !important;
    order: 2;
  }

  .dashboard-two-week-panel {
    order: 1;
  }

  .dashboard-task-overview {
    min-height: 180px;
  }

  .task-donut-wrap {
    grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
    align-items: center;
  }

  .task-donut {
    width: 140px;
    min-height: 140px;
  }

  .task-donut strong {
    font-size: 24px;
  }

  .task-donut-legend {
    grid-template-columns: 1fr;
  }

  .dashboard-two-week-panel .dashboard-week-days {
    grid-template-columns: repeat(2, minmax(138px, 1fr));
    overflow: visible;
  }

  .dashboard-two-week-panel .week-day {
    min-height: 112px;
  }

  .dashboard-two-week-panel .week-item {
    min-height: 70px;
  }

  .calendar-entry-drawer,
  .mobile-calendar-summary {
    display: none !important;
  }

  #morning > .dashboard-kpi-grid .metric-card,
  #morning > .dashboard-kpi-grid .premium-kpi {
    min-height: 62px;
    padding: 9px;
  }

  #morning > .dashboard-kpi-grid .metric-card strong {
    font-size: 20px;
  }

  #morning > .dashboard-kpi-grid .metric-card span,
  #morning > .dashboard-kpi-grid .metric-card small {
    font-size: 11px;
  }

  .dashboard-projects-panel {
    margin-top: 0;
  }

  .dashboard-projects-panel .panel-head,
  #projects .panel-head {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .dashboard-project-row,
  #projects .project-row {
    background: #f7fbfa;
    border: 1px solid #cfd9d4;
    border-radius: 8px;
    padding: 11px !important;
    gap: 7px !important;
  }

  .dashboard-project-row > strong,
  #projects .project-row > strong {
    color: #0b6b6b;
    font-size: 12px;
  }

  .dashboard-period,
  .dashboard-time-summary,
  #projects .mini-metric {
    display: block;
    color: #4f5f5b;
    font-size: 12px;
    line-height: 1.35;
  }

  .dashboard-row-actions,
  #projects .project-manage-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .dashboard-row-actions button,
  #projects .project-manage-actions button {
    width: 100%;
    min-height: 38px;
  }

  .dashboard-row-actions .secondary-button {
    grid-column: 1 / -1;
  }

  #projects .project-row > span:first-of-type {
    display: grid;
    gap: 2px;
  }

  #projects .project-row > span:first-of-type strong {
    color: #172b2d;
    font-size: 15px;
  }

  #projects .project-row > span:first-of-type small {
    color: #4f5f5b;
    font-size: 13px;
  }

  #projects .project-row > span:nth-of-type(2) {
    width: max-content;
    padding: 4px 8px;
    border: 1px solid #cfd9d4;
    border-radius: 6px;
    color: #24413d;
    font-size: 12px;
    font-weight: 800;
  }

  #projects .project-row > span:nth-of-type(3) {
    color: #4f5f5b;
    font-size: 12px;
  }

  #projects .project-manage-actions .danger-text-button {
    display: none;
  }

  #projects .file-browser-panel {
    display: none;
  }

  #projects.view.active {
    display: block !important;
  }

  #projects .project-list-shell,
  #projects .project-timeline-shell,
  #projects .project-detail-shell {
    margin-bottom: 10px;
    position: static;
  }

  #projects .project-detail-shell,
  #projects .project-focus-card,
  #projects .edit-card,
  #projects .project-tab-panel,
  #projects .project-lead-hero,
  #projects .project-lead-metric,
  #projects .project-next-action-card {
    background: #f7fbfa;
    color: #172b2d;
  }

  #projects .project-detail-shell,
  #projects .project-tab-panel,
  #projects .project-focus-card,
  #projects .project-lead-hero,
  #projects .project-lead-metric,
  #projects .status-box {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  #projects .project-lead-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #projects .project-lead-status {
    justify-content: flex-start;
  }

  #projects .project-lead-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  #projects .project-lead-metric {
    min-height: 86px;
  }

  #projects .project-lead-metric strong {
    font-size: 18px;
    line-height: 1.18;
    overflow-wrap: break-word;
  }

  #projects .project-tab-layout,
  #projects .project-simple-grid {
    grid-template-columns: 1fr !important;
  }

  #projects .project-tab-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #projects .project-tab-button {
    width: 100%;
    min-height: 42px;
  }

  #projects .project-detail-shell h2,
  #projects .project-detail-shell h3,
  #projects .project-focus-card h3,
  #projects .edit-card h3,
  #projects .project-lead-hero h3,
  #projects .project-lead-metric strong,
  #projects .project-next-action-card strong {
    color: #172b2d;
  }

  #projects .meta,
  #projects .project-lead-hero p,
  #projects .project-focus-card small,
  #projects .project-lead-metric small,
  #projects .project-next-action-card small,
  #projects .project-focus-card label,
  #projects .edit-card label {
    color: #4f5f5b;
  }

  #projects input,
  #projects select,
  #projects textarea {
    background: #ffffff !important;
    color: #172b2d !important;
    border-color: #cfd9d4 !important;
  }

  #projects input::placeholder,
  #projects textarea::placeholder {
    color: #70807c !important;
  }

  .edit-card,
  .task-edit-card,
  .calendar-popup,
  .calendar-entry-modal,
  .time-tracking-card,
  .item-card {
    color: #172b2d;
  }

  .edit-card label,
  .task-edit-card label,
  .calendar-popup label,
  .calendar-entry-modal label,
  .time-tracking-card label {
    color: #4f5f5b !important;
  }

  .edit-card input,
  .edit-card select,
  .edit-card textarea,
  .task-edit-card input,
  .task-edit-card select,
  .task-edit-card textarea,
  .calendar-popup input,
  .calendar-popup select,
  .calendar-popup textarea,
  .calendar-entry-modal input,
  .calendar-entry-modal select,
  .calendar-entry-modal textarea,
  .time-tracking-card input,
  .time-tracking-card select,
  .time-tracking-card textarea {
    background: #ffffff !important;
    color: #172b2d !important;
    border-color: #cfd9d4 !important;
  }

  .dashboard-two-week-panel .week-day {
    padding-bottom: 28px;
  }

  .dashboard-two-week-panel .calendar-day-add {
    top: auto;
    right: 7px;
    bottom: 7px;
    width: 22px;
    height: 22px;
    font-size: 14px;
  }

  .dashboard-two-week-panel .week-day-head {
    padding-right: 8px;
  }

  .dashboard-two-week-panel .week-day-head strong {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    line-height: 1.15;
  }

  .dashboard-two-week-panel .weather-badge {
    margin-left: 0;
    font-size: 9px;
    gap: 2px;
  }

  .dashboard-two-week-panel .weather-badge small {
    font-size: 9px;
  }

  #calendar .calendar-month-panel,
  #calendar .panel {
    padding: 10px;
  }

  #calendar .panel-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #calendar .panel-head .actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  #calendar .panel-head .actions button {
    min-height: 38px;
    padding: 7px 6px;
  }

  #calendar .calendar-month-days {
    grid-template-columns: repeat(2, minmax(138px, 1fr));
  }

  #calendar .calendar-month-days .week-day {
    min-height: 112px;
    padding-bottom: 28px;
  }

  #calendar .calendar-month-days .week-item {
    min-height: 70px;
  }
}

/* Final light theme override */
:root {
  --bg: #f6f8f9;
  --surface: #ffffff;
  --surface-soft: #f8fbfa;
  --ink: #172b2d;
  --muted: #52635f;
  --line: #d7e2df;
  --nav: #ffffff;
  --nav-soft: #eef6f5;
  --accent: #0f766e;
  --accent-dark: #0a5f59;
}

body {
  background: #f6f8f9 !important;
  color: #172b2d !important;
}

.app-nav {
  background: #ffffff !important;
  color: #172b2d !important;
  border-right: 1px solid #d7e2df !important;
  box-shadow: 8px 0 24px rgba(23, 43, 45, 0.06) !important;
}

.brand strong,
.app-nav .brand strong {
  color: #172b2d !important;
}

.brand span,
.brand span:last-child,
.app-nav .brand span:last-child {
  color: #52635f !important;
}

.nav-button,
.app-nav .nav-button {
  color: #172b2d !important;
  background: transparent !important;
  border-color: transparent !important;
}

.nav-button.active,
.nav-button:hover,
.app-nav .nav-button.active,
.app-nav .nav-button:hover {
  background: #e8f8f2 !important;
  border-color: #86d7b6 !important;
  color: #0f5f59 !important;
  box-shadow: none !important;
}

.sidebar-style,
.user-card,
.nav-bottom .sidebar-style {
  background: #f8fbfa !important;
  color: #172b2d !important;
  border-color: #d7e2df !important;
}

.main-area,
main,
.top-bar {
  background: #f6f8f9 !important;
  color: #172b2d !important;
}

.top-bar {
  border-bottom: 1px solid #d7e2df !important;
}

.panel,
.compact-panel,
.detail-panel,
.metric-card,
.item-card,
.project-focus-card,
.dashboard-detail-card,
.dashboard-project-row,
.task-card,
.task-project-group,
.calendar-popup,
.calendar-entry-modal,
.settings-panel {
  background: #ffffff !important;
  color: #172b2d !important;
  border-color: #d7e2df !important;
  box-shadow: 0 10px 28px rgba(23, 43, 45, 0.06) !important;
}

.panel-head,
.item-top,
.dashboard-project-row.selected,
.dashboard-detail-card {
  color: #172b2d !important;
}

.meta,
.panel p,
.dashboard-period,
.dashboard-time-summary,
small {
  color: #52635f !important;
}

input,
select,
textarea {
  background: #ffffff !important;
  color: #172b2d !important;
  border-color: #cfd9d4 !important;
}

input::placeholder,
textarea::placeholder {
  color: #71817c !important;
}

.app-mode-notice,
.mobile-dashboard-summary {
  background: #effbf7 !important;
  color: #172b2d !important;
  border-color: #bde7d8 !important;
}

.dashboard-week-panel,
.calendar-month-panel {
  background: #ffffff !important;
}

.week-day,
.calendar-month-days .week-day {
  background: #f8fbfa !important;
  border-color: #d7e2df !important;
  color: #172b2d !important;
}

.week-day-head,
.week-empty {
  color: #52635f !important;
}

.week-item,
.calendar-month-item {
  background: #eaf4ff !important;
  color: #172b2d !important;
  border-color: #9cc5eb !important;
}

.week-item strong,
.week-item small,
.week-item em {
  color: #172b2d !important;
}

.project-timeline {
  background: #ffffff !important;
  color: #172b2d !important;
  border-color: #d7e2df !important;
}

.project-timeline-head strong,
.project-timeline-label span {
  color: #172b2d !important;
}

.project-timeline-head span,
.project-timeline-label small,
.project-timeline-days span {
  color: #52635f !important;
}

.project-timeline-row {
  background: #f8fbfa !important;
  border-color: #d7e2df !important;
}

.project-timeline-track {
  background:
    repeating-linear-gradient(90deg, rgba(23, 43, 45, 0.08) 0 1px, transparent 1px calc(100% / var(--timeline-days))),
    #eef4f3 !important;
}

.quote-library-list,
.quote-result,
.quote-position-row,
.project-workspace,
.file-browser,
.mini-explorer {
  background: #ffffff !important;
  color: #172b2d !important;
  border-color: #d7e2df !important;
}

.floating-back-button {
  background: #ffffff !important;
  color: #172b2d !important;
  border-color: #cfd9d4 !important;
  box-shadow: 0 10px 24px rgba(23, 43, 45, 0.14) !important;
}

/* Bektashi blue theme alignment */
:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe4ef;
  --nav: #071d33;
  --nav-soft: #0e2b47;
  --accent: #0b63f6;
  --accent-dark: #084ec4;
  --green: #10a878;
  --green-bg: #effdf8;
  --blue: #0b63f6;
  --blue-bg: #eef5ff;
}

body {
  background: #f5f8fc !important;
  color: #0f172a !important;
}

main,
.main-area {
  background:
    radial-gradient(circle at 78% 0%, rgba(11, 99, 246, 0.08), transparent 30%),
    linear-gradient(180deg, #fbfdff 0%, #f5f8fc 42%, #f3f7fb 100%) !important;
}

.app-nav {
  background:
    linear-gradient(180deg, #0b2440 0%, #071d33 54%, #061629 100%) !important;
  border-right: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 18px 0 40px rgba(15, 23, 42, 0.12) !important;
  color: #ffffff !important;
}

.brand {
  padding-bottom: 18px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.brand strong,
.app-nav .brand strong {
  color: #ffffff !important;
  font-size: 20px !important;
  letter-spacing: 0 !important;
}

.brand span,
.brand span:last-child,
.app-nav .brand span:last-child {
  color: #c7d7ea !important;
}

.nav-button,
.app-nav .nav-button {
  min-height: 48px !important;
  border-radius: 8px !important;
  color: #e8f1fb !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  padding: 0 16px !important;
}

.nav-button.active,
.nav-button:hover,
.app-nav .nav-button.active,
.app-nav .nav-button:hover {
  background: linear-gradient(135deg, #0b63f6 0%, #0f7eea 100%) !important;
  border-color: rgba(147, 197, 253, 0.55) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 28px rgba(11, 99, 246, 0.28) !important;
}

.user-box,
.sidebar-style,
.nav-bottom .sidebar-style {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
}

.user-box strong,
.user-box button {
  color: #ffffff !important;
}

.user-avatar {
  background: #e5ddd2 !important;
  color: #0f172a !important;
}

.topbar {
  background: transparent !important;
  color: #0f172a !important;
  border-bottom: 1px solid #dbe4ef !important;
}

.topbar h1 {
  color: #0f172a !important;
}

.app-title-mark {
  color: #0b63f6 !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

.top-actions input,
input,
select,
textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cfd9e6 !important;
  box-shadow: none !important;
}

input::placeholder,
textarea::placeholder {
  color: #8a9aad !important;
}

.panel,
.compact-panel,
.detail-panel,
.metric-card,
.item-card,
.project-focus-card,
.dashboard-detail-card,
.dashboard-project-row,
.task-card,
.task-project-group,
.calendar-popup,
.calendar-entry-modal,
.settings-panel,
.quote-result,
.quote-side-panel,
.quote-library-list,
.quote-position-row,
.project-workspace,
.file-browser,
.mini-explorer {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #dbe4ef !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07) !important;
}

.panel-head h2,
.item-top h3,
.metric-card strong,
.dashboard-project-row strong,
.project-table strong {
  color: #0f172a !important;
}

.meta,
.panel p,
.dashboard-period,
.dashboard-time-summary,
small {
  color: #64748b !important;
}

/* Massaufnahme */
#measurement.view.active {
  display: block;
}

.measurement-panel {
  display: grid;
  gap: 12px;
}

.measurement-ribbon {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fbff;
  overflow-x: auto;
}

.measurement-ribbon-button {
  min-width: 126px;
  min-height: 58px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid #c7d6e8;
  border-radius: 7px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  white-space: nowrap;
}

.measurement-ribbon-button:hover {
  border-color: #0b63f6;
  color: #0b63f6;
}

.measurement-ribbon-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #9ec5ff;
  border-radius: 6px;
  background: #eef5ff;
  color: #0b63f6;
  font-size: 16px;
  line-height: 1;
}

.measurement-ribbon input[type="file"] {
  display: none;
}

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

.measurement-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #ffffff;
}

.measurement-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.measurement-form input,
.measurement-form select,
.measurement-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #cfd9e6;
  border-radius: 7px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
}

.measurement-form textarea {
  min-height: 96px;
  resize: vertical;
}

.measurement-preview {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.measurement-photo-stage {
  position: relative;
  width: 100%;
  height: clamp(360px, 44vw, 520px);
  min-height: 520px;
  min-width: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(226, 232, 240, 0.75) 1px, transparent 1px),
    linear-gradient(0deg, rgba(226, 232, 240, 0.75) 1px, transparent 1px),
    #f8fafc;
  background-size: 42px 42px;
}

.measurement-photo-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #111827;
}

.measurement-photo-stage img[hidden] {
  display: none;
}

.measurement-photo-empty {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  color: #334155;
}

.measurement-photo-empty strong {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  font-size: 18px;
}

.measurement-photo-empty span {
  display: inline-block;
  max-width: 520px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #64748b;
  font-weight: 700;
}

.measurement-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.measurement-line {
  fill: none;
  stroke-width: 5;
  vector-effect: non-scaling-stroke;
}

.measurement-line-main {
  stroke: #0b63f6;
}

.measurement-line-wall {
  stroke: #e79a00;
}

.measurement-line-floor {
  stroke: #0f9f6e;
  stroke-dasharray: 16 10;
}

.measurement-line-raw {
  stroke: #ef4444;
  stroke-dasharray: 12 10;
}

.measurement-tick {
  stroke: #0f172a;
}

.measurement-overlay-label {
  position: absolute;
  z-index: 3;
  max-width: 180px;
  padding: 6px 9px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.measurement-width-label {
  left: 49%;
  top: 76%;
  transform: translate(-50%, -50%);
}

.measurement-height-label {
  right: 8%;
  top: 49%;
  transform: translate(50%, -50%) rotate(-90deg);
}

.measurement-wall-label {
  right: 5%;
  top: 13%;
}

.measurement-finished-floor-label {
  left: 5%;
  bottom: 12%;
  border-color: rgba(15, 159, 110, 0.36);
}

.measurement-raw-floor-label {
  left: 5%;
  bottom: 5%;
  border-color: rgba(239, 68, 68, 0.36);
}

.measurement-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.measurement-summary div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #ffffff;
}

.measurement-summary span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.measurement-summary strong {
  color: #0f172a;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.measurement-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.measurement-drafts {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.measurement-draft-list {
  display: grid;
  gap: 8px;
}

.measurement-draft-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #ffffff;
}

.measurement-draft-item div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.measurement-draft-item strong,
.measurement-draft-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measurement-draft-item span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

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

  .measurement-photo-stage {
    height: clamp(360px, 58vw, 520px);
    min-height: 430px;
  }
}

@media (max-width: 720px) {
  .measurement-ribbon {
    align-items: stretch;
  }

  .measurement-ribbon-button {
    min-width: 112px;
    min-height: 52px;
    font-size: 11px;
  }

  .measurement-form {
    grid-template-columns: 1fr;
  }

  .measurement-form .span-2,
  .measurement-form button.span-2 {
    grid-column: auto;
  }

  .measurement-photo-stage {
    height: clamp(300px, 90vw, 460px);
    min-height: 320px;
    aspect-ratio: 4 / 5;
  }

  .measurement-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .measurement-draft-item {
    grid-template-columns: 1fr;
  }

  .measurement-draft-item .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.app-mode-notice {
  background: #f0fdfa !important;
  color: #0f172a !important;
  border: 1px solid #b7eadb !important;
  box-shadow: 0 8px 22px rgba(16, 168, 120, 0.08) !important;
}

.primary-button,
.calendar-open-button,
.save-action-button {
  background: linear-gradient(135deg, #0b63f6 0%, #0a56d8 100%) !important;
  border-color: #0b63f6 !important;
  color: #ffffff !important;
  box-shadow: 0 12px 22px rgba(11, 99, 246, 0.22) !important;
}

.primary-button:hover,
.calendar-open-button:hover {
  background: linear-gradient(135deg, #0a56d8 0%, #084ec4 100%) !important;
}

.secondary-button,
.text-button,
.back-button,
.quick-filter {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cfd9e6 !important;
}

.quick-filter.active,
.dashboard-status-pill,
.pill.blue {
  background: #eef5ff !important;
  color: #0b63f6 !important;
  border-color: #9ec5ff !important;
}

.metric-card {
  min-height: 132px !important;
}

.metric-card span:first-child,
.premium-kpi span:first-child {
  background: linear-gradient(135deg, #0b63f6, #69a6ff) !important;
  color: #ffffff !important;
}

.metric-card:nth-child(2) span:first-child,
.premium-kpi:nth-child(2) span:first-child {
  background: linear-gradient(135deg, #e79a00, #f8c15d) !important;
}

.metric-card:nth-child(3) span:first-child,
.premium-kpi:nth-child(3) span:first-child {
  background: linear-gradient(135deg, #6d4bd0, #9272f4) !important;
}

.metric-card:nth-child(4) span:first-child,
.premium-kpi:nth-child(4) span:first-child {
  background: linear-gradient(135deg, #0f9f6e, #42c493) !important;
}

.metric-card:nth-child(5) span:first-child,
.premium-kpi:nth-child(5) span:first-child {
  background: linear-gradient(135deg, #0ca7b8, #48c9d4) !important;
}

.dashboard-week-panel,
.dashboard-two-week-panel,
.calendar-month-panel {
  background: #ffffff !important;
}

.dashboard-two-week-panel .dashboard-week-block-title,
.dashboard-week-block-title {
  color: #0b63f6 !important;
}

.week-day,
.calendar-month-days .week-day {
  background: #f8fbff !important;
  border-color: #dbe4ef !important;
  color: #0f172a !important;
}

.week-day-head,
.calendar-month-days .week-day-head {
  background: #ffffff !important;
  color: #0f172a !important;
  border-bottom: 1px solid #dbe4ef !important;
}

.week-day-head span,
.week-empty {
  color: #64748b !important;
}

.week-day-head strong {
  color: #1e293b !important;
}

.week-day.today,
.calendar-month-days .week-day.today {
  border-color: #0b63f6 !important;
  box-shadow: inset 0 0 0 1px rgba(11, 99, 246, 0.15) !important;
}

.week-item,
.calendar-month-item {
  background: #eef5ff !important;
  color: #0f172a !important;
  border-color: #8bbcff !important;
  box-shadow: none !important;
}

.week-item strong,
.week-item small,
.week-item em,
.week-item .week-item-range,
.week-item .week-item-time {
  color: #0f172a !important;
}

.week-item.calendar-project-range {
  background: #eef5ff !important;
  border-color: #0b63f6 !important;
}

.dashboard-project-table,
.project-table.project-table-head,
.dashboard-project-table-head {
  color: #64748b !important;
}

.project-table.project-row,
.dashboard-project-row {
  background: #ffffff !important;
  border-color: #dbe4ef !important;
}

.dashboard-project-row.selected,
.project-table.project-row.selected {
  border-color: #9ec5ff !important;
  box-shadow: 0 12px 24px rgba(11, 99, 246, 0.1) !important;
}

.project-timeline {
  background: #ffffff !important;
  border-color: #dbe4ef !important;
}

.project-timeline-track {
  background:
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.08) 0 1px, transparent 1px calc(100% / var(--timeline-days))),
    #eef3f8 !important;
}

.timeline-segment,
.project-timeline-segment {
  background: linear-gradient(135deg, #0b63f6, #10a878) !important;
}

.task-donut {
  background:
    radial-gradient(circle at center, #ffffff 0 48%, transparent 49%),
    conic-gradient(var(--task-donut)) !important;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08) !important;
}

.task-donut strong {
  color: #0f172a !important;
}

.task-donut span,
.task-donut-legend span {
  color: #334155 !important;
}

.quote-document {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #dbe4ef !important;
}

@media (max-width: 650px) {
  body {
    background: #f5f8fc !important;
  }

  .app-nav {
    background: #071d33 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .topbar {
    background: #f5f8fc !important;
  }

  .panel,
  .metric-card,
  .dashboard-project-row,
  .project-focus-card,
  .item-card {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06) !important;
  }

  .mobile-dashboard-summary {
    background: #f0fdfa !important;
    border-color: #b7eadb !important;
  }

  .project-mail-form,
  .project-activity-timeline span {
    grid-template-columns: 1fr !important;
  }

  .project-file-item {
    grid-template-columns: auto 42px minmax(0, 1fr);
  }

  .project-file-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .project-file-delete {
    justify-self: start;
  }

  .project-pdf-toolbar {
    display: grid;
    gap: 8px;
    position: sticky;
    top: 0;
  }

  .project-pdf-frame-wrap {
    min-height: calc(100vh - 170px);
    border-radius: 8px;
  }

  .project-pdf-frame-wrap iframe {
    width: calc(100% * var(--pdf-zoom, 1));
    min-width: 100%;
    height: calc(100vh - 145px);
  }

  .project-mail-card-head {
    display: grid;
  }

  .project-mail-attachments {
    display: grid;
  }
}

.top-actions .global-project-switch {
  display: block;
  min-height: 38px;
  min-width: 260px;
}

@media (max-width: 760px) {
  .top-actions {
    display: flex !important;
  }

  .top-actions .global-project-switch {
    width: 100%;
    min-width: 0;
  }
}
/* ARI Rechner */
.calculator-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(360px, 1fr);
  gap: 18px;
  align-items: start;
}

.calculator-shell {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0;
}

.calculator-device {
  width: min(100%, 390px);
  margin: 0 auto;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, #253042 0%, #111827 62%, #0b111a 100%);
  border: 1px solid #334155;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.calculator-brand-row,
.calculator-memory-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.calculator-brand-row span {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0;
}

.calculator-brand-row small,
.calculator-memory-row span {
  color: #cbd5e1;
  font-weight: 800;
}

.calculator-solar-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 45%;
  margin: 14px 0;
}

.calculator-solar-row span {
  display: block;
  height: 20px;
  border-radius: 3px;
  background: linear-gradient(180deg, #111827, #020617);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.calculator-display {
  min-height: 86px;
  padding: 13px 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #dce8d6, #b7c7ae);
  border: 2px solid #0f172a;
  box-shadow: inset 0 3px 8px rgba(15, 23, 42, 0.34);
  color: #102018;
  text-align: right;
  overflow: hidden;
}

.calculator-display small {
  display: block;
  min-height: 18px;
  font-size: 0.8rem;
  color: rgba(16, 32, 24, 0.64);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calculator-display strong {
  display: block;
  margin-top: 4px;
  font-family: "Courier New", monospace;
  font-size: clamp(1.7rem, 6vw, 2.5rem);
  line-height: 1.05;
  word-break: break-all;
}

.calculator-memory-row {
  margin: 14px 0 10px;
}

.calculator-memory-row button {
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  padding: 8px 11px;
  background: #334155;
  color: #f8fafc;
  font-weight: 900;
}

.calculator-keypad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.calculator-keypad button {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc, #cbd5e1);
  color: #0f172a;
  box-shadow: 0 4px 0 #64748b;
  font-size: 1.05rem;
  font-weight: 950;
}

.calculator-keypad button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #64748b;
}

.calculator-keypad .calc-control {
  background: linear-gradient(180deg, #94a3b8, #64748b);
  color: #ffffff;
  box-shadow: 0 4px 0 #334155;
}

.calculator-keypad .calc-operator {
  background: linear-gradient(180deg, #f59e0b, #d97706);
  color: #111827;
  box-shadow: 0 4px 0 #92400e;
}

.calculator-keypad .calc-equals {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 0 #1e3a8a;
}

.metal-calculator-panel {
  min-width: 0;
}

.metal-calc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metal-calc-grid label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 900;
}

.metal-calc-grid input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d7e0e7;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 850;
}

.metal-calc-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.metal-calc-results article {
  min-height: 102px;
  padding: 14px;
  border: 1px solid #dbe5ed;
  border-radius: 10px;
  background: #f8fbff;
}

.metal-calc-results span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.metal-calc-results strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: 1.28rem;
  line-height: 1.15;
}

.metal-calc-results small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-weight: 750;
}

@media (max-width: 920px) {
  .calculator-layout {
    grid-template-columns: 1fr;
  }

  .calculator-device {
    width: 100%;
  }

  .metal-calc-grid,
  .metal-calc-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .calculator-device {
    padding: 18px;
    border-radius: 18px;
  }

  .calculator-keypad {
    gap: 8px;
  }

  .calculator-keypad button {
    min-height: 50px;
    border-radius: 9px;
  }

  .metal-calc-grid,
  .metal-calc-results {
    grid-template-columns: 1fr;
  }
}


/* Mobile project register: list first, large tap targets, no timeline clutter */
@media (max-width: 760px) {
  #projects.view.active {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
  }

  #projects .project-toolbar {
    order: 1;
  }

  #projects .project-form-panel {
    order: 2;
  }

  #projects .project-list-shell {
    order: 3;
  }

  #projects .project-detail-shell {
    order: 4;
  }

  #projects .project-timeline-shell {
    display: none !important;
    order: 5;
  }

  #projects > .project-list-shell + .panel {
    order: 6;
  }

  #projects .project-list-shell {
    padding: 10px;
  }

  #projects .project-row {
    cursor: pointer;
    min-height: 0;
    padding: 12px !important;
  }

  #projects .project-row > strong {
    font-size: 14px;
    color: #0b63f6;
  }

  #projects .project-manage-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 4px;
  }

  #projects .project-manage-actions .text-button {
    min-height: 42px;
    border: 1px solid #b9cce4;
    border-radius: 8px;
    background: #f7fbff;
    color: #0b3d73;
    font-size: 13px;
    font-weight: 800;
  }

  #projects .project-manage-actions .danger-text-button {
    display: none !important;
  }
}


/* Project administration: explicit selection, permanent actions, scalable timeline */
.project-management-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #244766;
  border-radius: 12px;
  background: #071d33;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(7, 29, 51, 0.16);
}

.project-management-bar.empty {
  grid-template-columns: 1fr;
}

.project-management-selection {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-management-selection strong,
.project-management-selection small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-management-selection strong {
  color: #ffffff;
  font-size: 15px;
}

.project-management-selection small {
  color: #bfd0df;
  font-size: 12px;
  font-weight: 750;
}

.project-selection-kicker {
  color: #65a8ff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-management-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(82px, 1fr));
  gap: 6px;
}

.project-management-actions button,
.timeline-range-controls button {
  min-height: 38px;
  border: 1px solid #54708a;
  border-radius: 8px;
  background: #ffffff;
  color: #0b355d;
  font-weight: 900;
  cursor: pointer;
}

.project-management-actions button:hover,
.project-management-actions button:focus-visible {
  border-color: #65a8ff;
  outline: 3px solid rgba(101, 168, 255, 0.25);
}

.project-management-actions button.danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
}

.project-number-cell {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.project-select-dot {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #9fb3c8;
  border-radius: 50%;
  background: #ffffff;
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
}

.project-row.selected .project-select-dot {
  border-color: #0b63f6;
  background: #0b63f6;
}

.project-row:focus-visible {
  outline: 3px solid rgba(11, 99, 246, 0.28);
  outline-offset: 2px;
}

.project-timeline-tools {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.timeline-range-controls {
  display: grid !important;
  grid-template-columns: repeat(3, auto);
  gap: 4px;
}

.timeline-range-controls button {
  min-height: 30px;
  padding: 0 10px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  font-size: 11px;
}

.timeline-range-controls button.active {
  border-color: #65a8ff;
  background: #0b63f6;
  color: #ffffff;
}

@media (max-width: 760px) {
  #projects.view.active {
    padding-bottom: 205px;
  }

  #projects .project-management-bar {
    position: fixed;
    z-index: 95;
    right: 10px;
    bottom: max(12px, calc(66px + env(safe-area-inset-bottom)));
    left: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
    padding: 10px;
    border-color: #3b6387;
    box-shadow: 0 18px 44px rgba(7, 29, 51, 0.34);
  }

  #projects .project-management-selection strong {
    font-size: 14px;
  }

  #projects .project-management-selection small {
    display: none;
  }

  #projects .project-management-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  #projects .project-management-actions button {
    min-height: 44px;
    padding: 0 5px;
    font-size: 12px;
  }

  #projects .project-row {
    border: 2px solid #dbe4ef;
    border-radius: 12px;
  }

  #projects .project-row.selected {
    border-color: #0b63f6;
    background: #eef5ff;
    box-shadow: 0 0 0 3px rgba(11, 99, 246, 0.11);
  }

  #projects .project-row .project-manage-actions {
    display: none !important;
  }

  #projects .project-number-cell {
    font-size: 14px;
    color: #0b63f6;
  }

  #projects .project-timeline-shell {
    display: block !important;
    order: 5;
    padding: 10px;
    overflow: hidden;
  }

  #projects .project-timeline,
  #projects .project-timeline-head,
  #projects .project-timeline-grid {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
  }

  #projects .project-timeline-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  #projects .project-timeline-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }

  #projects .project-timeline-tools {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  #projects .timeline-range-controls button {
    min-height: 34px;
    padding: 0 8px;
  }

  #projects .project-timeline-axis,
  #projects .project-timeline-row {
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr) !important;
    gap: 6px;
    width: 100%;
    min-width: 0;
  }

  #projects .project-timeline-days,
  #projects .project-timeline-track {
    grid-template-columns: repeat(var(--timeline-days), minmax(0, 1fr)) !important;
    min-width: 0;
  }

  #projects .project-timeline-row {
    min-height: 52px;
    padding: 6px;
  }

  #projects .project-timeline-label {
    min-width: 0;
  }

  #projects .project-timeline-label strong {
    font-size: 11px;
  }

  #projects .project-timeline-label span {
    font-size: 11px;
  }

  #projects .project-timeline-label small {
    display: none;
  }

  #projects .project-timeline-days span {
    font-size: 8px;
  }

  #projects .timeline-segment {
    min-width: 2px;
    min-height: 20px;
    padding: 0;
  }

  #projects .timeline-segment em {
    display: none;
  }
}

@media (max-width: 390px) {
  #projects .project-management-actions button {
    font-size: 11px;
  }

  #projects .project-timeline-axis,
  #projects .project-timeline-row {
    grid-template-columns: 86px minmax(0, 1fr) !important;
  }
}


.project-detail-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-detail-back,
.project-complete-button {
  min-height: 40px;
  border: 1px solid #b9cce4;
  border-radius: 9px;
  padding: 0 12px;
  background: #ffffff;
  color: #0b3d73;
  font-weight: 900;
  cursor: pointer;
}

.project-detail-back {
  display: none;
}

.project-complete-button,
.project-management-actions button.complete {
  border-color: #86d3b6;
  background: #effdf8;
  color: #087555;
}

@media (min-width: 761px) {
  .project-management-actions {
    grid-template-columns: repeat(7, minmax(82px, 1fr));
  }
}

@media (max-width: 760px) {
  #projects.view.active {
    padding-bottom: 255px;
  }

  #projects .project-management-actions button.complete {
    grid-column: 1 / -1;
  }

  #projects.project-detail-mode {
    display: block !important;
    padding-bottom: 90px;
  }

  #projects.project-detail-mode > * {
    display: none !important;
  }

  #projects.project-detail-mode > .project-detail-shell {
    display: block !important;
    margin: 0 !important;
    padding: 10px;
  }

  #projects.project-detail-mode .project-detail-shell > .panel-head {
    position: sticky;
    z-index: 30;
    top: 0;
    margin: -10px -10px 10px;
    padding: 10px;
    background: #ffffff;
    border-bottom: 1px solid #dbe4ef;
  }

  #projects.project-detail-mode .project-detail-shell > .panel-head > div:first-child {
    display: none;
  }

  #projects .project-detail-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #projects .project-detail-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #projects .project-detail-header-actions .pill {
    display: none;
  }

  #projects .project-detail-back,
  #projects .project-complete-button {
    min-height: 46px;
    padding: 0 10px;
    font-size: 13px;
  }
}

/* Mail mobile correction: keep the inbox visible immediately on phones. */
@media (max-width: 760px) {
  body.mail-view-active main {
    padding: 8px 6px 18px !important;
    overflow-x: hidden !important;
  }

  body.mail-view-active #mail.view.active,
  body.mail-view-active .mail-panel,
  body.mail-view-active .mail-module-content,
  body.mail-view-active .ari-mail-shell {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.mail-view-active .mail-panel {
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 32, 52, 0.08);
  }

  .ari-mail-titlebar {
    min-height: 38px;
    padding: 7px 9px;
    align-items: center;
    gap: 8px;
    border-radius: 6px 6px 0 0;
  }

  .ari-mail-titlebar strong,
  .ari-mail-titlebar span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ari-mail-titlebar strong {
    flex: 0 0 auto;
    font-size: 17px !important;
    line-height: 1.15;
  }

  .ari-mail-titlebar span {
    flex: 1 1 auto;
    font-size: 11px !important;
    line-height: 1.25;
    text-align: right;
  }

  .ari-mail-ribbon {
    position: sticky;
    top: 0;
    z-index: 8;
  }

  .ari-mail-toolbar {
    min-height: 0 !important;
    padding: 5px 6px;
    gap: 4px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .ari-mail-toolbar-group {
    flex: 0 0 auto;
    padding: 0 5px;
    gap: 3px;
    scroll-snap-align: start;
  }

  .ari-mail-toolbar button {
    min-width: 52px;
    min-height: 46px;
    padding: 4px 3px;
    font-size: 10px !important;
    line-height: 1.12;
  }

  .ari-mail-toolbar button span {
    width: 24px;
    height: 22px;
    font-size: 0.86rem;
  }

  .ari-mail-layout {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    min-height: 0 !important;
  }

  .ari-mail-folders {
    display: flex !important;
    align-items: stretch;
    gap: 5px;
    width: 100%;
    max-height: none;
    padding: 6px;
    border-right: 0;
    border-bottom: 1px solid #d7d7d7;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .ari-mail-account {
    flex: 0 0 158px;
    padding: 6px 8px;
    border: 1px solid #d7d7d7;
    border-radius: 5px;
    background: #fff;
    scroll-snap-align: start;
  }

  .ari-mail-account strong {
    font-size: 12px !important;
  }

  .ari-mail-account span {
    font-size: 10px !important;
  }

  .ari-mail-folders > button {
    flex: 0 0 auto;
    width: auto !important;
    min-width: max-content;
    min-height: 32px;
    border: 1px solid #cfe0ed;
    border-radius: 999px;
    background: #fff;
    padding: 6px 10px;
    font-size: 12px !important;
    scroll-snap-align: start;
  }

  .ari-mail-folders > button small {
    font-size: 11px !important;
  }

  .ari-mail-folders > button.active {
    border-color: #1473c8;
    background: #e4f2ff;
  }

  .ari-mail-list {
    display: block !important;
    width: 100%;
    max-height: none !important;
    border-right: 0;
    border-bottom: 1px solid #d7d7d7;
  }

  .ari-mail-list-search {
    position: sticky;
    top: 57px;
    z-index: 6;
    background: #ffffff;
  }

  .ari-mail-list-search label {
    padding: 7px 8px 5px;
  }

  .ari-mail-list-search input {
    min-height: 38px;
    border-radius: 7px;
    font-size: 16px !important;
  }

  .ari-mail-list-search div {
    min-height: 24px;
    padding: 0 9px 5px;
    font-size: 11px !important;
  }

  .ari-mail-list-scroll {
    max-height: 42vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ari-mail-row {
    grid-template-columns: 8px minmax(0, 1fr) 30px;
    min-height: 82px;
    padding: 9px 8px;
  }

  .ari-mail-row-head strong {
    max-width: 65%;
    font-size: 12px !important;
  }

  .ari-mail-row-head time {
    font-size: 10px !important;
  }

  .ari-mail-row-subject {
    font-size: 12px !important;
  }

  .ari-mail-row-preview {
    display: -webkit-box;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .ari-mail-row-tags {
    gap: 3px;
  }

  .ari-mail-row-tags span {
    font-size: 9px !important;
    padding: 1px 4px;
  }

  .ari-mail-reading-pane {
    display: block;
    width: 100%;
    max-height: none;
    overflow: visible;
  }

  .ari-mail-reading-empty {
    display: none;
  }

  .ari-mail-message {
    gap: 10px;
    padding: 12px 10px 24px;
  }

  .ari-mail-message-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .ari-mail-message-actions button,
  .ari-mail-preview-actions button {
    min-height: 36px;
    border-radius: 6px;
    padding: 7px 9px;
    font-size: 11px !important;
  }

  .ari-mail-message-head {
    padding-bottom: 7px;
  }

  .ari-mail-message h3 {
    font-size: 18px !important;
    line-height: 1.25;
  }

  .ari-mail-sender-line {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .ari-mail-sender-line time {
    grid-column: 2;
    justify-self: start;
  }

  .ari-mail-meta-grid {
    font-size: 12px !important;
  }

  .ari-mail-meta-grid div,
  .ari-mail-ai-grid {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .ari-mail-body {
    min-height: 140px;
    padding-top: 12px;
    font-size: 14px !important;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  .ari-mail-empty-state,
  .ari-mail-reading-empty {
    min-height: 108px;
    margin: 10px 8px;
    padding: 14px;
  }

  .ari-mail-empty-state strong,
  .ari-mail-reading-empty strong {
    font-size: 15px !important;
  }

  .ari-mail-empty-state p,
  .ari-mail-reading-empty p {
    font-size: 13px !important;
  }

  .ari-mail-preview-actions {
    gap: 6px;
  }

  .ari-mail-ai-panel {
    border-radius: 7px;
    padding: 10px;
  }

  .ari-mail-compose-backdrop {
    place-items: end stretch;
    padding: 8px;
  }

  .ari-mail-compose {
    width: 100%;
    max-height: 88vh;
    border-radius: 10px;
    padding: 12px;
  }
}

@media (max-width: 430px) {
  .ari-mail-titlebar {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .ari-mail-titlebar span {
    text-align: left;
  }

  .ari-mail-toolbar {
    padding: 4px;
  }

  .ari-mail-toolbar button {
    min-width: 49px;
    font-size: 9px !important;
  }

  .ari-mail-folders {
    padding: 5px;
  }

  .ari-mail-account {
    flex-basis: 148px;
  }

  .ari-mail-list-scroll {
    max-height: 40vh;
  }

  .ari-mail-row {
    min-height: 78px;
  }

  .ari-mail-row-tags span:nth-child(n + 3) {
    display: none;
  }
}
