.account-page {
  width: min(100%, 68rem);
  margin-inline: auto;
  display: grid;
  gap: 1.25rem;
}

.account-page h1, .account-page h2, .account-page h3, .account-page h4 {
  margin: 0;
}

.guide-entry {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.guide-entry .agency-icon, .guide-topic .agency-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}

.guide-page {
  max-width: 43rem;
  gap: .85rem;
}

.guide-topic {
  display: block;
  padding: 0;
}

.guide-topic summary {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1rem;
  border-radius: inherit;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.guide-topic summary::-webkit-details-marker { display: none; }
.guide-topic summary::after {
  content: '';
  width: .5rem;
  height: .5rem;
  margin-inline-start: auto;
  border: solid var(--leaf);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.guide-topic[open] summary::after { transform: rotate(225deg); }
.guide-topic summary:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }

.guide-content {
  display: grid;
  gap: .85rem;
  padding: .85rem 1rem 1rem;
  border-top: 1px solid var(--border);
}
.guide-content h2 { margin-bottom: .25rem; font-size: 1rem; }

.account-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}

.account-panel {
  display: grid;
  align-content: start;
  gap: .85rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid #d9d0b5;
  border-radius: 1rem;
  background: #fffdf4;
  color: #342c1e;
  min-width: 0;
}

.account-form {
  display: grid;
  align-content: start;
  gap: .75rem;
}

.account-field {
  display: grid;
  gap: .3rem;
  font-weight: 600;
}

.account-field[hidden], .account-feedback:empty {
  display: none;
}

.account-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #a99f80;
  border-radius: .55rem;
  background: #fffefa;
  color: inherit;
  padding: .65rem .8rem;
  font: inherit;
}

.account-button {
  border: 1px solid #989b66;
  border-radius: .55rem;
  min-height: 2.75rem;
  justify-self: start;
  background: #fffdf5;
  color: #34371c;
  padding: .55rem .85rem;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}

.account-button:hover {
  background: #f4f1df;
}

.account-button:focus-visible, .account-field input:focus-visible, .agency-check input:focus-visible {
  outline: 2px solid #4d632b;
  outline-offset: 2px;
}

.account-button:disabled {
  opacity: .65;
  cursor: wait;
}

.account-primary {
  background: #546b34;
  border-color: #546b34;
  color: #fffef4;
}

.account-primary:hover {
  background: #455a28;
}

.account-note, .account-feedback {
  margin: 0;
  color: #625744;
  line-height: 1.55;
  font-size: .925rem;
}

.account-connection {
  justify-self: start;
  margin: 0;
  border: 1px solid #d8debf;
  border-radius: 99px;
  padding: .2rem .65rem;
  background: #f4f3e9;
  color: #514c3c;
  font-size: .84rem;
  font-weight: 650;
  line-height: 1.55;
}

.account-connection--online {
  background: #e9f1dc;
  color: #315126;
}

.account-connection--offline {
  border-color: #ded0ad;
  background: #fbf2d8;
  color: #664823;
}

.account-google {
  display: grid;
  gap: .5rem;
}

.account-google-button {
  max-width: 100%;
  white-space: normal;
}

.account-login-separator {
  margin: .25rem 0 0;
  padding-top: .7rem;
  border-top: 1px solid #e1d8bf;
  color: #625744;
  font-size: .9rem;
}

.account-feedback {
  color: #763b23;
  overflow-wrap: anywhere;
}

.account-feedback-success {
  color: #315126;
}

.account-display-name {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
}

.account-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: .85rem;
}

.account-product {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: .65rem;
  background: #f8f4e5;
  border: 1px solid #e0d8bf;
  padding: 1rem;
  border-radius: .8rem;
}

.account-price {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.account-tag {
  display: inline-block;
  border-radius: 99px;
  padding: .24rem .6rem;
  font-size: .85rem;
  color: #314622;
  background: #ecf2db;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.account-payment-pending {
  display: grid;
  gap: .55rem;
  padding: .7rem .85rem;
  border: 1px solid #ded0ad;
  border-radius: .65rem;
  background: #fbf2d8;
  color: #664823;
}

.account-payment-pending p {
  margin: 0;
}

.account-payment-pending .account-button {
  max-width: 100%;
  white-space: normal;
}

.account-coupon-form {
  width: min(100%, 37rem);
}

.account-coupon-form[hidden] {
  display: none;
}

.account-coupon-form input {
  letter-spacing: .035em;
}

@media (min-width: 45rem) {
  .account-coupon-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .account-coupon-form .account-button {
    max-width: 100%;
  }
}

.account-youtube-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: .5rem .75rem;
  gap: .45rem .75rem;
  border: 1px solid #e5dcc0;
  border-radius: .65rem;
  background: #fff9e9;
}

.account-youtube-counts[hidden], .account-sync-status:empty, .account-analytics-status:empty {
  display: none;
}

.account-youtube-grant {
  max-width: 100%;
  white-space: normal;
}

.account-youtube-counts dt {
  color: #625744;
  font-size: .85rem;
}

.account-youtube-counts dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.account-sync-status {
  margin: 0;
  padding: .45rem .6rem;
  border-radius: .55rem;
  background: #f2eedb;
  color: #594a2f;
  font-size: .9rem;
}

.account-sync-status[data-state='success'] {
  background: #e9f1dc;
  color: #315126;
}

.account-sync-status[data-state='error'] {
  background: #f9ece1;
  color: #763b23;
}

.account-classification {
  border: 1px solid #e5dcc0;
  border-radius: .65rem;
  background: #fff9e9;
  min-width: 0;
}

.account-classification summary {
  min-height: 2.75rem;
  padding: .56rem .7rem;
  cursor: pointer;
  color: #344d24;
  font-weight: 700;
}

.account-classification > :not(summary) {
  margin-inline: .7rem;
  margin-bottom: .7rem;
}

.account-classification-status:empty {
  display: none;
}

.account-classification-content,
.account-classification-group,
.account-classification-list {
  display: grid;
  gap: .6rem;
  min-width: 0;
}

.account-classification-group {
  border-top: 1px solid #e8ddbd;
  padding-top: .65rem;
}

.account-classification-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-classification-row {
  display: grid;
  gap: .5rem;
  padding: .6rem;
  background: #fffdf7;
  border: 1px solid #e6dcc2;
  border-radius: .58rem;
}

.account-classification-video {
  display: grid;
  justify-items: start;
  gap: .2rem;
}

.account-video-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-classification-controls,
.account-classification-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
}

.account-classification-pagination {
  justify-content: space-between;
  font-size: .84rem;
}

.account-classification .account-button {
  max-width: 100%;
  padding: .35rem .55rem;
  font-size: .825rem;
  white-space: normal;
}

.agency-code {
  color: #34371c;
  font-weight: 750;
  font-size: 1.05rem;
  letter-spacing: .03em;
  overflow-wrap: anywhere;
}

.agency-sharing-group {
  min-width: 0;
  border: 1px solid #dfd7bd;
  border-radius: .55rem;
  padding: .5rem .75rem;
}

.agency-sharing-group legend {
  font-weight: 700;
}

.agency-check {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  gap: .5rem;
  overflow-wrap: anywhere;
}

.agency-check input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #546b34;
  flex: none;
}

.agency-page {
  --agency-border: #e0d2ac;
  --agency-ink: #47321d;
  --agency-muted: #6c5940;
  --agency-green: #587434;
  --agency-paper: #fffaf0;
  --agency-shadow: 0 3px 10px #6f4f1b15;
  width: min(100%, 92rem);
  color: var(--agency-ink);
}

.agency-title h1 {
  letter-spacing: .04em;
}

body[data-page='agency'] .agency-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.agency-workspace {
  display: grid;
  grid-template-columns: minmax(9rem, .55fr) minmax(0, 4fr);
  align-items: start;
  gap: .85rem;
  min-width: 0;
}

.agency-side,
.agency-panel {
  min-width: 0;
  border: 1px solid var(--agency-border);
  border-radius: 1rem;
  background-color: var(--agency-paper);
  box-shadow: var(--agency-shadow);
}

.agency-side {
  display: grid;
  gap: .35rem;
  align-content: start;
  padding: 1rem .65rem 4.3rem;
  background-image: url('./assets/flowers.webp'), linear-gradient(155deg, #fff9ef, #fcf3de);
  background-size: 31rem auto, 100% 100%;
  background-repeat: no-repeat;
  background-position: bottom left;
}

.agency-organization {
  padding: .2rem .55rem .65rem;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.agency-nav-button {
  max-width: none;
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  min-height: 2.75rem;
  padding: .4rem .5rem;
  background: transparent;
  color: var(--agency-ink);
  border: 1px solid transparent;
  border-radius: .65rem;
  text-align: left;
  white-space: normal;
}

.agency-nav-button[aria-current='page'] {
  background: linear-gradient(110deg, #e5edb7, #f4f4d8);
  color: #38511f;
}

.agency-nav-button:hover {
  background: #f4ebcf;
}

.agency-icon {
  flex: none;
  display: block;
  width: 1.4rem;
  height: 1.4rem;
}

.agency-heading-label {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.agency-heading-label .agency-icon {
  width: 1.65rem;
  height: 1.65rem;
}

.agency-content,
.agency-dashboard,
.agency-panel,
.agency-selected-content {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: .85rem;
}

.agency-panel {
  padding: clamp(.9rem, 2vw, 1.25rem);
  background-image: linear-gradient(170deg, #fffaf0, #fffcf5);
}

.agency-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding-bottom: .75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #ebdfc0;
}

.agency-panel-heading h2 {
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  letter-spacing: .025em;
}

.agency-roster,
.agency-details {
  background-image: url('./assets/leaves.webp'), linear-gradient(169deg, #fffaf0, #fffcf6);
  background-repeat: no-repeat;
  background-position: top right;
  background-size: 7rem auto, 100% 100%;
}

.agency-roster {
  grid-template-rows: auto auto 1fr;
}

.agency-roster-flowers {
  display: block;
  width: 100%;
  max-width: 45rem;
  height: auto;
  justify-self: center;
  align-self: end;
}

.agency-scope {
  display: inline-flex;
  border: 1px solid #e5d8b5;
  border-radius: 3rem;
  background: #fff9e8;
  color: #60503a;
  padding: .26rem .6rem;
  font-size: .8rem;
  white-space: nowrap;
}

.agency-empty {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: .9rem;
  padding-top: .75rem;
}

.agency-table-box {
  min-width: 0;
  overflow: auto;
  border: 1px solid #e8d9af;
  border-radius: .7rem;
  background: #fffdf8;
}

.agency-table {
  table-layout: auto;
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-size: .88rem;
}

.agency-table th,
.agency-table td {
  padding: .55rem .38rem;
  border-bottom: 1px solid #e9ddbf;
  white-space: nowrap;
}

.agency-table th:first-child,
.agency-table td:first-child {
  padding-left: .6rem;
}

.agency-table th:last-child,
.agency-table td:last-child {
  padding-right: .6rem;
}

.agency-table th {
  background: #f4ead0;
  color: #5c421f;
  letter-spacing: .01em;
}

.agency-table tr:last-child td {
  border-bottom: 0;
}

.agency-table .agency-selected td {
  background: #eff1d5;
}

.agency-cell-value {
  display: block;
  max-width: min(15vw, 10rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

.agency-member-button {
  width: 100%;
  max-width: none;
  min-height: 2.85rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-color: transparent;
  background: transparent;
  border-radius: .5rem;
  padding: .2rem;
  text-align: left;
  color: var(--agency-ink);
}

.agency-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid #c8c995;
  border-radius: .5rem;
  background: linear-gradient(135deg, #ecedc8, #dce6bd);
  color: #485c2d;
  font-weight: 750;
}

.agency-table tr:nth-child(3n + 2) .agency-avatar {
  border-color: #e0c5ad;
  background: linear-gradient(135deg, #f7e2cb, #ecd1c3);
  color: #6a4938;
}

.agency-table tr:nth-child(3n) .agency-avatar {
  border-color: #d6c8d4;
  background: linear-gradient(135deg, #efe3ee, #e6daee);
  color: #5d486c;
}

.agency-member-name {
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 750;
}

.agency-share-pill {
  display: inline-block;
  border: 1px solid #e8d6ac;
  border-radius: 2rem;
  background: #fff7e1;
  color: #6a512c;
  padding: .12rem .48rem;
  font-weight: 650;
  font-size: .77rem;
}

.agency-share-pill.agency-shared {
  border-color: #d5dfaa;
  background: #f1f7d9;
  color: #425a28;
}

.agency-details {
  scroll-margin-top: 5rem;
}

.agency-selected-name {
  margin: 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.agency-detail-card {
  display: grid;
  gap: .7rem;
  padding: .75rem .75rem 1rem;
  border: 1px solid #e5d8b2;
  border-radius: .85rem;
  background: #fff7e5;
  overflow-wrap: anywhere;
}

.agency-detail-card.agency-collab-detail {
  background: #fbf9e7;
}

.agency-ribbon {
  justify-self: center;
  padding: .22rem .8rem;
  background: linear-gradient(105deg, #f0c5a3, #f8ddbd, #f3c5a3);
  box-shadow: inset 0 0 0 1px #dea886;
  border-radius: .35rem .35rem .6rem .6rem;
  color: #543526;
  text-align: center;
}

.agency-collab-detail .agency-ribbon {
  background: linear-gradient(105deg, #dce7aa, #eff2cf, #d9e4a4);
  box-shadow: inset 0 0 0 1px #c2ce91;
  color: #3e5128;
}

.agency-detail-list {
  display: grid;
  gap: .4rem;
  margin: 0;
  padding-inline-start: 1.2rem;
}

.agency-detail-list li::marker {
  color: #596e35;
}

.agency-stats-option {
  min-height: 2.75rem;
  padding: .4rem .7rem;
  border: 1px solid #e2d7b6;
  border-radius: .65rem;
  background: #f5f2de;
}

@media (min-width: 66rem) {
  .agency-workspace {
    grid-template-columns: minmax(10.5rem, .75fr) minmax(0, 4fr);
  }

  .agency-dashboard {
    grid-template-columns: minmax(0, 2.35fr) minmax(13rem, 1fr);
    align-items: stretch;
  }

  .agency-side,
  .agency-roster,
  .agency-details {
    min-height: 32rem;
  }

  .agency-side,
  .agency-details {
    padding-bottom: 5.75rem;
  }

  .agency-details {
    background-image: url('./assets/leaves.webp'), url('./assets/flowers.webp'), linear-gradient(169deg, #fffaf0, #fffcf6);
    background-position: top right, bottom right, center;
    background-repeat: no-repeat;
    background-size: 7rem auto, max(100%, 31rem) auto, 100% 100%;
  }
}

@media (max-width: 46rem) {
  .agency-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .agency-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    padding: .45rem .55rem;
    background-size: 0, 100% 100%;
  }

  .agency-organization {
    width: 100%;
    padding: .35rem .45rem;
  }

  .agency-nav-button {
    width: auto;
    padding-inline: .35rem;
    gap: .25rem;
    font-size: .875rem;
  }

  .agency-nav-button .agency-icon {
    width: 1.15rem;
    height: 1.15rem;
  }

  .agency-panel {
    min-width: 0;
  }

  .agency-table-box {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .agency-table, .agency-table tbody, .agency-table td {
    display: block;
    width: 100%;
  }

  .agency-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .agency-table tbody {
    display: grid;
    gap: .65rem;
  }

  .agency-table tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: .3rem .55rem .55rem;
    border: 1px solid #e4d5b0;
    border-radius: .75rem;
    background: #fffdf6;
  }

  .agency-table tr.agency-selected {
    background: #eff1d5;
    border-color: #c4cf94;
  }

  .agency-table td,
  .agency-table td:first-child,
  .agency-table td:last-child {
    padding: .3rem;
    border: 0;
    white-space: normal;
  }

  .agency-table td:first-child {
    grid-column: 1/-1;
    border-bottom: 1px solid #e2d9b9;
  }

  .agency-table td:nth-last-child(-n+2) {
    grid-column: span 2;
  }

  .agency-table td[data-label]::before {
    display: block;
    content: attr(data-label);
    color: var(--agency-muted);
    font-size: .74rem;
  }

  .agency-cell-value,
  .agency-member-name {
    max-width: none;
    overflow-wrap: anywhere;
  }

  .agency-details {
    scroll-margin-top: 5rem;
  }
}
