/* Frontier Psychology — minimal, calm, mobile-first */
:root{
  --bg: #fbf9f6;
  --bg2:#f3efe8;
  --text:#1c1c1c;
  --muted:#5c5c5c;
  --card:#ffffff;
  --border:#e6e0d6;
  --shadow: 0 10px 30px rgba(0,0,0,0.06);
  --accent:#111111;
  --accent2:#3a3a3a;
  --warn-bg:#fff3d6;
  --warn-border:#f0d08a;
  --danger-bg:#ffe4e4;
  --danger-border:#f0a0a0;
  --radius: 18px;
  --radius2: 26px;
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: radial-gradient(1200px 600px at 10% 0%, rgba(0,0,0,0.03), transparent 60%),
              linear-gradient(180deg, var(--bg), #ffffff 40%, var(--bg) 100%);
  color:var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height:1.55;
}
a{ color:inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover{ text-decoration-thickness: 2px; }
.container{
  width:min(1120px, calc(100% - 2rem));
  margin-inline:auto;
}
.skip-link{
  position:absolute; left:-999px; top:auto; width:1px; height:1px; overflow:hidden;
}
.skip-link:focus{
  left:1rem; top:1rem; width:auto; height:auto;
  padding:.6rem .9rem; background:var(--card); border:1px solid var(--border); border-radius:12px;
  z-index:9999;
}
.header{
  position:sticky;
  top:0;
  backdrop-filter: blur(10px);
  background: rgba(251, 249, 246, 0.75);
  border-bottom:1px solid var(--border);
  z-index:50;
}
.header__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding: .9rem 0;
}
.brand{ display:flex; align-items:center; gap:.85rem; min-width: 240px; }
.brand__mark{
  width:44px; height:44px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: #111;
  color:#fff;
  font-weight:700;
  letter-spacing:.5px;
}
.brand__title{
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight:700;
  font-size:1.05rem;
}
.brand__tag{ font-size:.85rem; color:var(--muted); margin-top:.15rem; }
.nav{
  display:none;
  gap: .9rem;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.nav a{
  text-decoration:none;
  padding:.45rem .55rem;
  border-radius: 12px;
  color: var(--accent2);
}
.nav a:hover{
  background: rgba(0,0,0,0.05);
}
.hero{
  padding: 3.1rem 0 2.2rem;
}
.hero__grid{
  display:grid;
  gap:1.4rem;
}
.hero__copy h1{
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(1.55rem, 3.2vw, 2.35rem);
  line-height:1.25;
  margin: 0 0 .8rem;
}
.lead{
  font-size:1.05rem;
  color: var(--accent2);
  margin:0 0 1.1rem;
  max-width: 60ch;
}
.meta{
  display:grid;
  grid-template-columns: 1fr;
  gap:.75rem;
  margin-top:1.15rem;
}
.meta__item{
  border:1px solid var(--border);
  background: rgba(255,255,255,0.75);
  border-radius: 16px;
  padding: .8rem .9rem;
}
.meta__label{ display:block; font-size:.82rem; color:var(--muted); }
.meta__value{ font-weight:600; }
.hero__panel .panel{
  border:1px solid var(--border);
  background: rgba(255,255,255,0.9);
  border-radius: var(--radius2);
  padding: 1.25rem 1.2rem;
  box-shadow: var(--shadow);
}
.panel h2{
  margin:.1rem 0 .8rem;
  font-size:1.05rem;
  font-family: "Libre Baskerville", Georgia, serif;
}
.panel__hint{
  display:flex; align-items:center; gap:.55rem;
  margin-top: .9rem;
  color: var(--muted);
  font-size:.9rem;
}
.dot{
  width:10px; height:10px; border-radius: 50%;
  background: #111;
  display:inline-block;
}
.callout{
  border: 1px solid var(--border);
  border-left-width: 6px;
  border-radius: 18px;
  padding: 1rem 1rem;
  background: var(--card);
  margin: .9rem 0 1.2rem;
}
.callout--warning{
  background: var(--warn-bg);
  border-color: var(--warn-border);
}
.callout--danger{
  background: var(--danger-bg);
  border-color: var(--danger-border);
}
.callout h3{ margin:.1rem 0 .5rem; }
.callout p{ margin:0; }
.cta{
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
  margin: 1.1rem 0 .2rem;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  padding: .75rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  text-decoration:none;
  font-weight:600;
}
.btn--primary{
  background:#111;
  color:#fff;
  border-color:#111;
}
.btn--primary:hover{ opacity:.92; }
.btn--ghost{
  background: rgba(255,255,255,0.6);
}
.btn--ghost:hover{ background: rgba(255,255,255,0.95); }
.section{
  padding: 2.2rem 0;
}
.section--alt{
  background: linear-gradient(180deg, rgba(0,0,0,0.03), rgba(0,0,0,0.01));
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
}
.section__head{
  margin-bottom: 1.2rem;
}
.section__head h2{
  font-family: "Libre Baskerville", Georgia, serif;
  margin:0 0 .25rem;
  font-size: 1.35rem;
}
.muted{ color: var(--muted); margin: .4rem 0; }
.cards{
  display:grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.card{
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem;
  box-shadow: var(--shadow);
}
.card h3{
  margin:.15rem 0 .5rem;
  font-size: 1.05rem;
}
.card p{ margin:.4rem 0; }
.grid-2{
  display:grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.bullets, .ticks{
  margin: .6rem 0 0;
  padding-left: 1.1rem;
}
.bullets li{ margin: .35rem 0; }
.ticks{ list-style: none; padding-left: 0; }
.ticks li{
  margin: .55rem 0;
  padding-left: 1.6rem;
  position: relative;
}
.ticks li:before{
  content: "✓";
  position:absolute;
  left:0;
  top:0;
  font-weight:700;
}
.footer{
  padding: 1.5rem 0;
}
.footer__inner{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap: .6rem;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}
.footer a{ text-decoration:none; }
.footer a:hover{ text-decoration: underline; }
@media (min-width: 860px){
  .nav{ display:flex; }
  .hero__grid{
    grid-template-columns: 1.2fr .8fr;
    align-items:start;
    gap: 1.6rem;
  }
  .meta{ grid-template-columns: repeat(3, 1fr); }
  .cards{ grid-template-columns: repeat(3, 1fr); }
  .grid-2{ grid-template-columns: repeat(2, 1fr); }
}



/* Language toggle */
.t-uk { display: none; }
body.uk .t-en { display: none; }
body.uk .t-uk { display: inline; }

.lang-toggle{
  margin-left: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.lang-toggle:hover{ background: rgba(255,255,255,0.10); }
.lang-toggle:focus{ outline: 2px solid rgba(255,255,255,0.25); outline-offset: 2px; }

/* Chat page styling aligned with the proposal site */
body.chat-page{
  min-height:100vh;
  padding: 24px 16px 40px;
  background:
    radial-gradient(circle at top, rgba(245, 158, 11, 0.16), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 45%, #fff7ed 100%);
  color:#0f172a;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body.chat-page .container{
  width:min(1180px, calc(100% - 8px));
  max-width:1180px;
  background:rgba(255,255,255,0.72);
  border:1px solid rgba(255,255,255,0.6);
  border-radius:32px;
  padding:24px;
  box-shadow:0 30px 80px rgba(15,23,42,0.10);
  backdrop-filter: blur(18px);
}

body.chat-page h1,
body.chat-page h2,
body.chat-page h3{
  color:#020617;
  letter-spacing:-0.02em;
}

body.chat-page h1{
  font-size:clamp(2rem, 4vw, 3rem);
  margin-bottom:1rem;
}

body.chat-page #onboarding,
body.chat-page .sidebar,
body.chat-page #log,
body.chat-page .persona-card,
body.chat-page .info-box,
body.chat-page .session-item,
body.chat-page .chat-presence{
  border:1px solid rgba(226,232,240,0.9);
  background:rgba(255,255,255,0.82);
  border-radius:28px;
  box-shadow:0 20px 60px rgba(15,23,42,0.08);
}

body.chat-page #onboarding{
  padding:28px;
  margin-bottom:20px;
}

body.chat-page .sidebar{
  padding:18px;
  background:rgba(255,255,255,0.74);
}

body.chat-page .sidebar button,
body.chat-page .persona-card button.select-persona,
body.chat-page .onboarding-nav button,
body.chat-page button{
  border:none;
  border-radius:999px;
  background:#0f172a;
  color:#fff;
  font-weight:600;
  padding:0.8rem 1.1rem;
  box-shadow:none;
}

body.chat-page button:hover,
body.chat-page .sidebar button:hover,
body.chat-page .persona-card button.select-persona:hover,
body.chat-page .onboarding-nav button:hover{
  background:#1e293b;
}

body.chat-page #micBtn{
  background:#b45309;
}

body.chat-page #micBtn.recording{
  background:#be123c;
}

body.chat-page input[type="text"],
body.chat-page select{
  border:1px solid #cbd5e1;
  border-radius:18px;
  background:rgba(255,255,255,0.92);
  color:#0f172a;
  padding:0.8rem 0.95rem;
}

body.chat-page #tutorial-blurb,
body.chat-page .video-hint,
body.chat-page #ob-status,
body.chat-page .chat-presence-meta,
body.chat-page .chat-presence-desc,
body.chat-page .session-meta,
body.chat-page .tagline{
  color:#475569;
}

body.chat-page .video-wrap{
  border-radius:24px;
  border:1px solid rgba(226,232,240,0.9);
  overflow:hidden;
}

body.chat-page .info-box{
  background:rgba(248,250,252,0.94);
  color:#334155;
  border-radius:20px;
}

body.chat-page .persona-card{
  padding:20px;
}

body.chat-page .persona-card.active-persona,
body.chat-page .session-item.active{
  border-color:#0f172a;
  box-shadow:0 0 0 2px rgba(15,23,42,0.12), 0 20px 60px rgba(15,23,42,0.08);
}

body.chat-page .persona-card .persona-avatar,
body.chat-page .chat-presence-avatar{
  border:2px solid rgba(226,232,240,0.9);
  box-shadow:0 12px 30px rgba(15,23,42,0.10);
}

body.chat-page .presence-badge{
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
}

body.chat-page .presence-badge.memory{
  background:#f8fafc;
  border-color:#cbd5e1;
  color:#334155;
}

body.chat-page .presence-badge.context{
  background:#ecfeff;
  border-color:#bae6fd;
  color:#155e75;
}

body.chat-page #log{
  min-height:420px;
  padding:20px;
  background:rgba(248,250,252,0.86);
}

body.chat-page .msg{
  max-width:min(85%, 760px);
  border-radius:24px;
  padding:0.9rem 1rem;
  line-height:1.55;
}

body.chat-page .msg.user{
  background:#fff7ed;
  border:1px solid #fed7aa;
}

body.chat-page .msg.assistant{
  background:#ffffff;
  border:1px solid #e2e8f0;
}

body.chat-page .msg-header{
  color:#64748b;
}

body.chat-page #message-row{
  margin-top:12px;
  gap:10px;
}

body.chat-page #message-row input[type="text"]{
  min-height:48px;
}

body.chat-page .chat-layout{
  gap:20px;
  align-items:start;
}

@media (max-width: 820px){
  body.chat-page{
    padding:16px 12px 32px;
  }

  body.chat-page .container{
    width:100%;
    padding:16px;
    border-radius:28px;
  }

  body.chat-page #onboarding,
  body.chat-page .sidebar,
  body.chat-page #log,
  body.chat-page .persona-card,
  body.chat-page .info-box,
  body.chat-page .session-item,
  body.chat-page .chat-presence{
    border-radius:22px;
  }
}

/* Mobile chat flow refinements */
body.chat-page #chat-section{
  min-height: 0;
}

body.chat-page .chat-layout > main{
  min-width: 0;
  display: flex;
  flex-direction: column;
}

body.chat-page #chat-form{
  margin-top: 0;
  border: 1px solid rgba(226,232,240,0.9);
  background: rgba(255,255,255,0.86);
  border-radius: 24px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(15,23,42,0.08);
  backdrop-filter: blur(12px);
}

body.chat-page #message-row{
  margin-top: 0;
}

body.chat-page #micContainer{
  flex-shrink: 0;
}

@media (max-width: 820px){
  body.chat-page .chat-layout{
    gap: 14px;
  }

  body.chat-page .chat-layout > main{
    order: 1;
  }

  body.chat-page .sidebar{
    order: 2;
    padding: 14px;
  }

  body.chat-page #session-list{
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  body.chat-page .session-item{
    min-width: 190px;
    flex: 0 0 auto;
  }

  body.chat-page #log{
    height: calc(100dvh - 340px);
    min-height: 320px;
    max-height: none;
    padding: 16px;
    scroll-padding-bottom: 100px;
  }

  body.chat-page #chat-form{
    position: sticky;
    bottom: 8px;
    z-index: 20;
    padding: 10px;
    border-radius: 22px;
  }

  body.chat-page .form-row-inline{
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.chat-page .form-row-inline > label{
    flex: none;
  }

  body.chat-page .form-row-inline select{
    width: 100%;
  }

  body.chat-page #message-row{
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.chat-page #message-row button,
  body.chat-page #micBtn{
    width: 100%;
    min-height: 44px;
  }

  body.chat-page #message-row input[type="text"]{
    min-height: 50px;
  }

  body.chat-page .chat-presence{
    padding: 14px;
  }

  body.chat-page .chat-presence-avatar{
    width: 56px;
    height: 56px;
  }

  body.chat-page #onboarding{
    padding: 18px;
  }
}

/* Compact chat controls */
body.chat-page .chat-settings{
  margin-bottom: 12px;
  border: 1px solid rgba(226,232,240,0.9);
  background: rgba(248,250,252,0.92);
  border-radius: 18px;
  padding: 10px 12px;
}

body.chat-page .chat-settings summary{
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
  list-style: none;
}

body.chat-page .chat-settings summary::-webkit-details-marker{
  display: none;
}

body.chat-page .chat-settings summary::after{
  content: "Open";
  float: right;
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
}

body.chat-page .chat-settings[open] summary::after{
  content: "Close";
}

body.chat-page .chat-settings .field-row{
  margin-top: 12px;
  margin-bottom: 0;
}

body.chat-page #message-row{
  display: flex;
  align-items: center;
  gap: 10px;
}

body.chat-page #message-row input[type="text"]{
  flex: 1 1 auto;
  width: auto;
}

body.chat-page .send-button{
  flex-shrink: 0;
}

@media (max-width: 820px){
  body.chat-page .chat-settings{
    padding: 8px 10px;
    margin-bottom: 10px;
  }

  body.chat-page .chat-settings summary{
    font-size: 0.88rem;
  }

  body.chat-page #message-row{
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "input input"
      "send mic";
    align-items: stretch;
    gap: 8px;
  }

  body.chat-page #message-row input[type="text"]{
    grid-area: input;
    min-height: 46px;
    width: 100%;
  }

  body.chat-page .send-button{
    grid-area: send;
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  body.chat-page #micContainer{
    grid-area: mic;
    width: 100%;
  }

  body.chat-page #micBtn{
    width: 100%;
    min-width: 0;
    min-height: 44px;
    white-space: nowrap;
    padding-inline: 8px;
    font-size: 0.92rem;
    justify-content: center;
  }
}

/* Urgent help panel */
body.chat-page .urgent-help{
  margin: 0 0 14px;
  border: 1px solid rgba(248, 113, 113, 0.24);
  background: rgba(255, 247, 237, 0.92);
  border-radius: 22px;
  padding: 12px 14px;
  box-shadow: 0 16px 36px rgba(15,23,42,0.08);
}

body.chat-page .urgent-help summary{
  cursor: pointer;
  list-style: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: #9a3412;
}

body.chat-page .urgent-help summary::-webkit-details-marker{
  display: none;
}

body.chat-page .urgent-help summary::after{
  content: "Open";
  float: right;
  font-size: 0.8rem;
  font-weight: 500;
  color: #7c2d12;
}

body.chat-page .urgent-help[open] summary::after{
  content: "Close";
}

body.chat-page .urgent-help-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

body.chat-page .urgent-help-card{
  border: 1px solid rgba(251, 146, 60, 0.25);
  background: rgba(255,255,255,0.84);
  border-radius: 18px;
  padding: 12px;
}

body.chat-page .urgent-help-card h3{
  margin: 0 0 8px;
  font-size: 0.95rem;
}

body.chat-page .urgent-link{
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #fdba74;
  color: #7c2d12;
  text-decoration: none;
  font-weight: 600;
}

body.chat-page .urgent-link-danger{
  background: #7f1d1d;
  border-color: #7f1d1d;
  color: #fff;
}

body.chat-page .urgent-help-note{
  margin: 12px 2px 0;
  font-size: 0.85rem;
  color: #7c2d12;
}

@media (max-width: 820px){
  body.chat-page .urgent-help{
    padding: 10px 12px;
  }

  body.chat-page .urgent-help-grid{
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Mid-stream controls */
body.chat-page .chat-top-controls{
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

body.chat-page .chat-top-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

body.chat-page .chat-top-actions button{
  border: none;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  padding: 0.65rem 0.95rem;
  cursor: pointer;
}

body.chat-page .chat-top-actions button:hover{
  background: #1e293b;
}

@media (max-width: 820px){
  body.chat-page .chat-top-controls{
    gap: 8px;
    margin-bottom: 10px;
  }

  body.chat-page .chat-top-actions{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.chat-page .chat-top-actions button{
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    justify-content: center;
  }
}

/* Compact presence card: icon + mode only */
body.chat-page .chat-presence{
  padding: 10px 12px;
  min-height: 64px;
  align-items: center;
}

body.chat-page .chat-presence-avatar{
  width: 44px;
  height: 44px;
}

body.chat-page #chat-presence-name,
body.chat-page #chat-presence-desc,
body.chat-page #chat-presence-badges{
  display: none !important;
}

body.chat-page #chat-presence-meta{
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

@media (max-width: 820px){
  body.chat-page .chat-presence{
    padding: 8px 10px;
    min-height: 56px;
  }

  body.chat-page .chat-presence-avatar{
    width: 40px;
    height: 40px;
  }

  body.chat-page #chat-presence-meta{
    font-size: 0.85rem;
  }
}
