:root {
  color-scheme: dark;
  --bg: #090909;
  --panel: rgba(22, 22, 22, 0.78);
  --panel-strong: rgba(12, 12, 12, 0.92);
  --line: #2c2c2c;
  --line-soft: #202020;
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --dim: #666;
  --accent: #ffffff;
  --good: #34d399;
  --bad: #fb7185;
  --warn: #fbbf24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(90, 90, 90, 0.28), transparent 34rem),
    radial-gradient(circle at 0% 100%, rgba(55, 65, 81, 0.18), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(145deg, #fafafa, #a3a3a3);
  color: #111;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36);
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-subtitle {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.language {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.68);
}

.language button {
  min-width: 40px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
}

.language button.active {
  background: #262626;
  color: var(--text);
}

.hero {
  margin-top: 78px;
  text-align: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.68);
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.12);
}

h1 {
  margin: 22px 0 0;
  font-size: clamp(42px, 7vw, 68px);
  line-height: 0.95;
  letter-spacing: 0;
  font-weight: 950;
}

.hero p {
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 15px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #282828;
  color: #d4d4d4;
  font-size: 15px;
}

h2 {
  margin: 0;
  font-size: 16px;
}

.muted {
  margin: 9px 0 0;
  color: var(--dim);
  font-size: 12px;
}

.format {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 12px;
}

code,
.format-strip {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  color: #dedede;
}

textarea {
  width: 100%;
  min-height: 168px;
  margin-top: 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.36);
  color: #e7e7e7;
  padding: 13px;
  outline: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

textarea:focus {
  border-color: #737373;
  box-shadow: 0 0 0 1px #3f3f3f;
}

textarea::placeholder {
  color: #565656;
}

.format-strip {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  color: #5e5e5e;
  padding: 10px 12px;
  font-size: 12px;
  overflow-x: auto;
}

.notice {
  display: none;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.notice.show {
  display: block;
}

.notice.error {
  border-color: rgba(251, 113, 133, 0.45);
  color: #fecdd3;
}

.notice.ok {
  border-color: rgba(52, 211, 153, 0.38);
  color: #bbf7d0;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.primary,
.secondary {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 800;
}

.primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: var(--accent);
  color: #050505;
}

.primary:disabled {
  opacity: 0.45;
}

.secondary {
  border: 1px solid var(--line);
  background: rgba(35, 35, 35, 0.7);
  color: #d4d4d4;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  user-select: none;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: #303030;
  padding: 0;
}

.switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 160ms ease;
}

.switch.enabled {
  background: #15803d;
}

.switch.enabled span {
  transform: translateX(16px);
}

.inbox {
  min-height: 468px;
  display: flex;
  flex-direction: column;
}

.summary {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.summary.show {
  display: grid;
}

.summary div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(0, 0, 0, 0.24);
}

.summary strong {
  display: block;
  font-size: 16px;
}

.summary span {
  color: var(--dim);
  font-size: 11px;
}

.results {
  flex: 1;
  margin-top: 12px;
  overflow: auto;
}

.results.empty {
  display: grid;
  place-items: center;
}

.empty-state {
  text-align: center;
  color: var(--muted);
}

.spark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101010;
  color: #6e6e6e;
  font-size: 26px;
}

.empty-state p {
  margin: 0;
  color: #d2d2d2;
  font-weight: 800;
}

.empty-state span {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 12px;
}

.account-block {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.23);
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.account-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(52, 211, 153, 0.12);
  color: #86efac;
  font-size: 11px;
  font-weight: 800;
}

.badge.error {
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
}

.message {
  padding: 13px 14px;
  border-top: 1px solid var(--line-soft);
}

.message:first-of-type {
  border-top: 0;
}

.message-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #cfcfcf;
  font-size: 12px;
}

.subject {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.time {
  flex: 0 0 auto;
  color: var(--dim);
}

.preview {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.otp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.otp {
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.08);
  color: #fde68a;
  padding: 6px 9px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 900;
}

.copy {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #191919;
  color: #d7d7d7;
  padding: 6px 9px;
  font-size: 12px;
}

.error-text {
  padding: 13px 14px;
  color: #fecdd3;
  font-size: 12px;
  line-height: 1.45;
}

footer {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--dim);
  font-size: 12px;
}

footer strong {
  color: #bdbdbd;
}

[dir="rtl"] .switch-label {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .switch span {
  left: auto;
  right: 3px;
}

[dir="rtl"] .switch.enabled span {
  transform: translateX(-16px);
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding-top: 22px;
  }

  .hero {
    margin-top: 54px;
  }

  .workspace {
    grid-template-columns: 1fr;
    margin-top: 34px;
  }

  .panel {
    padding: 18px;
  }

  .switch-label {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }
}
