/* ===========================================================================
   Settings
   =========================================================================== */


/* Three tabs, then the tab's sections, each a container on the page grey as
   the drawers' .ovbox is: a 16px radius, a faint edge, the softest shadow,
   12px apart. Inside, rows split by hairlines, nothing boxed again; the stat
   tiles are the visual itself and stay. */
.setstack { display: flex; flex-direction: column; gap: 12px }

/* Settings fills the width beside the nav, as Your profile does: by laying a
   tab's containers out in columns, never by widening them. A tab's stack is
   columns of containers (.setcol), each column a stack of its own, so a
   container that grows while it is edited pushes down only what is under it
   and nothing jumps from one column to the next. One column on a phone, two
   from 1000px of page, and three from 1700px where the tab has a third stack
   (.setcol--foot, which lies across the bottom while there are two). The
   columns measure the page, not the window: the display scale zooms the
   body, so the window's width is not the layout's. */
.settingspage { container: setpage / inline-size }
.setcols { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start }
.setcol { display: flex; flex-direction: column; gap: 12px; min-width: 0 }
@container setpage (min-width: 1000px) {
  .setcols { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  /* Where the second column holds the long thing (the pipeline's steps) it
     gets the room, three parts to the first's two: the pipeline's editor
     lays a step out on one line from 600px. */
  .setcols--lean { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) }
  .setcol--foot { grid-column: 1 / -1 }
  /* Two columns that end level: in the shorter, the container marked to
     grow (.setgrow) takes up the difference, so no grey is left at the seam. */
  .setcols--level { align-items: stretch }
  .setcols--level .setgrow { flex: 1 0 auto }
}
@container setpage (min-width: 1700px) {
  /* The foot is the third column, as tall as what it holds; the first two
     still end level with each other. */
  .setcols:has(> .setcol--foot) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) minmax(0, 2fr) }
  .setcol--foot { grid-column: auto; align-self: start }
}
.settingspage .card,
.settingspage .tablecard {
  border: 1px solid rgba(16, 33, 31, .07); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 33, 31, .04);
}
.settingspage .card { padding: 22px 24px }
/* A section of one switch has no last hairline under it. */
.settingspage .card > .notif--btn:last-child { background-image: none }

/* Ideal customer: icon, label, value, one row each. */
.setrows { display: flex; flex-direction: column }
.setrow {
  display: grid; grid-template-columns: 20px 92px minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--hair);
}
.setrow:first-child { border-top: 0; padding-top: 0 }
.setrow__icon { font-size: 18px; color: var(--muted) }
.setrow__label { font-size: 12.5px; font-weight: 500; color: var(--muted) }
.setrow__value { font-size: 14px; line-height: 1.5; color: var(--text); text-wrap: pretty }
.setrow__value[data-none="true"] { color: var(--muted) }
.setrow .input { width: 100%; box-sizing: border-box }
@media (max-width: 560px) {
  .setrow { grid-template-columns: 20px minmax(0, 1fr); row-gap: 6px }
  .setrow > :last-child { grid-column: 2 }
}

/* Pain points: the name, its weight in coloured words, why it matters, and
   who owns it at a customer. */
.setpp { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-top: 1px solid var(--hair) }
.setpp:first-child { border-top: 0; padding-top: 0 }
.setpp__top { display: flex; align-items: center; gap: 12px }
.setpp__name { flex: 1; min-width: 0; font-size: 15px; font-weight: 500 }
.setpp__weight { flex: none; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap }
.setpp__weight[data-weight="primary"] { color: var(--good) }
.setpp__weight[data-weight="high"] { color: var(--text) }
.setpp__desc { font-size: 14px; line-height: 1.55; color: var(--muted); text-wrap: pretty }
.setpp__owners { display: flex; align-items: center; gap: 6px; font-size: 13px }
.setpp__owners .ms { font-size: 16px; color: var(--muted) }
label.setpp__owners .input { flex: 1; min-width: 0 }
.setpp__nameinput { flex: 1; min-width: 0 }
.setpp__weightpick { flex: 0 0 120px; width: 120px }
.setpp .textarea { width: 100%; box-sizing: border-box }
.setadd { margin-top: 14px }

/* An empty section: its mark and a word, and the way to fill it. */
.setnone { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted) }
.setnone .ms { font-size: 20px }
.setnone .btn { margin-left: auto }
/* Key business stats. Both fields edit in place — the card *is* the form. */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px }
.statcard { position: relative; background: var(--page); border-radius: 16px; padding: 20px }
.statcard__x {
  position: absolute; top: 12px; right: 12px; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: var(--r-pill);
  font-size: 16px; color: var(--muted); cursor: pointer;
  border: none; background: transparent; padding: 0; font-family: inherit;
}
.statcard__x:hover { background: var(--card); color: #C0362C }
.statcard__stat {
  width: 100%; border: none; background: transparent; font-family: inherit;
  font-size: 26px; font-weight: var(--weight-strong); letter-spacing: -.02em; line-height: 1.1;
  color: var(--text); padding: 0 30px 0 0; margin-bottom: 8px; outline: none;
}
.statcard__text {
  width: 100%; border: none; background: transparent; resize: none; font-family: inherit;
  font-size: 13px; line-height: 1.6; color: var(--muted); padding: 0; outline: none;
}

/* Font upload row on the Branding tab. */
.ob__font {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 1.5px dashed #C9C9C9; border-radius: 12px; padding: 12px 14px;
  cursor: pointer; background: var(--card); font-family: inherit; text-align: left;
}
.ob__font:hover { border-color: var(--teal) }
.ob__font .ms { font-size: 20px; color: var(--muted) }
.ob__font .ob__font-ok { color: #12A57A }

/* A card whose content is a table, so the head keeps its padding but the rows
   run edge to edge. Shared by the do not send list and Invoices. */
.tablecard {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden;
}
.tblhead { display: flex; align-items: center; gap: 12px; padding: 22px 26px; flex-wrap: wrap }
.tblhead h3 { margin: 0; font-size: 17px; font-weight: var(--weight-strong) }

.strow {
  display: grid; grid-template-columns: 2fr 1.1fr 1.4fr .8fr; gap: 14px;
  align-items: center; padding: 15px 26px; border-bottom: 1px solid var(--hair);
  font-size: 13px;
}
.strow--head {
  padding: 12px 26px; background: var(--page);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: var(--weight-strong); color: var(--muted);
}
.strow__who {
  min-width: 0; font-size: 13.5px; font-weight: var(--weight-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* The address under a name, or a note under a reason. */
.strow__sub {
  display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Billing */
.billhero {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--on-ink);
  border-radius: var(--r-card); padding: 30px 32px;
}
.billhero__inner {
  position: relative; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.billhero__plan { font-size: 30px; font-weight: var(--weight-strong); letter-spacing: -.03em }
.billhero__sub { font-size: 13.5px; color: color-mix(in srgb, var(--on-ink) 82%, transparent); margin-top: 8px }
.billhero__acts { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto }

/* Two buttons that only ever sit on the dark hero. */
.btn--accent { background-color: var(--teal); color: var(--on-teal) }
/* The colour is repeated here on purpose. This button is an anchor now (the
   plan enquiry is a mailto), and the global `a:hover` recolour outranks the
   plain .btn--accent rule — without restating it the label turns coral on
   hover while the pill stays teal. */
.btn--accent:hover:not(:disabled) { background-color: color-mix(in srgb, var(--teal) 86%, var(--on-teal)); color: var(--on-teal); opacity: 1 }

/* Log out, on Your profile. */
.btn--danger { color: #C0362C }
.btn--danger:hover:not(:disabled) { border-color: color-mix(in srgb, #C0362C 45%, transparent); background-color: color-mix(in srgb, #C0362C 5%, var(--card)) }

/* Your profile: daily send cap and notification rows. */
.capline { font-size: 13.5px; font-weight: var(--weight-strong); margin-bottom: 10px }
.capout { flex: 0 0 78px; text-align: right; font-size: 14.5px; font-weight: var(--weight-strong) }
.capnote { margin-top: 12px; font-size: 11.5px; line-height: 1.5; color: var(--muted) }

.notif {
  display: flex; align-items: center; gap: 16px;
  background: var(--page); border-radius: 16px; padding: 16px 18px; cursor: pointer;
}
.notif__label { font-size: 13.5px; font-weight: var(--weight-strong) }
.notif__hint { font-size: 12.5px; color: var(--muted); margin-top: 3px }
/* A row that is itself the control (Settings' switches). */
.notif--btn {
  width: 100%; min-height: 44px; border: 1px solid transparent;
  font: inherit; color: inherit; text-align: left;
}
.notif--btn:hover { border-color: var(--line) }
.notif--btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px }
.notif__icon { font-size: 20px; color: var(--muted); flex: 0 0 auto }
/* An org-wide switch a member can see but only an admin can change. */
.notif--btn:disabled { cursor: default }
.notif--btn:disabled .switch { opacity: .5 }
.notif__lock { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; font-size: 12.5px; font-weight: 500; color: var(--muted) }
.notif__lock .ms { font-size: 16px }
.notif--btn:disabled:hover { background: none }
