/**
 * The sessions card: one row per live token.
 *
 * A four-column row that wraps rather than a table, because the last column is a control and the
 * middle two are optional — a session from a local CLI has no country to report, and a table would
 * hold a column open for it on every row.
 */
.account-sessions {
  display: flex;
  flex-direction: column;
}

.account-sessions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--light);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.account-sessions-device {
  flex: 1 1 160px;
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-sessions-place,
.account-sessions-seen {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--text2);
}

/* Pushed to the end of whatever line it lands on, so the control is always at the right edge
   whether the row wrapped or not. */
.account-sessions-action {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text2);
  cursor: pointer;
  transition: color 160ms linear;
}

.account-sessions-action:hover:not(:disabled) {
  color: var(--text);
}

.account-sessions-action:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* The session you are asking from. Not a control — there is nothing sensible to do to it from
   inside itself except sign out, which the menu already offers. */
.account-sessions-action:disabled {
  cursor: default;
  color: var(--account-dim, var(--text2));
}

.account-sessions-empty {
  padding: 18px;
  border-bottom: 1px solid var(--light);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--text2);
}

.account-sessions-issue {
  padding: 0 18px 14px;
}

/* ---------------- FILTERS ---------------- */

/* Only on the audit page. Three counts that are also the control that switches between them —
   "Ended 12" is both the answer and the way to see it. */
.account-sessions-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--light);
}

.account-sessions-filters[hidden] {
  display: none;
}

.account-sessions-filter {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--light);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text2);
  transition: color 160ms linear, background-color 160ms linear;
}

.account-sessions-filter span {
  font-size: 10px;
  color: var(--account-dim, var(--text2));
}

.account-sessions-filter:hover {
  color: var(--text);
}

.account-sessions-filter[aria-pressed='true'] {
  background: var(--text);
  color: var(--background);
}

.account-sessions-filter[aria-pressed='true'] span {
  color: var(--background);
}

.account-sessions-filter:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

/* ---------------- ENDED ROWS ---------------- */

/**
 * A record rather than a session. Struck through the device name and dimmed as a whole, so a list
 * showing both reads as two kinds of thing at a glance — which is the point of keeping them.
 */
.account-sessions-row-ended {
  color: var(--text2);
}

.account-sessions-row-ended .account-sessions-device {
  color: var(--text2);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.account-sessions-action[hidden] {
  display: none;
}

/* The audit page's two extra columns. Both wrap onto their own line under the row, which is where
   a user-agent string belongs — it is evidence, not a label. */
.account-sessions-how {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--text2);
}

.account-sessions-how:empty,
.account-sessions-agent:empty {
  display: none;
}

.account-sessions-agent {
  flex: 1 1 100%;
  min-width: 0;
  font-size: 10px;
  color: var(--account-dim, var(--text2));
  overflow-wrap: anywhere;
}

/* ---------------- FOOT ---------------- */

.account-sessions-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.account-sessions-more {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text2);
  text-decoration: none;
  transition: color 160ms linear;
}

.account-sessions-more:hover {
  color: var(--text);
}

.account-sessions-more[hidden] {
  display: none;
}

/* The log's rows carry two lines rather than one, so they are tightened to keep a screen of them
   readable as a list rather than as a stack of cards. */
.account-sessions-full .account-sessions-row {
  padding: 11px 18px;
  row-gap: 3px;
}
