/* Veles' own interface: one destination per screen, quiet controls, room artwork. */
.app {
  --sans: "Manrope", sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --copper-soft: #e2c48f;
  --interface-panel: rgba(9, 22, 35, .94);
  --interface-border: rgba(197, 216, 227, .17);
}
.app button, .app input, .app textarea, .app select { font-family: var(--sans); }
.app button:focus-visible, .app summary:focus-visible {
  outline: 2px solid var(--copper-soft);
  outline-offset: 3px;
}
.app .screen-title {
  flex: 0 0 auto;
  padding: 24px 20px 18px;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
  text-align: left;
}
.app .nav-item.active { background: rgba(217, 181, 121, .08); }
.app .nav-item.active svg, .app .nav-item.active .nav-label { color: var(--copper-soft); }
.app .nav-item svg { width: 21px; height: 21px; }
.app .desktop-mode-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  list-style: none;
  cursor: pointer;
}
.app .desktop-mode-heading::-webkit-details-marker { display: none; }
.app .desktop-mode-nav[open] .desktop-mode-heading > span { transform: rotate(45deg); }
.app .desktop-mode-nav:not([open]) > .desktop-mode-group { display: none; }
.app .nav-brand { font-family: var(--serif); font-size: 30px; font-weight: 500; }

/* A directory of doors, not a wall of competing thumbnails. */
.app #screen-rooms.active { display: flex; min-height: 0; overflow: hidden; }
.app .rooms-content {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 20px 24px;
}
.app .rooms-intro {
  padding: 26px 24px;
  margin-bottom: 28px;
  border: 1px solid var(--interface-border);
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(9,22,35,.97), rgba(9,22,35,.7)),
    url('/assets/images/room/veles-spirit-chamber-wide-v6.webp') center 46% / cover;
}
.app .rooms-kicker { color: var(--copper-soft); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; }
.app .rooms-intro h2 { margin: 12px 0; font: 500 36px/1.08 var(--serif); }
.app .rooms-intro p { max-width: 400px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.app .room-directory { display: grid; gap: 24px; }
.app .room-group { min-width: 0; }
.app .room-group h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.app .room-entry {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 78px;
  padding: 14px;
  margin-bottom: 8px;
  color: var(--text);
  background: var(--interface-panel);
  border: 1px solid var(--interface-border);
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
}
.app .room-entry:hover { background: #142b3c; border-color: rgba(197,216,227,.32); }
.app .room-entry::before, .app .room-entry::after { content: none; display: none; }
.app .room-entry.active { border-color: rgba(217,181,121,.55); background: linear-gradient(110deg, rgba(217,181,121,.1), transparent), var(--interface-panel); }
.app .room-entry-symbol {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(197,216,227,.22);
  border-radius: 12px;
  color: var(--copper-soft);
  font-family: Georgia, serif;
  font-size: 16px;
}
.app .room-entry-copy { display: grid; gap: 5px; min-width: 0; }
.app .room-entry-copy strong { font-size: 14px; line-height: 1.3; font-weight: 600; }
.app .room-entry-copy small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.app .room-entry-arrow { color: var(--muted); font-size: 16px; }
.app .rooms-footnote { margin: 22px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

/* The selected room lives in the header; the composer has one clear action. */
.app #screen-oracle .header {
  position: relative;
  min-height: 84px;
  padding: 14px 20px 12px !important;
  background: linear-gradient(180deg, rgba(8,19,30,.96), rgba(8,19,30,.7));
}
.app #screen-oracle .header-title { font: 500 32px/1 var(--serif); }
.app #screen-oracle .header-label { font-size: 9px; letter-spacing: .12em; margin-bottom: 4px; color: var(--muted); }
.app #screen-oracle .header-sub { color: var(--muted); font-size: 11px; margin-top: 5px; }
.app #screen-oracle .mode-switcher-toggle {
  position: absolute;
  top: 18px;
  right: 20px;
  display: grid;
  width: min(170px, 46%);
  min-height: 48px;
  grid-template-columns: 28px minmax(0,1fr) 12px;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(14,32,47,.9);
  border: 1px solid var(--interface-border);
  border-radius: 12px;
}
.app #screen-oracle .mode-switcher-symbol { width: 28px; height: 28px; font-size: 12px; }
.app #screen-oracle .mode-switcher-copy small { color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.app #screen-oracle .mode-switcher-copy strong { color: var(--text); font-size: 12px; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
.app #screen-oracle .mode-switcher-caret { color: var(--copper-soft); }
.app #screen-oracle .composer { background: #091623; backdrop-filter: none; }
.app #screen-oracle .input-bar.direct-dialogue {
  display: grid;
  grid-template-columns: minmax(0,1fr) 48px;
  align-items: end;
  gap: 8px 10px;
  padding: 12px 16px 14px;
  border: 0;
  border-top: 1px solid var(--interface-border);
  background: #091623;
  backdrop-filter: none;
}
.app #screen-oracle .address-label { grid-column: 1 / -1; font-size: 10px; color: var(--muted); letter-spacing: .03em; text-transform: none; line-height: 1.4; }
.app #screen-oracle .input-bar textarea {
  min-height: 48px;
  max-height: 132px;
  padding: 12px;
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  overflow-y: auto;
  background: rgba(197,216,227,.04) !important;
  border: 1px solid var(--interface-border) !important;
  border-radius: 12px;
}
.app #screen-oracle .input-bar textarea::placeholder { color: #91a5b5; }
.app #screen-oracle .input-bar textarea:focus { outline: 2px solid rgba(217,181,121,.6); outline-offset: -1px; }
.app #screen-oracle .send-btn { width: 48px; height: 48px; border-radius: 12px; box-shadow: none !important; }
.app #screen-oracle .send-btn svg path { stroke: #14202c; }
.app #screen-oracle .oracle-reading { padding: 26px 22px; border-radius: 16px; }
.app #screen-oracle .oracle-reading::before, .app #screen-oracle .oracle-reading::after { display: none; }
.app #screen-oracle .oracle-reading-mark { font-size: 9px; letter-spacing: .12em; color: #a8bdc9; }
.app #screen-oracle .msg-oracle .oracle-text, .app #screen-oracle .msg-oracle p { font-size: 17px; line-height: 1.7; }
.app #screen-oracle .msg-oracle .meta { color: #9cb1bf; }

/* Secondary controls reveal themselves when needed. */
.app .diary-search-panel {
  flex: 0 0 auto;
  width: min(940px, calc(100% - 40px));
  margin: 0 auto 14px;
  border: 1px solid var(--interface-border);
  border-radius: 12px;
  background: var(--interface-panel);
}
.app .diary-search-panel summary { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 10px 14px; font-size: 13px; color: var(--muted); cursor: pointer; list-style: none; }
.app .diary-search-panel summary::-webkit-details-marker { display: none; }
.app .diary-search-panel[open] summary > span { transform: rotate(45deg); }
.app .diary-search-panel .diary-search { width: auto; margin: 0; padding: 0 14px 14px; }
.app .diary-filters { width: min(940px, calc(100% - 40px)); gap: 6px; }
.app .diary-filters button { min-height: 44px; font-size: 12px; border-radius: 10px; }
.app .diary-entry, .app .profile-card, .app .bond-form, .app .bond-card { border-radius: 14px; }
.app .diary-pattern-empty, .app .diary-empty-state { padding: 24px 20px; color: var(--muted); background: var(--interface-panel); border: 1px solid var(--interface-border); border-radius: 14px; font-size: 14px; line-height: 1.7; }
.app .diary-empty-state { margin-top: 14px; }
.app .profile-card .card-label { font-size: 11px; letter-spacing: .08em; }
.app .profile-accordion-title { font-size: 13px; letter-spacing: .02em; text-transform: none; }
.app .profile-accordion-meta { color: var(--muted); }
.app .profile-accordion-chevron { color: var(--copper-soft); }
.app .bond-empty { padding: 12px 4px 16px; }
.app .bond-empty-icon { width: 56px; height: 56px; margin-bottom: 14px; }
.app .bond-empty p { margin-bottom: 0; }
.app .bond-field label, .app .form-label { color: var(--muted); font-size: 12px; letter-spacing: .02em; text-transform: none; }
.app .onboarding { border-radius: 18px; }
.app .account-details { padding: 0; border-radius: 14px; }
.app .account-details summary { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 14px 16px; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.app .account-details summary::-webkit-details-marker { display: none; }
.app .account-details[open] summary > span:last-child { transform: rotate(45deg); }
.app .account-details-body { padding: 4px 16px 18px; }
.app .profile-content { display: flex; flex-direction: column; }
.app .profile-content > * { flex: 0 0 auto; }
.app .profile-content .account-details { margin: 0 0 14px; }
.app .profile-content .billing-section { margin-inline: 0; border-radius: 14px; }

@media (min-width: 900px) {
  .app.has-nav:has(#screen-oracle.active) .desktop-mode-nav { display: block; padding: 0; margin: 10px 0 14px; }
  .app.has-nav .nav-item { min-height: 48px; }
  .app.has-nav #screen-oracle .header { padding: 14px 20px 12px !important; }
  .app.has-nav #screen-oracle .header .mode-switcher-toggle { right: 16px; }
  .app.has-nav #screen-oracle .chat-area { padding: 0 12px 12px; }
  .app.has-nav #screen-oracle .input-bar.direct-dialogue { grid-column: 1; grid-row: 3; border-radius: 14px 14px 0 0; }
  .app.has-nav #screen-oracle .oracle-reading { padding: 28px 30px; }
  .app.has-nav #screen-rooms .screen-title { width: min(1100px,100%); margin: 0 auto; padding: 30px 32px 20px; }
  .app.has-nav .rooms-content { width: min(1100px,100%); margin: 0 auto; padding: 0 32px 32px; }
  .app .rooms-intro { padding: 32px; }
  .app .room-directory { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
  .app .room-entry { grid-template-columns: 32px minmax(0,1fr) 12px; gap: 10px; padding: 12px; }
  .app .room-entry-symbol { width: 32px; height: 36px; font-size: 14px; }
}
@media (max-width: 899px) {
  .app.has-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: var(--interface-height,100dvh);
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }
  .app.has-nav::after { display: none; }
  .app.has-nav .screen.active:not(#screen-elements):not(#screen-auth) {
    flex: 1 1 0;
    min-height: 0;
    height: 0;
    max-height: none;
    overflow: hidden;
  }
  .app.has-nav #screen-elements.active { height: var(--interface-height,100dvh); min-height: 0; }
  .app.has-nav .elemental-shell { min-height: 0; }
  .app.has-nav .nav {
    position: relative;
    inset: auto;
    flex: 0 0 var(--mobile-nav-height);
    height: var(--mobile-nav-height);
    min-height: var(--mobile-nav-height);
    width: 100%;
    margin: 0;
    padding: 6px 8px calc(10px + env(safe-area-inset-bottom,0px));
    background: #091623 !important;
    backdrop-filter: none;
    z-index: 30;
  }
  .app.has-nav .nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 48px; padding: 4px 2px; border-radius: 12px; }
  .app.has-nav .nav-item .nav-label { font-size: 10px; line-height: 1.3; }
  .app.has-nav #screen-oracle.active { height: 0; flex: 1 1 0; max-height: none; }
  .app #screen-oracle .header { min-height: 88px; padding-top: calc(14px + env(safe-area-inset-top,0px)) !important; }
  .app #screen-oracle .mode-switcher-toggle { top: calc(18px + env(safe-area-inset-top,0px)); }
  .app #screen-oracle .oracle-ambient { display: none; }
  .app #screen-oracle .chat-area { flex: 1 1 0; min-height: 0; margin: 0; padding: 8px 14px 14px; }
  .app #screen-oracle .oracle-reading { min-height: 100%; background: rgba(8,21,33,.86); border-color: var(--interface-border); }
  .app #screen-oracle .composer { flex: 0 0 auto; }
  .app .screen-title { padding-top: calc(24px + env(safe-area-inset-top,0px)); }
  .app .profile-content, .app .bonds-content, .app .diary-list, .app .diary-detail { min-height: 0; padding-inline: 20px; padding-bottom: 20px; }
  .app .profile-content { padding-top: 0; }
  .app .profile-header { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 3px 14px; align-items: center; text-align: left; padding: 10px 0 22px; margin-bottom: 0; }
  .app .profile-avatar { grid-column: 1; grid-row: 1 / span 2; width: 54px; height: 54px; margin: 0; font-size: 22px; }
  .app .profile-name { align-self: end; padding: 0; font-size: 27px; font-family: var(--serif); font-weight: 500; }
  .app .profile-sign { align-self: start; margin: 0; padding: 0; color: var(--muted); font-size: 12px; }
  .app .profile-accordion-head { min-height: 58px; }
  .app input:not([type="checkbox"]):not([type="radio"]), .app select, .app textarea { font-size: 16px; }
  .app .bond-form { gap: 14px; padding: 18px; }
  .app .bond-field { margin: 0; }
  .app .start-btn, .app .invite-btn { min-height: 48px; border-radius: 12px; }
  .app .onboarding { padding: 28px 22px; }
}
@media (max-width: 360px) {
  .app .rooms-content { padding-inline: 16px; }
  .app .rooms-intro { padding: 22px 18px; }
  .app .room-entry { grid-template-columns: 34px minmax(0,1fr) 12px; gap: 10px; padding: 12px; }
  .app .room-entry-symbol { width: 34px; height: 38px; }
  .app #screen-oracle .header { padding-inline: 16px !important; }
  .app #screen-oracle .mode-switcher-toggle { right: 14px; gap: 6px; padding-inline: 7px; }
  .app #screen-oracle .mode-switcher-copy strong { font-size: 11px; }
}
@media (max-width: 899px) and (max-height: 560px) {
  .app #screen-oracle .header { min-height: 64px; padding-block: 8px !important; }
  .app #screen-oracle .header-title { font-size: 27px; }
  .app #screen-oracle .header-label { display: none; }
  .app #screen-oracle .mode-switcher-toggle { top: 8px; }
  .app #screen-oracle .input-bar.direct-dialogue { padding-block: 8px; }
}
@media (prefers-reduced-motion: reduce) { .app .screen.active { animation: none; } }
