/* Account and device-management polish. Every rule is scoped to its existing screen. */

#account-details,
#account-details .inner,
#account-details .account-identity,
#account-details .account-authorizations,
#account-details #acct-inline-computers {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#account-details .account-identity__email--copy {
  position: relative;
  padding-right: 28px;
  border-radius: 7px;
  cursor: pointer;
  touch-action: manipulation;
  overflow-wrap: anywhere;
}

#account-details .account-identity__email--copy::after {
  content: "⧉";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: #0866d7;
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
}

#account-details .account-identity__email--copy:focus-visible {
  outline: 2px solid #86b7ff;
  outline-offset: 2px;
}

#account-details .account-identity__copy-status {
  display: block;
  margin-top: 4px;
  color: #218453;
  font-size: 12px;
  line-height: 1.4;
}

#account-details .account-identity__copy-status[hidden],
#account-details .account-identity__name-note[hidden] {
  display: none !important;
}

#account-details .account-identity__name-note {
  display: block;
  margin-top: 3px;
  color: #7a8494;
  font-size: 11px;
  line-height: 1.4;
}

#account-details .account-authorizations h3,
#account-details .account-computer b,
#account-details .account-computer span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#account-details .account-computer {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 12px 0;
}

#account-details .account-computer--expired b {
  color: #8b3b32;
}

#account-details .account-computer__purchase {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  max-width: 100%;
  margin-top: 3px;
  padding: 7px 11px;
  border: 1px solid #c8dcfb;
  border-radius: 9px;
  background: #f4f8ff;
  color: #0866d7;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

#account-details .account-computer__purchase:focus-visible {
  outline: 2px solid #86b7ff;
  outline-offset: 2px;
}

#account-details #acct-open-send,
#account-details .fieldhint {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Narrow account-management forms can contain long addresses and recovery codes. */
#account-panel,
#account-panel *,
#sender-name-details .inner,
#sender-name-details .inner * {
  box-sizing: border-box;
  min-width: 0;
}

#account-panel .acct__top {
  flex-wrap: wrap;
}

#account-panel .acct__top h1,
#account-panel .acct__row b,
#account-panel .acct__lic,
#account-panel .acct__codelist,
#account-panel .acct__confirm,
#account-panel .hintline {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#account-panel input:not([type="checkbox"]):not([type="radio"]),
#sender-name-details #rename {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#account-panel button,
#sender-name-details #rename-btn {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 350px) {
  #account-panel .acct__summary .acct__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }

  #account-panel .acct__summary .acct__row b {
    text-align: left;
  }
}

/* The class switcher stays inside its existing sheet and keeps relay.js's row DOM. */
#class-sheet .sheet {
  box-sizing: border-box;
  gap: 12px;
  padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
  background: #f2f2f7;
  border-radius: 20px 20px 0 0;
}

#class-sheet .sheet__head {
  min-width: 0;
  min-height: 44px;
}

#class-sheet .sheet__head h2 {
  min-width: 0;
  text-align: center;
}

#class-sheet #class-sheet-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-color: #e1e1e8;
  background: #fff;
}

#class-sheet #class-sheet-hint {
  min-width: 0;
  padding: 0 2px;
  color: #747985;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#class-sheet #class-list {
  display: flex;
  flex: none;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #e5e5eb;
  border-radius: 14px;
  background: #fff;
}

#class-sheet #class-list > .muted {
  margin: 0;
  padding: 16px;
  color: #7b808a;
}

#class-sheet #class-list .class-row {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 68px;
  gap: 9px;
  padding: 10px 9px;
  border: 0;
  border-radius: 0;
  background: #fff;
}

#class-sheet #class-list .class-row.is-on {
  background: #f5f9ff;
}

#class-sheet #class-list .class-row:not(:last-child)::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 51px;
  height: 1px;
  background: #e9e9ee;
  content: "";
}

#class-sheet #class-list .class-row__text {
  display: grid;
  flex: 1 1 0;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  min-width: 0;
}

#class-sheet #class-list .class-row__text::before {
  grid-column: 1;
  grid-row: 1 / span 2;
  place-self: center;
  box-sizing: border-box;
  width: 22px;
  height: 15px;
  border: 2px solid #0866d7;
  border-radius: 3px;
  background: #edf4ff;
  transform: translateY(-3px);
  content: "";
}

#class-sheet #class-list .class-row__text::after {
  grid-column: 1;
  grid-row: 1 / span 2;
  place-self: center;
  box-sizing: border-box;
  width: 10px;
  height: 8px;
  border-bottom: 2px solid #0866d7;
  background: linear-gradient(#0866d7, #0866d7) center top / 2px 5px no-repeat;
  content: "";
  transform: translateY(8px);
}

#class-sheet #class-list .class-row__name,
#class-sheet #class-list .class-row__hint {
  grid-column: 2;
  min-width: 0;
}

#class-sheet #class-list .class-row__name {
  color: #202632;
  font-size: 14px;
  line-height: 1.35;
}

#class-sheet #class-list .class-row.is-on .class-row__name {
  color: #075bb8;
}

#class-sheet #class-list .class-row__hint {
  margin-top: 2px;
  color: #7a808b;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#class-sheet #class-list .class-row__ops {
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

#class-sheet #class-list .class-row__ops .ghost {
  min-height: 36px;
  max-width: 100%;
  padding: 6px 8px;
  border-color: #e1e1e8;
  border-radius: 9px;
  background: #f7f7fa;
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
}

#class-sheet #class-list .class-row__ops .is-danger {
  border-color: #f0d7d5;
  background: #fff7f6;
  color: #b64036;
}

#class-sheet #class-manage-controls,
#class-sheet #class-manage-controls > *,
#class-sheet #target-rename-help,
#class-sheet #target-rename-help .inner {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#class-sheet #target-rename-help .inner {
  overflow-wrap: anywhere;
}

#class-sheet #target-alias {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#class-sheet #target-alias-save,
#class-sheet #class-add-btn,
#class-sheet #class-manage-controls button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 350px) {
  #class-sheet .sheet {
    padding-right: 12px;
    padding-left: 12px;
  }

  #class-sheet #class-list .class-row {
    gap: 6px;
    padding-right: 6px;
    padding-left: 6px;
  }

  #class-sheet #class-list .class-row__text {
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 6px;
  }

  #class-sheet #class-list .class-row__text::before {
    width: 20px;
    height: 14px;
  }

  #class-sheet #class-list .class-row__text::after {
    width: 9px;
    height: 7px;
  }

  #class-sheet #class-list .class-row:not(:last-child)::after {
    left: 42px;
  }

  #class-sheet #class-list .class-row__ops .ghost {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 11px;
  }
}
