.inbox-forwarding-panel {
  margin-block: 1.25rem;
  padding: clamp(1rem, 2vw, 1.45rem);
  border: 1px solid var(--line, #dce5ee);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, var(--surface, #fff), color-mix(in srgb, var(--accent-soft, #eef8f7) 44%, var(--surface, #fff)));
  box-shadow: 0 12px 32px rgb(24 49 74 / 5%);
}

.inbox-forwarding-heading-icon,
.inbox-forward-channel-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent, #138a84);
  background: var(--accent-soft, #e8f7f5);
}

.inbox-forwarding-heading-icon {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: .9rem;
}

.inbox-forwarding-heading-icon svg,
.inbox-forward-channel-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.inbox-forwarding-note {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin-block: 1rem 1.15rem;
  padding: .85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent, #138a84) 18%, transparent);
  border-radius: .85rem;
  color: var(--text-muted, #64748b);
  background: color-mix(in srgb, var(--accent-soft, #e8f7f5) 50%, transparent);
  font-size: .86rem;
  line-height: 1.9;
}

.inbox-forwarding-note > span {
  flex: 0 0 auto;
  margin-top: .2rem;
  color: var(--accent, #138a84);
}

.inbox-forwarding-note svg { width: 1.1rem; height: 1.1rem; }
.inbox-forwarding-note p { margin: 0; }

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

.inbox-forward-card {
  display: grid;
  gap: .95rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line, #dce5ee);
  border-radius: 1rem;
  background: var(--surface, #fff);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.inbox-forward-card:hover {
  border-color: color-mix(in srgb, var(--accent, #138a84) 38%, var(--line, #dce5ee));
  box-shadow: 0 9px 22px rgb(24 49 74 / 7%);
  transform: translateY(-1px);
}

.inbox-forward-card-head,
.inbox-forward-channel,
.inbox-forward-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}

.inbox-forward-channel { justify-content: flex-start; min-width: 0; }
.inbox-forward-channel > span:last-child { display: grid; gap: .18rem; min-width: 0; }
.inbox-forward-channel strong { font-size: .96rem; }
.inbox-forward-channel small { color: var(--text-muted, #64748b); font-size: .76rem; overflow-wrap: anywhere; }

.inbox-forward-channel-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: .75rem;
}

.inbox-forward-state {
  padding: .32rem .65rem;
  border: 1px solid var(--line, #dce5ee);
  border-radius: 999px;
  color: var(--text-muted, #64748b);
  background: var(--surface-subtle, #f7f9fb);
  font-size: .76rem;
  font-weight: 700;
}

.inbox-forward-state.enabled {
  border-color: #a8e3d1;
  color: #087a5d;
  background: #eaf9f3;
}

.inbox-forward-toggle {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .75rem .8rem;
  border: 1px solid var(--line, #dce5ee);
  border-radius: .8rem;
  cursor: pointer;
}

.inbox-forward-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--accent, #138a84);
}

.inbox-forward-toggle span { display: grid; gap: .16rem; }
.inbox-forward-toggle strong { font-size: .86rem; }
.inbox-forward-toggle small { color: var(--text-muted, #64748b); font-size: .73rem; }

.inbox-forward-recipient {
  display: grid;
  gap: .42rem;
  font-size: .82rem;
  font-weight: 700;
}

.inbox-forward-recipient input {
  width: 100%;
  min-height: 2.8rem;
  padding: .65rem .8rem;
  border: 1px solid var(--line, #dce5ee);
  border-radius: .72rem;
  color: var(--text, #172b43);
  background: var(--surface, #fff);
  font: inherit;
  font-size: .9rem;
  direction: ltr;
  text-align: left;
}

.inbox-forward-recipient input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #138a84) 24%, transparent);
  border-color: var(--accent, #138a84);
}

.inbox-forward-card-foot { flex-wrap: wrap; }
.inbox-forward-card-foot .button { min-height: 2.45rem; padding: .5rem .8rem; }
.inbox-forward-card-foot .button svg { width: 1rem; height: 1rem; }

.inbox-forward-route {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  color: var(--text-muted, #64748b);
  font-size: .75rem;
}

.inbox-forward-route i {
  width: .48rem;
  height: .48rem;
  border-radius: 50%;
  background: #d49a37;
}

.inbox-forward-route.ready i { background: #17a673; box-shadow: 0 0 0 3px rgb(23 166 115 / 12%); }

.inbox-forward-save-status {
  min-height: 1.4rem;
  margin: -.45rem 0 0;
  color: var(--text-muted, #64748b);
  font-size: .76rem;
  line-height: 1.7;
}

@media (max-width: 600px) {
  .inbox-forwarding-panel { padding: .85rem; }
  .inbox-forward-card { padding: .85rem; }
  .inbox-forward-card-foot { align-items: stretch; }
  .inbox-forward-card-foot .button { width: 100%; justify-content: center; }
}

.inbox-row-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

.inbox-row-actions .button {
  min-height: 2rem;
  padding: .35rem .55rem;
  white-space: nowrap;
  font-size: .72rem;
}

.inbox-row-actions .ui-icon {
  width: .9rem;
  height: .9rem;
}

.inbox-message-preview {
  display: grid;
  justify-items: start;
  gap: .55rem;
  min-width: 9rem;
  max-width: 28rem;
}

.inbox-message-preview > span {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: var(--text, #263c52);
  font-size: .83rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.inbox-read-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  min-height: 2rem;
  padding: .38rem .7rem;
  border: 1px solid color-mix(in srgb, var(--accent, #138a84) 28%, #fff);
  border-radius: .65rem;
  color: var(--accent, #138a84);
  background: color-mix(in srgb, var(--accent-soft, #e8f7f5) 64%, #fff);
  font: inherit;
  font-size: .75rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.inbox-read-button:hover {
  background: var(--accent-soft, #e8f7f5);
  box-shadow: 0 5px 13px rgb(19 138 132 / 12%);
  transform: translateY(-1px);
}

.inbox-read-button:focus-visible,
.inbox-message-dialog-close:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #138a84) 30%, transparent);
  outline-offset: 2px;
}

.inbox-read-button .ui-icon { width: 1rem; height: 1rem; }

.inbox-message-dialog {
  width: min(660px, calc(100vw - 28px));
  max-width: none;
  max-height: min(88vh, 780px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid #dce8ec;
  border-radius: 1.25rem;
  color: #334a60;
  background: #fff;
  box-shadow: 0 28px 90px rgb(13 29 48 / 28%);
  animation: inbox-dialog-enter .18s ease-out;
}

.inbox-message-dialog::backdrop {
  background: rgb(13 27 44 / 54%);
  backdrop-filter: blur(4px);
}

.inbox-message-dialog-card {
  display: grid;
  gap: 1.15rem;
  padding: clamp(1rem, 3vw, 1.55rem);
}

.inbox-message-dialog-header,
.inbox-message-dialog-heading,
.inbox-message-dialog-content-heading,
.inbox-message-dialog-footer {
  display: flex;
  align-items: center;
}

.inbox-message-dialog-header {
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .95rem;
  border-bottom: 1px solid #edf1f4;
}

.inbox-message-dialog-heading { gap: .85rem; min-width: 0; }
.inbox-message-dialog-heading .eyebrow { margin: 0 0 .2rem; color: #138a84; font-size: .72rem; }
.inbox-message-dialog-heading h2 { margin: 0; color: #263c52; font-size: 1.25rem; }

.inbox-message-dialog-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  border: 1px solid #ccebe6;
  border-radius: 1rem;
  color: #087e77;
  background: linear-gradient(145deg, #e9faf6, #f1f5ff);
  font-size: .78rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 #fff;
}

.inbox-message-dialog-close { flex: 0 0 auto; color: #668096; font-size: 1.25rem; }

.inbox-message-dialog-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.inbox-message-dialog-meta > div {
  display: grid;
  gap: .25rem;
  min-width: 0;
  padding: .7rem .8rem;
  border: 1px solid #e7edf1;
  border-radius: .8rem;
  background: #f9fbfc;
}

.inbox-message-dialog-meta small,
.inbox-message-dialog-content-heading small { color: #8191a1; font-size: .69rem; }
.inbox-message-dialog-meta strong { color: #405970; font-size: .83rem; overflow-wrap: anywhere; }

.inbox-message-dialog-content {
  min-height: 8rem;
  padding: 1rem 1.05rem;
  border: 1px solid #dcece9;
  border-radius: 1rem;
  background: linear-gradient(145deg, #f5fbfa, #fbfcff 80%);
}

.inbox-message-dialog-content-heading { gap: .65rem; margin-bottom: .75rem; }
.inbox-message-dialog-content-heading > span {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .72rem;
  color: #087e77;
  background: #e2f5f1;
  font-size: .76rem;
  font-weight: 900;
}
.inbox-message-dialog-content-heading > div { display: grid; gap: .13rem; }
.inbox-message-dialog-content-heading strong { color: #38536b; font-size: .84rem; }

.inbox-message-dialog-content > p {
  margin: 0;
  color: #263f56;
  font-size: 1rem;
  line-height: 2.1;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  unicode-bidi: plaintext;
}

.inbox-message-dialog-footer {
  justify-content: space-between;
  gap: .8rem;
  color: #8292a1;
  font-size: .72rem;
}

.inbox-message-dialog-footer .button { min-height: 2.35rem; padding: .5rem 1rem; }

.inbox-delete-dialog {
  width: min(510px, calc(100vw - 24px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e7d9d4;
  border-radius: 1.15rem;
  color: #344b60;
  background: #fff;
  box-shadow: 0 24px 72px rgb(13 29 48 / 28%);
}
.inbox-delete-dialog::backdrop { background: rgb(13 27 44 / 54%); backdrop-filter: blur(4px); }
.inbox-delete-card { display: grid; gap: 1rem; padding: clamp(1rem, 3vw, 1.4rem); }
.inbox-delete-header { display: flex; align-items: center; gap: .8rem; padding-bottom: .85rem; border-bottom: 1px solid #edf1f4; }
.inbox-delete-header > div { flex: 1; min-width: 0; }
.inbox-delete-header .eyebrow { margin: 0 0 .2rem; color: #c45a48; font-size: .72rem; }
.inbox-delete-header h2 { margin: 0; color: #263c52; font-size: 1.08rem; }
.inbox-delete-mark { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; border: 1px solid #f1d3ca; border-radius: .9rem; color: #bb493e; background: linear-gradient(145deg, #fff2ee, #fff9f6); font-size: 1.2rem; font-weight: 900; }
.inbox-delete-description { margin: 0; padding: .85rem .95rem; border: 1px solid #f0e2d9; border-radius: .8rem; color: #6b5b52; background: #fffaf6; font-size: .82rem; line-height: 1.9; }
.inbox-delete-actions { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: .6rem; }
.inbox-delete-actions .button { min-height: 2.5rem; padding: .55rem .9rem; }
.inbox-delete-error { min-height: 0; color: #ad3d36; font-size: .78rem; line-height: 1.8; }
.inbox-delete-error:empty { display: none; }
html.theme-dark .inbox-delete-dialog { color: #c5d0dc; background: #142235; border-color: #503a40; }
html.theme-dark .inbox-delete-header { border-color: #2a3a50; }
html.theme-dark .inbox-delete-header h2 { color: #e4edf6; }
html.theme-dark .inbox-delete-mark { color: #ffb2a5; background: #38282c; border-color: #604149; }
html.theme-dark .inbox-delete-description { color: #d9c5bd; background: #2d2424; border-color: #55403b; }
@media (max-width: 560px) {
  .inbox-delete-dialog { width: calc(100vw - 18px); border-radius: 1rem; }
  .inbox-delete-actions { display: grid; grid-template-columns: 1fr; }
  .inbox-delete-actions .button { width: 100%; }
}

@keyframes inbox-dialog-enter {
  from { opacity: 0; transform: translateY(7px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

html.theme-dark .inbox-message-preview > span { color: #d5e0eb; }
html.theme-dark .inbox-read-button { color: #8de0d1; background: #183833; border-color: #315b54; }
html.theme-dark .inbox-read-button:hover { background: #20463f; }
html.theme-dark .inbox-message-dialog { color: #c5d0dc; background: #142235; border-color: #2c3e53; }
html.theme-dark .inbox-message-dialog-header { border-color: #2a3a50; }
html.theme-dark .inbox-message-dialog-heading h2 { color: #e4edf6; }
html.theme-dark .inbox-message-dialog-mark { color: #9be0d3; background: linear-gradient(145deg, #183833, #1a2b40); border-color: #315b54; }
html.theme-dark .inbox-message-dialog-meta > div { background: #101d2e; border-color: #2c3e53; }
html.theme-dark .inbox-message-dialog-meta strong,
html.theme-dark .inbox-message-dialog-content-heading strong,
html.theme-dark .inbox-message-dialog-content > p { color: #d5e0eb; }
html.theme-dark .inbox-message-dialog-content { background: linear-gradient(145deg, #142e2d, #101d2e 80%); border-color: #355a54; }
html.theme-dark .inbox-message-dialog-content-heading > span { color: #9be0d3; background: #1b403a; }

@media (max-width: 560px) {
  .inbox-message-dialog { width: calc(100vw - 18px); max-height: 92vh; border-radius: 1rem; }
  .inbox-message-dialog-card { gap: .9rem; padding: .95rem; }
  .inbox-message-dialog-meta { gap: .5rem; }
  .inbox-message-dialog-meta > div { padding: .6rem; }
  .inbox-message-dialog-footer { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .inbox-message-dialog { animation: none; }
  .inbox-read-button { transition: none; }
}
