:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111827;
  --text-soft: #4b5563;
  --text-muted: #6b7280;
  --brand: #f97316;
  --brand-dark: #ea580c;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 12px 28px rgba(17, 24, 39, 0.08);
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

button,
input {
  font: inherit;
}

body {
  min-height: 100vh;
}

main {
  display: block;
}

#ixsbox-root {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 14px 28px;
}

.ixsbox-app-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ixsbox-screen {
  min-height: 72dvh;
}

.ixsbox-status,
.ixsbox-response {
  width: 100%;
}

.ixsbox-status {
  min-height: 24px;
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
}

.ixsbox-response {
  min-height: 0;
}

.register-error-json {
  margin: 0;
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  background: #fff1f2;
  color: #9f1239;
  font-size: 12px;
  line-height: 1.45;
  overflow: auto;
}

/* AUTH */

.auth-card {
  width: 100%;
  padding: 22px 18px;
  margin-top: 10%;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 23px;
  line-height: 1.2;
}

h1 p {
    display: inline;
    padding: 4px 6px 0 0;
}

.auth-card h2 {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.3;
  color: var(--text-soft);
}

.auth-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-field span {
  font-size: 14px;
  color: var(--text-soft);
}

.auth-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.auth-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-actions-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-actions button,
.preview-actions button,
.preview-secondary-actions button {
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.auth-actions button:hover,
.preview-actions button:hover,
.preview-secondary-actions button:hover {
  background: var(--brand-dark);
}

.auth-actions button:disabled,
.preview-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ghost-button {
  border: 1px solid var(--line-strong) !important;
  background: #ffffff !important;
  color: var(--text) !important;
}

.linklike-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  cursor: pointer;
  font-weight: 700;
}

.auth-inline-note {
  margin-top: 18px !important;
  font-size: 14px;
}

.info-box {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.info-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

/* REGISTER PREVIEW */

.preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.preview-row:last-of-type {
  margin-bottom: 14px;
}

.preview-label {
  color: var(--text-muted);
  font-size: 14px;
}

.preview-note {
  margin: 14px 0 0 !important;
  font-size: 14px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.checkbox-row input {
  margin-top: 2px;
}

.preview-actions,
.preview-secondary-actions {
  margin-top: 18px;
}

/* RUNTIME */

.runtime-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 72dvh;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.runtime-header {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.runtime-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
}

.runtime-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.runtime-logo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}

.runtime-logo-mark {
  position: relative;
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.runtime-logo-mark::before,
.runtime-logo-mark::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 30px;
    height: 6px;
    background: #ffffff;
    transform-origin: center;
    border-radius: 70%;
}

.runtime-logo-mark::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.runtime-logo-mark::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.runtime-title-block {
  min-width: 0;
}

.runtime-title-small {
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-muted);
}

.runtime-title-large {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.runtime-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.runtime-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.runtime-nav {
  padding: 0 10px 10px;
}

.runtime-card p + p {
  margin-top: 6px;
}

.runtime-nav-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.runtime-nav-scroll::-webkit-scrollbar {
  display: none;
}

.runtime-nav-item {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
}

.runtime-nav-item.is-active {
  border-color: var(--text);
  color: var(--text);
  font-weight: 700;
}

.runtime-main {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px;
  background: var(--surface-soft);
}

.runtime-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.runtime-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.runtime-card h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.runtime-card p {
  margin: 0;
  line-height: 1.5;
  color: var(--text-soft);
}

.runtime-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 13px;
}

.runtime-footer-right {
  display: flex;
  align-items: center;
}

.runtime-text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font-weight: 700;
  cursor: pointer;
}

/* MENU OVERLAY */

.runtime-menu-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 96px 14px 14px;
  background: rgba(17, 24, 39, 0.28);
}

.runtime-menu-panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

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

.runtime-menu-body {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
}

.runtime-menu-item {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

/* SMALL DEVICES */

@media (max-width: 420px) {
  #ixsbox-root {
    padding: 10px 10px 24px;
  }

  .auth-card,
  .runtime-shell {
    border-radius: 20px;
  }

  .runtime-title-large {
    font-size: 16px;
  }
}