/* SAHBAZ_MOBILE_ACCESS_V1 */
/* SAHBAZ_IPHONE_PWA_V1 */
:root {
  color-scheme: dark;
  --bg: #05080d;
  --panel: rgba(13, 20, 31, .86);
  --line: rgba(255,255,255,.12);
  --text: #f4f7fb;
  --muted: #99a7b7;
  --cyan: #3ed6c8;
  --gold: #d6a23a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(4, 7, 12, .92), rgba(4, 7, 12, .96)),
    radial-gradient(circle at 20% 0%, rgba(62,214,200,.18), transparent 32%),
    #05080d;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea {
  font: inherit;
}

button {
  border: 1px solid rgba(62,214,200,.28);
  border-radius: 14px;
  min-height: 44px;
  padding: 10px 14px;
  color: #061014;
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline: none;
}

.mobile-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
}

.mobile-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: var(--panel);
}

.mobile-head span {
  display: block;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.mobile-head h1 {
  margin: 3px 0 0;
  font-size: 1.25rem;
}

.mobile-head strong {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--cyan);
  background: rgba(62,214,200,.08);
  font-size: .78rem;
}

.install-banner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(216,162,58,.28);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(216,162,58,.13), rgba(62,214,200,.08));
}

.install-banner[hidden] {
  display: none;
}

.install-banner strong,
.install-banner span {
  display: block;
}

.install-banner span {
  color: var(--muted);
  font-size: .88rem;
  margin-top: 2px;
}

.install-banner a,
.primary-link {
  border: 1px solid rgba(62,214,200,.3);
  border-radius: 14px;
  min-height: 42px;
  padding: 10px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #061014;
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  font-weight: 900;
  white-space: nowrap;
}

.panel, .chat-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  padding: 16px;
}

.panel {
  align-self: start;
  display: grid;
  gap: 12px;
}

.panel h2 {
  margin: 0;
}

.panel p, .panel small {
  margin: 0;
  color: var(--muted);
}

.chat-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 12px;
}

.iphone-shell {
  grid-template-rows: auto auto auto auto;
}

.iphone-hero,
.install-steps {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}

.iphone-hero {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 18px;
}

.iphone-hero img {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 40px rgba(0,0,0,.32);
}

.iphone-hero h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.15;
}

.iphone-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.install-steps {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.install-steps article {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 11px;
  background: rgba(255,255,255,.04);
}

.install-steps strong {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #071016;
  background: var(--gold);
}

.iphone-note {
  align-self: auto;
}

.messages {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.message {
  max-width: 92%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.user {
  align-self: flex-end;
  background: rgba(62,214,200,.13);
}

.message.assistant {
  align-self: flex-start;
  background: rgba(255,255,255,.055);
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-row button {
  min-height: 40px;
  padding: 8px;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.composer textarea {
  min-height: 46px;
  max-height: 140px;
  resize: none;
}

@media (max-width: 380px) {
  .mobile-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .quick-row {
    grid-template-columns: 1fr;
  }

  .composer {
    grid-template-columns: 1fr;
  }
}
