:root {
  --ink: #182f32;
  --secondary: #53696b;
  --muted: #667879;
  --line: #dce4e2;
  --paper: #fff;
  --canvas: #f5f7f6;
  --teal: #096655;
  --dark: #153632;
  --green-light: #e4f3ec;
  --amber: #815215;
  --amber-bg: #fcf0d7;
  --blue: #315d9a;
  --blue-bg: #e9f0fc;
  --purple: #654886;
  font-family: "Inter","Segoe UI",Arial,sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

h1,h2,h3 {
  letter-spacing: -.035em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.9rem,3.1vw,2.75rem);
  font-weight: 650;
}

h2 {
  font-size: 1.35rem;
  font-weight: 650;
}

h3 {
  font-size: 1.02rem;
  font-weight: 650;
}

p {
  line-height: 1.5;
}

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

button,a,input,select,textarea {
  touch-action: manipulation;
}

button {
  cursor: pointer;
  color: inherit;
}

button:disabled {
  opacity: .45;
  cursor: default;
}

button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible {
  outline: 3px solid #358bd7;
  outline-offset: 3px;
}

a {
  color: #17605c;
}

button {
  appearance: none;
  border: 0;
  background: none;
}

input,select,textarea {
  width: 100%;
  border: 1px solid #acbfba;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: .65rem .75rem;
  min-width: 0;
}

select {
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b5751' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

input[type=checkbox] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--teal);
}

input[type=file] {
  padding: .55rem;
  font-size: .875rem;
}

.ico {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -.18em;
  stroke-width: 1.7;
}

.skip {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 30;
  padding: .75rem;
  background: white;
}

.skip:focus {
  top: 1rem;
}

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

.sales-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
  gap: 1px;
  margin: 0 0 24px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.sales-stats > div {
  padding: 15px 18px;
  background: var(--paper);
}
.sales-stats dt, .sales-byline, .sales-feed-head p, .sales-run > summary span, .sales-row-head p {
  color: var(--secondary);
  font-size: .84rem;
}
.sales-stats dd {
  margin: 5px 0 0;
  font-size: 1.75rem;
  font-weight: 650;
  color: var(--teal);
}
.sales-feed-head, .sales-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.sales-feed-head {margin-bottom: 12px;}
.sales-run {margin-bottom: 14px; overflow-wrap: anywhere;}
.sales-run > summary {
  cursor: pointer;
  padding: 15px 18px;
}
.sales-run > summary span {display: inline-block; margin-left: 12px;}
.sales-byline {padding: 0 18px 10px;}
.sales-row {
  display: grid;
  gap: 9px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  font-size: .91rem;
}
.sales-row-head p {margin-top: 4px;}
.sales-reasons {margin: 0; padding-left: 19px; color: var(--secondary);}
.sales-inline > summary {cursor: pointer; color: var(--teal); font-weight: 600;}
.sales-inline[open] .sales-research {margin-top: 14px;}
.sales-research {display: grid; gap: 16px; overflow-wrap: anywhere;}
.sales-research ul, .sales-research ol {margin: 0; padding-left: 19px;}
.sales-research ul.ref-list {padding: 0;}
.sales-research .ref-list a {display: block;}
.sales-research .section-block > p {margin: 6px 0 10px;}
.sales-sources {display: grid; gap: 12px; font-size: .87rem;}
.sales-sources li > p {margin: 3px 0;}
.sales-entry {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.sales-entry > .button {justify-self: start;}

[hidden] {
  display: none!important;
}

.shell {
  display: grid;
  grid-template-columns: 224px minmax(0,1fr);
  min-height: 100vh;
}

.rail {
  background: #143a35;
  color: #d6e7df;
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 28px 14px 16px;
  display: flex;
  flex-direction: column;
  z-index: 4;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.logo-tile {
  background: white;
  border-radius: 9px;
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  flex: none;
}

.logo-tile img {
  width: 39px;
  height: auto;
}

.brand strong {
  display: block;
  color: white;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -.035em;
}

.brand small {
  display: block;
  color: #adcbc0;
  font-size: .75rem;
  margin-top: 2px;
}

.nav {
  margin-top: 46px;
  display: grid;
  gap: 5px;
}

.nav-title {
  font-size: .69rem;
  letter-spacing: .115em;
  text-transform: uppercase;
  font-weight: 650;
  color: #a8c5b9;
  margin: 0 12px 8px;
}

.nav-title.admin {
  margin-top: 30px;
}

.nav-item,.profile-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  text-align: left;
  border-radius: 7px;
  color: #d5e6dd;
  font-size: .9rem;
  font-weight: 500;
}

.nav-item:hover,.profile-btn:hover {
  background: #214940;
}

.nav-item.active {
  background: #d6eadd;
  color: #173d31;
  font-weight: 650;
}

.nav-item .ico {
  width: 18px;
  height: 18px;
}

.profile-btn {
  margin-top: auto;
  padding-top: 15px;
  flex: none;
  width: 100%;
  border-top: 1px solid #426359;
  border-radius: 0;
}

.profile-btn .profile-copy {
  min-width: 0;
  flex: 1;
}

.profile-btn strong,.profile-btn small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-btn small {
  font-size: .75rem;
  color: #b4ccc1;
  font-weight: 400;
}

.avatar {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #d7e9dc;
  color: #254d34;
  font-size: .77rem;
  letter-spacing: .025em;
  font-weight: 700;
  flex: none;
}

.profile-btn .avatar {
  border-radius: 50%;
}

.rail-backdrop {
  display: none;
}

.mobile-menu {
  display: none!important;
}

.workspace {
  min-width: 0;
}

.topbar {
  padding: 0 clamp(20px,3.5vw,58px);
  height: 59px;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--secondary);
  font-size: .84rem;
}

.crumb strong {
  color: var(--ink);
  font-weight: 600;
}

.crumb .slash {
  color: #98a7a4;
}

.environment {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  color: var(--secondary);
}

.work-body {
  max-width: 1600px;
  margin: auto;
  padding: clamp(24px,3vw,46px) clamp(20px,3.5vw,58px) 48px;
}

.heading,.section-heading,.flex-between,.row-head,.dialog-head,.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.heading {
  margin-bottom: 25px;
  align-items: flex-start;
}

.heading p,.panel-head p {
  margin-top: 6px;
  color: var(--secondary);
  font-size: .95rem;
}

.button,.icon-btn,.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 8px 14px;
  border: 1px solid #c6d3ce;
  background: white;
  border-radius: 7px;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.button:hover,.small-btn:hover,.icon-btn:hover {
  background: #f0f5f2;
}

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

.button.primary:hover {
  background: #074f42;
}

.button.danger {
  color: #903b36;
  border-color: #ddc0bd;
}

.icon-btn {
  padding: 7px;
  width: 36px;
  min-height: 36px;
}

.small-btn {
  min-height: 33px;
  padding: 6px 10px;
  font-size: .8rem;
}

.link-btn {
  padding: 4px 0;
  color: var(--teal);
  font-weight: 600;
  text-align: left;
}

.button-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.heading>.button {
  flex: none;
  margin-top: 3px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 13px;
  margin-bottom: 19px;
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  position: relative;
  min-width: 0;
  padding: 17px 18px 15px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .15s,box-shadow .15s;
}

.metric:hover {
  border-color: #95afa4;
  box-shadow: 0 2px 8px #163a3010;
}

.metric.top {
  background: #ddeadf;
  border-color: #c7ddcc;
}

.metric-cap {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  width: 100%;
  font-weight: 600;
  font-size: .88rem;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  background: #edf2ee;
  color: #416453;
  border-radius: 8px;
  flex: none;
}

.metric.top .metric-icon {
  background: #c9dfce;
}

.metric.sched .metric-icon {
  background: var(--blue-bg);
  color: var(--blue);
}

.metric.held .metric-icon {
  background: var(--amber-bg);
  color: var(--amber);
}

.metric-value {
  font-size: 2.4rem;
  line-height: 1.15;
  font-weight: 620;
  letter-spacing: -.065em;
  margin: 4px 0;
}

.metric small {
  font-size: .78rem;
  color: var(--secondary);
  line-height: 1.3;
}

.pipeline {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 25px;
}

.pipeline summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 13px 16px;
  list-style: none;
  font-size: .86rem;
  font-weight: 600;
}

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

.summary-start {
  display: flex;
  align-items: center;
  gap: 9px;
}

.summary-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--secondary);
  font-size: .78rem;
  font-weight: 450;
}

.pipeline[open] .chev {
  transform: rotate(180deg);
}

.distribution {
  display: flex;
  height: 6px;
  width: clamp(75px,12vw,180px);
  overflow: hidden;
  border-radius: 5px;
  background: #e4eae7;
}

.distribution i {
  height: 100%;
  min-width: 0;
}

.breakdown {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  border-top: 1px solid var(--line);
  gap: 9px;
  padding: 13px;
}

.breakdown button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  padding: 9px 10px;
  background: #f6f8f6;
  border-radius: 5px;
  font-size: .83rem;
}

.breakdown button:hover {
  background: #e9f0eb;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.panel-head {
  padding: 21px 20px 14px;
}

.panel-head h2 {
  font-size: 1.26rem;
}

.panel-head p {
  font-size: .84rem;
  margin-top: 3px;
}

.count-pill {
  font-size: .75rem;
  font-weight: 650;
  color: #3d5a50;
  background: #ecf1ed;
  border-radius: 20px;
  padding: 4px 9px;
  margin-left: 6px;
  vertical-align: middle;
}

.tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 20px 16px;
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid #c6d2cd;
  border-radius: 7px;
  min-height: 38px;
  padding: 0 10px;
  min-width: 160px;
  flex: 1;
  max-width: 390px;
  color: var(--secondary);
}

.search:focus-within {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.search input {
  outline: 0!important;
  border: 0;
  background: transparent;
  padding: 8px 0;
  font-size: .86rem;
}

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

.filters select {
  width: auto;
  max-width: 180px;
  font-size: .83rem;
  padding-top: 8px;
  padding-bottom: 8px;
  border-color: #c6d2cd;
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}

th {
  font-size: .74rem;
  font-weight: 600;
  color: #526963;
  background: #f1f5f2;
  white-space: nowrap;
}

th,td {
  padding: 10px 12px;
  border-top: 1px solid #e3e9e5;
}

th:first-child,td:first-child {
  padding-left: 20px;
}

th:last-child,td:last-child {
  padding-right: 20px;
}

td {
  font-size: .84rem;
  line-height: 1.35;
}

tbody tr[data-id] {
  cursor: pointer;
}

tbody tr[data-id]:hover {
  background: #f6f9f6;
}

.biz {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 2px 0;
  max-width: 100%;
}
.business-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}
.business-tools .icon-btn {
  flex: 0 0 30px;
  width: 30px;
  height: 34px;
  color: var(--secondary);
}
[data-act="work-toggle"][data-starred="true"] .ico {
  fill: #f7de8b;
  stroke: #785c17;
}
.work-empty > .ico {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  color: #906f29;
}
.personal-plan .data-list:empty {display:none}
.people-cards + #directory, .empty + #directory {margin-top:20px}
@media(max-width:650px) {
  .business-tools .icon-btn {flex-basis:30px;height:40px}
  #directory .filters {flex-wrap:wrap}
}

.biz-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.biz strong {
  font-weight: 650;
  font-size: .88rem;
}

.biz small,.subtext {
  display: block;
  color: var(--secondary);
  font-size: .76rem;
  line-height: 1.4;
}

.tone-1 {
  background: #ede6d7;
  color: #735321;
}

.tone-2 {
  background: #e5ebf5;
  color: #3b5b83;
}

.tone-3 {
  background: #f2e4ed;
  color: #80526a;
}

.tone-4 {
  background: #ece7f1;
  color: #674e7a;
}

.tone-5 {
  background: #e3ecec;
  color: #3a6367;
}

.stage,.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  padding: 4px 8px;
  line-height: 1.2;
  font-size: .77rem;
  font-weight: 600;
  background: #edf1ee;
  color: #465e54;
}

.stage.prepared {
  background: #ede8f5;
  color: #644e7d;
}

.stage.scheduled {
  background: var(--blue-bg);
  color: var(--blue);
}

.stage.progress {
  background: #e0f1ee;
  color: #255e53;
}

.stage.won,.tag.positive {
  background: var(--green-light);
  color: #2e6246;
}

.tag.amber {
  background: var(--amber-bg);
  color: var(--amber);
}

.tag.red {
  background: #f8e6e3;
  color: #833a32;
}

.owner-tag {
  color: #375a4c;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .81rem;
}

.owner-tag .ico {
  width: 14px;
  height: 14px;
}

.next-cell {
  max-width: 245px;
}

.next-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pagination {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--secondary);
  font-size: .8rem;
}

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

.empty {
  padding: 35px 20px;
  text-align: center;
}

.empty>p {
  color: var(--secondary);
  margin: 7px auto 12px;
  max-width: 40em;
  font-size: .92rem;
}

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

.settings-card {
  padding: 21px;
}

.settings-card p {
  color: var(--secondary);
  font-size: .9rem;
  margin: 6px 0 15px;
  max-width: 70ch;
}

.settings-card label {
  max-width: 360px;
}

.settings-card>form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.people-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(235px,1fr));
  gap: 14px;
}

.person-card {
  padding: 17px;
}

.person-card>.flex-between {
  align-items: flex-start;
}

.person-card h2 {
  font-size: 1.05rem;
  margin-top: 11px;
}

.person-card p {
  color: var(--secondary);
  font-size: .83rem;
  overflow-wrap: anywhere;
}

.person-stats {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 17px;
  font-size: .8rem;
  color: var(--secondary);
}

.person-stats b {
  color: var(--ink);
}

.person-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

dialog {
  margin: auto;
  padding: 0;
  border: 1px solid #cbd8d2;
  border-radius: 13px;
  width: min(570px,94vw);
  max-width: 100vw;
  max-height: 92dvh;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 20px 80px #142f2b33;
  overflow: auto;
}

dialog::backdrop {
  background: #142a2780;
}

.drawer {
  margin: 0 0 0 auto;
  border-radius: 14px 0 0 14px;
  width: min(620px,100vw);
  height: 100dvh;
  max-height: 100dvh;
}

.dialog-head {
  padding: 19px 21px;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.dialog-head h2 {
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.drawer .dialog-head {
  background: #f6f9f6;
  position: relative;
}

.detail-identity {
  display: flex;
  gap: 11px;
  align-items: center;
  min-width: 0;
}

.detail-identity .avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.detail-identity p {
  font-size: .83rem;
  color: var(--secondary);
  margin-top: 4px;
}

.detail-tabs {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.detail-tabs button {
  flex: 0 0 auto;
  padding: 13px 2px;
  color: var(--secondary);
  border-bottom: 2px solid transparent;
  font-size: .87rem;
  font-weight: 600;
}

.detail-tabs button[aria-selected=true] {
  color: var(--teal);
  border-color: var(--teal);
}

.detail-body,.form-body {
  padding: 20px 21px;
}

.form-body,.detail-body {
  display: grid;
  gap: 16px;
}

.section-block {
  border-bottom: 1px solid var(--line);
  padding-bottom: 17px;
  min-width: 0;
}

.section-block:last-child {
  border-bottom: 0;
}

.section-block h3 {
  margin-bottom: 10px;
}

.section-heading {
  margin-bottom: 9px;
}

.section-heading h3 {
  margin: 0;
}

.section-block p {
  font-size: .9rem;
}

.creative-heading, .creative-card-head, .creative-summary, .creative-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.creative-heading { margin-bottom: 14px; }
.creative-heading h2 { font-size: 1.15rem; }
.creative-summary {
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green-light);
}
.creative-summary p, .creative-meta { color: var(--secondary); font-size: .83rem; }
.creative-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.creative-card-head h3 { font-size: 1rem; }
.creative-card-head + .creative-meta { margin-top: -6px; }
.creative-thumbnail {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
}
.creative-description, .creative-points, .creative-evidence { font-size: .91rem; }
.creative-points { border-left: 3px solid var(--teal); padding-left: 12px; }
.creative-points h4, .creative-evidence h4 { margin-bottom: 4px; }
.creative-evidence summary { color: var(--teal); cursor: pointer; font-weight: 600; }
.creative-evidence .data-list { margin: 12px 0; }
.creative-evidence li + li { margin-top: 8px; }
.creative-evidence ul { padding-left: 22px; }
.creative-manage { border-top: 1px solid var(--line); padding-top: 12px; }
.creative-resolution { display: grid; gap: 8px; min-width: 0; }
#editor:has(.creative-viewer) { width: min(1120px, 96vw); }
.creative-viewer { display: flex; flex-direction: column; min-height: 0; }
.creative-tools { flex: none; padding: 8px 16px; }
.creative-canvas { overflow: auto; min-height: 0; background: var(--canvas); }
.creative-full-image { display: block; width: 100%; height: auto; margin: auto; }
.creative-canvas.actual-size .creative-full-image { width: auto; max-width: none; }
@media (max-width: 520px) {
  .detail-tabs { gap: 12px; padding-inline: 12px; }
  .creative-card { padding: 12px; }
  .creative-heading .button, .creative-card .button { min-height: 42px; }
}

.tags {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.callout {
  padding: 12px 14px;
  background: #f1f6f2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.callout.amber {
  background: #fcf4e4;
  border-color: #ead9b4;
}

.callout p {
  font-size: .86rem;
}

.data-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(90px,33%) minmax(0,1fr);
  gap: 9px 12px;
  font-size: .87rem;
}

.data-list dt {
  color: var(--secondary);
}

.data-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: .85rem;
}

.ref-list li {
  overflow-wrap: anywhere;
}

.ref-list small {
  display: block;
  color: var(--secondary);
  margin-top: 2px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.timeline li {
  padding: 0 0 13px 14px;
  border-left: 2px solid #d1e4d7;
  min-width: 0;
}

.timeline p {
  font-size: .89rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.timeline small {
  display: block;
  color: var(--secondary);
  font-size: .76rem;
}

.timeline h4 {
  font-size: .88rem;
  margin: 0 0 3px;
}

.timeline li .small-btn {
  margin-top: 6px;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 600;
}

.field small,.form-hint,.muted {
  color: var(--secondary);
  font-size: .81rem;
  font-weight: 400;
  line-height: 1.45;
}

.fields {
  display: grid;
  gap: 13px;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
  font-size: .86rem;
}

.check input {
  flex: none;
  margin-top: 2px;
}

.form-footer {
  padding: 14px 21px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #f7f9f7;
}

.form-error:not(:empty) {
  padding: 10px 12px;
  background: #fbedeb;
  color: #853b32;
  border-radius: 6px;
  font-size: .88rem;
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: #163d33;
  color: white;
  border-radius: 8px;
  padding: 10px 15px;
  box-shadow: 0 3px 18px #143a3524;
  font-size: .89rem;
  max-width: 90vw;
}

.toast:empty {
  display: none;
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg,#e1eee4,#f4f7f4 70%);
}

.auth-card {
  width: min(410px,100%);
  padding: 29px;
  display: grid;
  gap: 17px;
  border-radius: 13px;
  background: white;
  border: 1px solid var(--line);
}

.auth-card img {
  width: 54px;
}

.auth-card h1 {
  font-size: 1.75rem;
}

.auth-card p {
  color: var(--secondary);
  font-size: .9rem;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-actions button {
  font-size: .85rem;
}

@media(min-width:1450px) {
  .shell {
    grid-template-columns: 240px minmax(0,1fr);
  }
  .metric {
    padding: 20px 23px;
  }
  td {
    padding-top: 13px;
    padding-bottom: 13px;
  }
  .work-body {
    padding-top: 40px;
  }
}

@media(max-width:1150px) {
  .shell {
    grid-template-columns: 194px minmax(0,1fr);
  }
  .rail {
    padding-left: 9px;
    padding-right: 9px;
  }
  .work-body {
    padding-left: 23px;
    padding-right: 23px;
  }
  .topbar {
    padding-left: 23px;
    padding-right: 23px;
  }
  .metrics {
    gap: 9px;
  }
  .metric {
    padding: 13px;
  }
  .metric-cap {
    font-size: .83rem;
  }
  .metric-icon {
    width: 26px;
    height: 26px;
  }
  .biz .avatar {
    display: none;
  }
  th,td {
    padding-left: 8px;
    padding-right: 8px;
  }
  .next-cell {
    max-width: 180px;
  }
}

@media(max-width:850px) {
  .shell {
    grid-template-columns: minmax(0,1fr);
  }
  .rail {
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    width: 232px;
    transition: transform .16s;
  }
  .shell.menu-open .rail {
    transform: translateX(0);
  }
  .shell.menu-open .rail-backdrop {
    display: block;
    background: #142a275c;
    position: fixed;
    inset: 0;
    z-index: 3;
  }
  .mobile-menu {
    display: inline-flex!important;
  }
  .topbar {
    height: 54px;
  }
  .crumb {
    gap: 8px;
  }
  .metrics {
    gap: 9px;
  }
  .nav {
    margin-top: 36px;
  }
  .breakdown {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .brand {
    padding-left: 12px;
  }
}

@media(max-width:650px) {
  .work-body {
    padding: 22px 13px 32px;
  }
  .topbar {
    padding: 0 13px;
  }
  .environment {
    font-size: .7rem;
    gap: 4px;
  }
  .crumb .workspace-label,.crumb .slash {
    display: none;
  }
  .heading {
    gap: 10px;
    margin-bottom: 17px;
    align-items: flex-start;
  }
  .heading p {
    font-size: .85rem;
  }
  .heading h1 {
    font-size: 1.75rem;
  }
  .heading .button {
    font-size: .78rem;
    padding: 7px 10px;
    min-height: 35px;
  }
  .metrics {
    grid-template-columns: repeat(2,minmax(0,1fr));
    margin-bottom: 12px;
  }
  .metric {
    padding: 11px 13px;
  }
  .metric-value {
    font-size: 2rem;
  }
  .metric small {
    font-size: .73rem;
  }
  .pipeline {
    margin-bottom: 16px;
  }
  .pipeline summary {
    padding: 12px;
  }
  .summary-caption {
    display: none;
  }
  .breakdown {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .panel-head {
    padding: 16px 13px 12px;
  }
  .tools {
    padding: 0 13px 12px;
    gap: 8px;
  }
  .search {
    flex-basis: 100%;
    max-width: none;
  }
  .filters {
    width: 100%;
  }
  .filters select {
    flex: 1;
    min-width: 0;
    max-width: none;
  }
  .table-wrap {
    overflow: visible;
  }
  table,tbody {
    display: block;
  }
  thead {
    display: none;
  }
  tbody tr {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 5px 9px;
    border-top: 1px solid var(--line);
    padding: 12px 13px;
  }
  td,th,td:first-child,td:last-child {
    padding: 0;
    border: 0;
  }
  .biz strong {
    font-size: .9rem;
  }
  .biz small {
    font-size: .76rem;
  }
  .stage-cell {
    text-align: right;
  }
  .owner-cell {
    grid-column: 1;
    grid-row: 2;
    padding-left: 0;
  }
  .next-cell {
    grid-column: 1/-1;
    max-width: none;
  }
  .next-text {
    font-size: .78rem;
  }
  .row-chevron {
    display: none;
  }
  .pagination {
    padding: 10px 13px;
  }
  .drawer {
    width: 100vw;
    border-radius: 0;
  }
  .dialog-head,.detail-body,.form-body {
    padding: 16px;
  }
  .drawer .dialog-head {
    padding-top: 20px;
  }
  .pair {
    grid-template-columns: 1fr;
  }
  .settings-card {
    padding: 16px;
  }
  .people-cards {
    grid-template-columns: 1fr;
  }
  .profile-btn {
    margin-bottom: 8px;
  }
  .settings-card>form {
    align-items: stretch;
    flex-direction: column;
  }
  .section-heading {
    gap: 7px;
  }
  .brand .logo-tile img {
    width: 37px;
  }
}

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

@media(max-width:850px) {
  .rail {
    visibility: hidden;
    transition: none;
  }
  .shell.menu-open .rail {
    visibility: visible;
  }
}

#editor[open]:has(>form) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#editor>.dialog-head {
  flex: none;
}

#editor>form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#editor .form-body {
  overflow: auto;
  min-height: 0;
}

#editor .form-footer {
  flex: none;
}

.fields>h3 {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

@media(min-width:1050px) {
  .breakdown {
    grid-template-columns: repeat(7,minmax(0,1fr));
    gap: 0;
    padding: 5px 4px 10px;
  }
  .breakdown button {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    border-radius: 0;
    background: white;
    padding: 5px 12px;
    line-height: 1.25;
  }
  .breakdown button+button {
    border-left: 1px solid var(--line);
  }
  .breakdown button b {
    font-size: 1.2rem;
    line-height: 1;
    font-weight: 600;
  }
  .breakdown button span {
    font-size: .76rem;
    color: var(--secondary);
  }
}
