/*
 * Site2image additions on top of the Dashmin theme.
 * Dashmin itself lives in dashmin.css.
 */

.dm-masthead-account {
  grid-template-columns: 1fr auto;
}

.dm-mast-actions .button_to,
.dm-nav-footer .button_to {
  margin: 0;
}

.dm-nav-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-user-btn .name {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu {
  position: relative;
}

.account-menu > summary {
  list-style: none;
  cursor: pointer;
}

.account-menu > summary::-webkit-details-marker {
  display: none;
}

.account-menu > summary .bi-chevron-down {
  font-size: 0.7rem;
  color: var(--dm-text-muted);
}

.account-menu > summary:focus-visible {
  outline: 2px solid var(--dm-primary);
  outline-offset: 2px;
}

.account-menu-panel {
  position: absolute;
  z-index: 40;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 13.5rem;
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid var(--dm-border);
  background: var(--dm-surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
}

.account-menu-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--dm-text);
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.account-menu-link:hover,
.account-menu-link[aria-current="page"] {
  background: var(--dm-primary-muted);
  color: var(--dm-heading);
}

.account-menu-form {
  margin: 0;
}

.account-menu-divider {
  height: 1px;
  margin: 0.3rem 0.35rem;
  background: var(--dm-border);
}

@media (max-width: 767.98px) {
  .account-menu .name {
    display: none;
  }
}

.api-token {
  display: block;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--dm-surface-2);
  border: 1px solid var(--dm-border);
  color: var(--dm-heading);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-all;
}

.alert {
  border-radius: 12px;
}

.admin-period-dates input[type="date"] {
  width: 11.5rem;
}

.admin-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.dm-card .table td:last-child {
  white-space: nowrap;
  width: 1%;
}

.admin-actions .button_to {
  margin: 0;
}

.dm-card .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--dm-text);
  --bs-table-border-color: var(--dm-border);
  margin-bottom: 0;
}

.dm-card .table thead th {
  color: var(--dm-text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.screenshot-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.screenshot-toolbar .form-control {
  width: min(100%, 28rem);
}

.screenshot-sort {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.screenshot-sort:hover {
  color: var(--dm-heading);
}

.screenshot-source {
  display: block;
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-usage {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr;
  gap: 0.85rem 1rem;
  margin: 0;
}

.token-usage dt,
.token-usage dd {
  margin: 0;
}

.token-usage dt {
  color: var(--dm-text-muted);
}

.token-usage dd {
  font-weight: 650;
  color: var(--dm-heading);
}

@media (max-width: 575px) {
  .token-usage {
    grid-template-columns: 1fr;
    gap: 0.2rem 0;
  }

  .token-usage dd {
    margin-bottom: 0.65rem;
  }
}

.screenshot-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--dm-border);
}

.lang-switch {
  position: relative;
}

.lang-switch > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--dm-border);
  background: transparent;
  color: var(--dm-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lang-switch > summary::-webkit-details-marker {
  display: none;
}

.lang-switch-menu {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 11rem;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--dm-border);
  background: var(--dm-surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.lang-switch-menu a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  color: var(--dm-text);
  text-decoration: none;
  font-weight: 600;
}

.lang-switch-menu a[aria-current="true"],
.lang-switch-menu a:hover {
  background: var(--dm-primary-muted);
  color: var(--dm-heading);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(var(--plan-count, 4), minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 991px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }
}

.plan-card {
  display: flex;
  flex-direction: column;
}

.plan-card .dm-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
}

.plan-card .btn {
  margin-top: auto;
  align-self: stretch;
  text-align: center;
}

.plan-price {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--dm-heading);
}

.plan-features {
  margin: 0;
  padding-left: 1.1rem;
}

.plan-period {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--dm-border);
  background: var(--dm-surface-2);
}

.plan-period button {
  border: 0;
  background: transparent;
  color: var(--dm-text);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-weight: 650;
}

.plan-period button.active {
  background: var(--dm-primary);
  color: #fff;
}

.plan-checkout__buttons {
  display: grid;
  gap: 0.6rem;
  max-width: 22rem;
}

.capture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.85rem 1rem;
}

.capture-wide {
  grid-column: 1 / -1;
}

.capture-group {
  border-top: 1px solid var(--dm-border);
  padding: 0.85rem 0 0.15rem;
  margin-top: 0.85rem;
}

.capture-group summary {
  cursor: pointer;
  color: var(--dm-heading);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.capture-hint {
  margin: 0.35rem 0 0;
  color: var(--dm-text-muted);
  font-size: 0.82rem;
}

.capture-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
}

.capture-choices .form-check {
  margin: 0;
  min-height: 0;
}

.capture-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.capture-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.capture-params {
  padding-left: 1.1rem;
  margin: 0 0 1rem;
}

.capture-params li + li {
  margin-top: 0.3rem;
}

.capture-params code {
  margin-right: 0.35rem;
}

.dm-cookie-consent {
  position: fixed;
  z-index: 1080;
  inset-inline: 1rem;
  bottom: 1rem;
  max-width: 42rem;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .dm-cookie-consent {
    inset-inline: 1.5rem auto;
    margin-inline: 0;
  }
}

.dm-cookie-consent__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.125rem;
  border-radius: var(--dm-radius);
  border: 1px solid var(--dm-border);
  background: var(--dm-surface);
  box-shadow: var(--dm-shadow);
}

@media (max-width: 575.98px) {
  .dm-cookie-consent__inner {
    flex-wrap: wrap;
  }
}

.dm-cookie-consent__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--dm-radius-sm);
  background: var(--dm-primary-muted);
  color: var(--dm-primary);
  font-size: 1.25rem;
}

@media (max-width: 575.98px) {
  .dm-cookie-consent__icon {
    display: none;
  }
}

.dm-cookie-consent__copy {
  flex: 1;
  min-width: 0;
}

.dm-cookie-consent__title {
  margin: 0 0 0.125rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dm-heading);
}

.dm-cookie-consent__text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--dm-text-muted);
}

.dm-cookie-consent__action {
  flex-shrink: 0;
}

@media (max-width: 575.98px) {
  .dm-cookie-consent__action {
    width: 100%;
  }
}
