:root {
  color-scheme: dark;
  --bg: #101418;
  --panel: #171d22;
  --panel-2: #20282e;
  --ink: #f5f0e8;
  --muted: #aeb8b5;
  --line: rgba(245, 240, 232, 0.12);
  --gold: #d4af37;
  --green: #6fd28b;
  --red: #ef7b72;
  --blue: #6ea8fe;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(140deg, rgba(212, 175, 55, 0.18), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(111, 210, 139, 0.1), transparent 26%),
    var(--bg);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 18px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

.phone-shell {
  width: min(430px, 100%);
  min-height: min(900px, calc(100vh - 36px));
  background: #0d1114;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.screen {
  display: none;
  min-height: inherit;
  padding: 22px;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.brand-panel {
  min-height: 48vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 24px 4px;
}

.crest {
  width: 126px;
  height: 126px;
  border-radius: 24px;
  background: #f5f0e8;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  overflow: hidden;
}

.crest img {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 2.2rem;
  line-height: 1.02;
  margin-bottom: 4px;
}

h2 {
  font-size: 1.45rem;
  margin-bottom: 0;
}

h3 {
  font-size: 1.02rem;
  margin-bottom: 10px;
}

.subcopy,
.hint,
small {
  color: var(--muted);
}

.subcopy {
  line-height: 1.5;
  max-width: 32ch;
}

.public-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.public-shortcuts button {
  min-height: 36px;
  border-radius: 8px;
  background: rgba(245, 240, 232, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.public-shortcuts button.active {
  background: rgba(212, 175, 55, 0.16);
  color: var(--gold);
}

.public-panel {
  max-height: 220px;
  overflow: auto;
}

.public-panel:empty {
  display: none;
}

.login-card,
.content-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-card {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.request-card h3 {
  margin-bottom: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0f1418;
  color: var(--ink);
  padding: 13px 12px;
  outline: none;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
}

.primary {
  min-height: 48px;
  border-radius: 8px;
  background: var(--gold);
  color: #18140a;
  font-weight: 850;
}

.secondary {
  min-height: 44px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  text-align: center;
}

.hint.error {
  color: var(--red);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  min-width: 54px;
  height: 38px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.status-strip article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 74px;
  padding: 12px 10px;
  display: grid;
  gap: 6px;
}

.status-strip strong,
.status-strip span {
  display: block;
  font-size: 0.74rem;
}

.status-strip span {
  color: var(--muted);
}

.status-strip .good {
  color: var(--green);
}

[hidden] {
  display: none !important;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
  max-height: 256px;
  overflow: auto;
  padding-right: 2px;
}

.feature-card {
  min-height: 118px;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feature-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.content-panel {
  padding: 16px;
  flex: 1;
  margin-bottom: 72px;
  overflow: auto;
  max-height: 360px;
}

.list {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.row.with-photo {
  grid-template-columns: 58px 1fr auto;
}

.profile-photo {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center 22%;
  border: 1px solid rgba(212, 175, 55, 0.32);
}

.row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  white-space: pre-line;
}

.badge {
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(110, 168, 254, 0.16);
  color: var(--blue);
  font-size: 0.75rem;
  white-space: nowrap;
}

.badge.good {
  background: rgba(111, 210, 139, 0.16);
  color: var(--green);
}

.badge.alert {
  background: rgba(239, 123, 114, 0.16);
  color: var(--red);
}

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

.admin-actions button {
  min-height: 46px;
  border-radius: 8px;
  background: #11171b;
  border: 1px solid var(--line);
}

.admin-workspace {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.admin-form {
  display: grid;
  gap: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.admin-form h4 {
  margin: 0;
  font-size: 0.92rem;
}

.admin-form button {
  min-height: 42px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.26);
  color: var(--gold);
  font-weight: 800;
}

.admin-note {
  text-align: left;
}

.request-list {
  display: grid;
  gap: 8px;
}

.request-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.request-item p,
.request-item span {
  color: var(--muted);
  display: block;
  font-size: 0.8rem;
  line-height: 1.35;
  margin: 5px 0 0;
}

.chat-room {
  display: grid;
  gap: 12px;
}

.chat-list {
  display: grid;
  gap: 10px;
  max-height: 232px;
  overflow: auto;
}

.chat-notice {
  background: rgba(110, 168, 254, 0.12);
  border: 1px solid rgba(110, 168, 254, 0.24);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 11px;
}

.chat-message {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
}

.chat-message.mine {
  border-color: rgba(212, 175, 55, 0.34);
  background: rgba(212, 175, 55, 0.1);
}

.chat-message div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.chat-message span {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.chat-message p {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.35;
  margin: 0;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.chat-form button {
  min-width: 64px;
  border-radius: 8px;
  background: var(--gold);
  color: #18140a;
  font-weight: 850;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gallery-card {
  min-height: 178px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-card img,
.gallery-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.gallery-card img {
  object-fit: cover;
  object-position: center 24%;
}

.gallery-placeholder {
  display: grid;
  place-items: center;
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold);
  font-size: 1.35rem;
  font-weight: 900;
}

.gallery-card div:last-child {
  padding: 10px;
}

.gallery-card p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  margin: 5px 0 0;
}

.bottom-nav {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: rgba(13, 17, 20, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  backdrop-filter: blur(16px);
}

.nav-item {
  min-height: 42px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
}

.nav-item.active {
  background: rgba(212, 175, 55, 0.16);
  color: var(--gold);
}

@media (max-width: 360px) {
  body {
    padding: 0;
  }

  .phone-shell {
    min-height: 100vh;
    border-radius: 0;
  }

  .screen {
    padding: 18px;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 106px;
  }

  .bottom-nav {
    left: 8px;
    right: 8px;
  }
}
