:root {
  color-scheme: dark;
  --black: #050504;
  --sidebar: #090806;
  --surface: rgba(18, 15, 11, 0.78);
  --ivory: #f5eee4;
  --muted: #a79b8b;
  --gold: #ffe2a8;
  --champagne: #f3c982;
  --amber: #d99a52;
  --rose: #c88178;
  --line: rgba(243, 217, 177, 0.15);
  --line-strong: rgba(243, 217, 177, 0.28);
  --sidebar-width: 276px;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--black); }
body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--ivory);
  background: var(--black);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--champagne); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.workspace { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); height: 100vh; height: 100svh; }
.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 22px 14px 14px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 25% 4%, rgba(217, 154, 82, 0.07), transparent 28%),
    var(--sidebar);
}
.sidebar-top { display: flex; min-height: 40px; align-items: center; justify-content: space-between; padding: 0 7px; }
.brand { display: inline-flex; align-items: center; font-family: "Cormorant Garamond", Georgia, serif; font-size: 28px; font-weight: 600; line-height: 1; }
.brand .rya-core-icon { margin-right: 8px; }
.legarya-prefix { color: var(--ivory); }
.rya-glow { color: var(--gold); text-shadow: 0 0 4px rgba(255,238,200,.7), 0 0 10px rgba(243,201,130,.46), 0 0 22px rgba(217,154,82,.24), 0 0 34px rgba(200,129,120,.07); }

.icon-button { display: grid; width: 44px; height: 44px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(255, 238, 210, 0.055); }
.close-sidebar { display: none; font-size: 25px; }
.new-chat-button {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 11px;
  margin: 19px 2px 0;
  padding: 0 18px;
  border: 1px solid rgba(255, 236, 202, .58);
  border-radius: 999px;
  color: #171109;
  background: linear-gradient(145deg, #fff0d2, #f3cf8d 52%, #e7b76b);
  box-shadow: inset 0 1px rgba(255,255,255,.5), 0 8px 25px rgba(217,154,82,.14);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: transform 280ms cubic-bezier(.22,1,.36,1), box-shadow 280ms ease;
}
.new-chat-button span:first-child { font-size: 20px; font-weight: 300; line-height: 1; }
.new-chat-button:hover { transform: translateY(-1px); box-shadow: inset 0 1px rgba(255,255,255,.62), 0 11px 30px rgba(217,154,82,.22), 0 0 24px rgba(255,226,168,.08); }
.sidebar-actions { display:grid; flex:0 0 auto; gap:7px; margin:9px 2px 0; }
.journey-summary{display:grid;gap:7px;margin:8px 2px 0;padding:9px 10px;border:1px solid rgba(243,201,130,.12);border-radius:8px;background:rgba(255,238,210,.025)}.journey-progress-row{display:flex;align-items:baseline;justify-content:space-between;gap:8px;padding:0 1px 6px;border-bottom:1px solid rgba(243,201,130,.1)}.journey-summary small{color:var(--muted);font-size:8px;letter-spacing:.08em;text-transform:uppercase}.journey-progress-row strong{color:rgba(243,217,177,.76);font-size:9px;font-weight:400}.journey-streak{display:flex;min-width:0;align-items:center;gap:10px;padding:2px 1px 1px}.journey-streak .preservation-ring--sidebar{width:34px;height:34px}.journey-streak .preservation-ring--sidebar::before{width:25px;height:25px}.journey-streak .preservation-ring--sidebar i{font-size:9px}.journey-streak-copy{display:grid;min-width:0;flex:1;grid-template-columns:minmax(0,1fr);gap:2px}.journey-streak-copy small{font-size:7px}.journey-streak-copy strong{color:#f3c982;font:500 11px/1.05 Inter,sans-serif;letter-spacing:.06em;text-shadow:0 0 12px rgba(243,201,130,.14)}.journey-streak-copy strong b{font:600 22px/.9 "Cormorant Garamond",serif;letter-spacing:0}.journey-streak-copy>span{color:rgba(245,238,228,.66);font-size:8px;line-height:1.3}.journey-streak.is-milestone{animation:streak-milestone 2.1s ease}.journey-streak.is-milestone .preservation-ring{box-shadow:0 0 24px rgba(243,201,130,.34),inset 0 0 0 1px rgba(255,237,204,.5)}.journey-streak.is-milestone strong{color:#ffe0a3;text-shadow:0 0 16px rgba(243,201,130,.36)}
.preservation-ring{display:grid;width:42px;height:42px;flex:0 0 auto;place-items:center;border-radius:50%;background:conic-gradient(rgba(243,201,130,.18) 0 100%);box-shadow:inset 0 0 0 1px rgba(243,201,130,.12);transition:background 650ms ease,box-shadow 650ms ease}.preservation-ring::before{grid-area:1/1;width:32px;height:32px;border-radius:50%;background:#100d09;content:""}.preservation-ring i{z-index:1;grid-area:1/1;color:rgba(243,217,177,.46);font-size:12px;font-style:normal;transition:color 500ms ease,text-shadow 500ms ease}.preservation-ring.is-complete{background:conic-gradient(#f3c982 0 100%);box-shadow:0 0 18px rgba(243,201,130,.22),inset 0 0 0 1px rgba(255,237,204,.4)}.preservation-ring.is-complete i{color:#ffe6b3;text-shadow:0 0 8px rgba(255,221,158,.7)}.preservation-ring.is-completing{animation:ring-complete 750ms ease}.preservation-ring--small{width:28px;height:28px}.preservation-ring--small::before{width:21px;height:21px}.preservation-ring--small i{font-size:8px}@keyframes ring-complete{0%{background:conic-gradient(#f3c982 0%,rgba(243,201,130,.18) 0)}50%{background:conic-gradient(#f3c982 65%,rgba(243,201,130,.18) 65%)}100%{background:conic-gradient(#f3c982 100%,rgba(243,201,130,.18) 100%)}}
.journey-summary.is-milestone{animation:journey-shimmer 2.1s ease}@keyframes journey-shimmer{0%,100%{box-shadow:none}35%{border-color:rgba(255,226,168,.42);box-shadow:0 0 24px rgba(243,201,130,.14)}}
@keyframes streak-milestone{0%,100%{opacity:1}35%{opacity:.86;filter:brightness(1.14)}}
.memories-button { display:flex; width:100%; min-height:42px; align-items:center; gap:11px; margin:0; padding:0 17px; border:1px solid rgba(243,217,177,.16); border-radius:999px; color:rgba(245,238,228,.82); background:rgba(255,238,210,.025); cursor:pointer; font-size:12px; transition:border-color 220ms ease,background 220ms ease,color 220ms ease; }
.memories-button:hover { border-color:rgba(255,226,168,.38); color:var(--gold); background:rgba(255,238,210,.055); }
.memories-button-icon { color:var(--champagne); font-size:17px; line-height:1; }

.legacy-context { position: relative; margin: 11px 2px 0; }
.legacy-button { display: grid; width: 100%; min-height: 48px; grid-template-columns: minmax(0,1fr) 22px; align-items: center; padding: 6px 11px 6px 14px; border: 1px solid rgba(243,217,177,.14); border-radius: 8px; color: var(--ivory); background: rgba(255,238,210,.025); cursor: pointer; text-align: left; transition: border-color 220ms ease, background 220ms ease; }
.legacy-button:hover, .legacy-button[aria-expanded="true"] { border-color: rgba(255,226,168,.3); background: rgba(255,238,210,.05); }
.legacy-button:disabled { cursor:default; }
.legacy-button:disabled .legacy-chevron { visibility:hidden; }
.legacy-button-copy { min-width: 0; }
.legacy-button-copy small, .legacy-button-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legacy-button-copy small { color: rgba(243,201,130,.65); font-size: 8px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; }
.legacy-button-copy strong { margin-top: 3px; color: rgba(245,238,228,.9); font-size: 11px; font-weight: 400; }
.legacy-chevron { color: var(--champagne); text-align: center; transform: translateY(-2px); }
.legacy-menu { position: absolute; z-index: 30; top: calc(100% + 7px); right: 0; left: 0; padding: 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: #100e0b; box-shadow: 0 18px 48px rgba(0,0,0,.62); }
.legacy-menu > p { margin: 3px 7px 7px; color: var(--muted); font-size: 8px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; }
.legacy-list { display: grid; gap: 2px; max-height: 190px; overflow-y: auto; }
.legacy-option, .create-legacy-button { width: 100%; min-height: 44px; padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left; }
.legacy-option:hover, .legacy-option.is-active, .create-legacy-button:hover { background: rgba(255,238,210,.06); }
.legacy-option strong, .legacy-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legacy-option strong { color: rgba(245,238,228,.9); font-size: 11px; font-weight: 400; }
.legacy-option small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.legacy-option.is-active strong { color: var(--gold); }
.create-legacy-button { margin-top: 5px; border-top: 1px solid var(--line); color: var(--champagne); font-size: 10px; }

.recent-chats { display:flex; min-height:0; flex:1 1 auto; flex-direction:column; margin-top:24px; overflow:hidden; }
.recent-chats h2 { flex:0 0 auto; margin:0 10px 10px; color:rgba(167,155,139,.72); font-size:9px; font-weight:500; letter-spacing:.15em; text-transform:uppercase; }
.conversation-list-scroll { min-height:0; flex:1 1 auto; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-color:rgba(213,190,153,.34) transparent; scrollbar-width:thin; }
.conversation-list-scroll::-webkit-scrollbar { width:5px; }
.conversation-list-scroll::-webkit-scrollbar-track { background:transparent; }
.conversation-list-scroll::-webkit-scrollbar-thumb { border-radius:999px; background:rgba(213,190,153,.25); }
.conversation-list-scroll::-webkit-scrollbar-thumb:hover { background:rgba(236,213,177,.48); }
.conversation-list { display: grid; gap: 3px; }
.conversation-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 36px; align-items: center; min-height: 42px; border: 1px solid transparent; border-radius: 7px; transition: background 220ms ease, border-color 220ms ease; }
.conversation-item:hover { background: rgba(255, 241, 216, .035); }
.conversation-item.is-active { border-color: rgba(243,217,177,.12); background: rgba(243,201,130,.075); }
.conversation-select, .conversation-menu { min-width: 0; height: 40px; border: 0; background: transparent; cursor: pointer; }
.conversation-select { overflow: hidden; padding: 0 4px 0 11px; color: rgba(245,238,228,.76); text-align: left; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.conversation-item.is-active .conversation-select { color: var(--ivory); }
.conversation-menu { opacity: 0; padding: 0; border-radius: 6px; color: var(--muted); font-size: 19px; transition: opacity 180ms ease, background 180ms ease, color 180ms ease; }
.conversation-item:hover .conversation-menu, .conversation-menu:focus-visible, .conversation-item.is-active .conversation-menu { opacity: 1; }
.conversation-menu:hover { color: #e7a49c; background: rgba(200,129,120,.08); }
.conversation-menu[aria-expanded="true"] { opacity: 1; color: var(--gold); background: rgba(243,201,130,.09); }
.conversation-item.is-renaming { display: block; padding: 3px; border-color: rgba(255,226,168,.28); background: rgba(243,201,130,.06); }
.conversation-rename-form { width: 100%; }
.conversation-rename-input {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  border: 1px solid rgba(255,226,168,.38);
  border-radius: 5px;
  outline: 0;
  color: var(--ivory);
  background: rgba(5,5,4,.88);
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 0 0 3px rgba(243,201,130,.045);
  font: 400 12px/1 "Inter", system-ui, sans-serif;
}
.conversation-rename-input:focus { border-color: rgba(255,226,168,.64); box-shadow: 0 0 0 3px rgba(243,201,130,.08); }
.conversation-rename-input:invalid { border-color: rgba(200,129,120,.7); }
.conversation-popover {
  position: fixed;
  z-index: 80;
  display: grid;
  width: 184px;
  padding: 6px;
  border: 1px solid rgba(243,217,177,.22);
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(27,23,17,.98), rgba(12,10,8,.99));
  box-shadow: 0 18px 48px rgba(0,0,0,.62), inset 0 1px rgba(255,255,255,.035);
}
.conversation-action {
  min-height: 40px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  color: rgba(245,238,228,.88);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}
.conversation-action:hover, .conversation-action:focus-visible { color: var(--ivory); background: rgba(255,238,210,.06); }
.conversation-action-delete { color: #dfaaa2; }
.conversation-action-delete:hover, .conversation-action-delete:focus-visible { color: #f0bbb2; background: rgba(200,129,120,.1); }
.conversation-popover.is-confirming { width: 214px; padding: 12px; }
.conversation-popover.is-confirming p { margin: 0 0 11px; color: rgba(245,238,228,.88); font-size: 12px; line-height: 1.45; }
.conversation-confirm-actions { display: flex; justify-content: flex-end; gap: 7px; }
.conversation-confirm-actions button { min-height: 36px; padding: 0 12px; border-radius: 999px; cursor: pointer; font-size: 11px; }
.conversation-confirm-cancel { border: 1px solid rgba(243,217,177,.23); color: var(--ivory); background: rgba(255,255,255,.02); }
.conversation-confirm-delete { border: 1px solid rgba(224,169,157,.38); color: #1a0e0c; background: linear-gradient(145deg, #edc0b7, #c88178); }
.conversation-confirm-cancel:hover { border-color: rgba(255,226,168,.48); background: rgba(255,238,210,.055); }
.conversation-confirm-delete:hover { box-shadow: 0 0 18px rgba(200,129,120,.2); }
.sidebar-status { margin: 18px 11px; color: rgba(167,155,139,.58); font-size: 11px; line-height: 1.5; }

.account-area { position:relative; flex:0 0 auto; padding-top:12px; border-top:1px solid var(--line); }
.account-button { display: grid; width: 100%; min-height: 54px; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 9px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; }
.account-button:hover, .account-button[aria-expanded="true"] { background: rgba(255, 238, 210, .045); }
.account-initial { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255,226,168,.24); border-radius: 50%; color: var(--gold); background: radial-gradient(circle, rgba(217,154,82,.16), rgba(12,10,8,.9)); font-family: "Cormorant Garamond", Georgia, serif; font-size: 18px; }
.account-copy { min-width: 0; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { color: rgba(245,238,228,.87); font-size: 12px; font-weight: 400; }
.account-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.account-more { color: var(--muted); font-size: 18px; }
.account-menu { position: absolute; z-index: 4; right: 0; bottom: calc(100% + 8px); left: 0; padding: 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: #100e0b; box-shadow: 0 18px 48px rgba(0,0,0,.55); }
.account-menu p { overflow: hidden; margin: 3px 7px 8px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.account-menu button { display: flex; width: 100%; min-height: 42px; align-items: center; gap: 9px; padding: 0 9px; border: 0; border-radius: 6px; color: var(--ivory); background: transparent; cursor: pointer; font-size: 12px; }
.account-menu button:hover { background: rgba(200,129,120,.08); }
.sidebar-backdrop { display: none; }

.memory-dashboard { position:fixed; z-index:100; inset:0; display:grid; place-items:center; padding:28px; }
.memory-dashboard-backdrop { position:absolute; inset:0; border:0; background:rgba(0,0,0,.76); backdrop-filter:blur(8px); }
.memory-dashboard-panel { position:relative; display:grid; width:min(920px,100%); max-height:min(860px,calc(100svh - 56px)); grid-template-rows:auto auto minmax(0,1fr); overflow:hidden; border:1px solid rgba(243,217,177,.22); border-radius:16px; background:linear-gradient(155deg,rgba(20,17,13,.99),rgba(7,6,5,.995)); box-shadow:0 28px 90px rgba(0,0,0,.72),inset 0 1px rgba(255,255,255,.035); }
.memory-dashboard-header { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; padding:28px 30px 22px; border-bottom:1px solid var(--line); }
.memory-dashboard-header p { margin:0 0 7px; color:var(--champagne); font-size:9px; font-weight:500; letter-spacing:.15em; text-transform:uppercase; }
.memory-dashboard-header h2 { margin:0; font:500 35px/1 "Cormorant Garamond",Georgia,serif; }
.memory-dashboard-header span { display:block; margin-top:8px; color:var(--muted); font-size:11px; }
.memory-dashboard-close { width:42px; height:42px; flex:0 0 auto; border:1px solid var(--line); border-radius:50%; color:var(--ivory); background:rgba(255,255,255,.02); cursor:pointer; font-size:25px; font-weight:300; }
.memory-dashboard-close:hover { border-color:var(--line-strong); background:rgba(255,238,210,.055); }
.memory-dashboard-status { min-height:18px; margin:14px 30px 0; color:var(--champagne); font-size:11px; }
.memory-dashboard-status.is-error { color:#e7a49c; }
.memory-dashboard-content { min-height:0; padding:8px 30px 32px; overflow-y:auto; scrollbar-color:rgba(243,201,130,.2) transparent; }
.memory-empty { display:grid; min-height:260px; place-items:center; color:var(--muted); text-align:center; font:400 22px/1.4 "Cormorant Garamond",Georgia,serif; }
.memory-group + .memory-group { margin-top:30px; }
.memory-group h3 { margin:0 0 11px; color:rgba(243,201,130,.76); font-size:9px; font-weight:500; letter-spacing:.15em; text-transform:uppercase; }
.memory-group-list { display:grid; gap:8px; }
.memory-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; align-items:center; padding:17px 18px; border:1px solid rgba(243,217,177,.12); border-radius:10px; background:rgba(255,244,224,.027); }
.memory-card-copy p { margin:0; color:rgba(245,238,228,.92); font-size:13px; line-height:1.6; }
.memory-card-copy small { display:block; margin-top:7px; color:rgba(167,155,139,.65); font-size:9px; }
.memory-card-actions { display:flex; gap:6px; }
.memory-card-actions button { min-height:34px; padding:0 11px; border:1px solid rgba(243,217,177,.17); border-radius:999px; color:rgba(245,238,228,.78); background:transparent; cursor:pointer; font-size:10px; }
.memory-card-actions button:hover { border-color:rgba(255,226,168,.4); color:var(--gold); background:rgba(255,238,210,.05); }
.memory-card-actions .memory-delete,.memory-card-actions .memory-confirm-delete { color:#dfaaa2; }
.memory-edit-form { grid-column:1/-1; display:grid; gap:11px; }
.memory-edit-form textarea { width:100%; min-height:92px; padding:13px 14px; resize:vertical; border:1px solid rgba(255,226,168,.3); border-radius:8px; outline:0; color:var(--ivory); background:rgba(5,5,4,.78); font-size:13px; line-height:1.55; }
.memory-edit-form textarea:focus { border-color:rgba(255,226,168,.58); box-shadow:0 0 0 3px rgba(243,201,130,.06); }
.memory-edit-actions { display:flex; justify-content:flex-end; gap:7px; }
.memory-edit-actions button { min-height:36px; padding:0 14px; border-radius:999px; cursor:pointer; font-size:10px; }
.memory-edit-cancel { border:1px solid var(--line); color:var(--ivory); background:transparent; }
.memory-edit-save { border:1px solid rgba(255,236,202,.65); color:#171109; background:linear-gradient(145deg,#fff0d2,#e9b96d); }
body.memory-dashboard-open { overflow:hidden; }

.chat-main { position:relative; display: grid; min-width: 0; min-height: 0; grid-template-rows: 68px minmax(0, 1fr); background: radial-gradient(circle at 50% -15%, rgba(217,154,82,.065), transparent 34%), var(--black); }
.collaboration-context { position:absolute; z-index:4; top:68px; right:0; left:0; min-height:30px; margin:0; padding:8px 16px; border-bottom:1px solid rgba(243,217,177,.1); color:rgba(243,201,130,.74); background:rgba(10,8,6,.84); text-align:center; font-size:9px; letter-spacing:.05em; pointer-events:none; }
.collaboration-entry-greeting { position:absolute; z-index:5; top:108px; left:50%; width:min(620px,calc(100% - 32px)); margin:0; padding:13px 18px; transform:translateX(-50%); overflow-wrap:anywhere; border:1px solid rgba(243,217,177,.16); border-radius:9px; color:rgba(245,238,228,.82); background:rgba(14,12,9,.94); box-shadow:0 16px 45px rgba(0,0,0,.3); text-align:center; font-size:11px; line-height:1.55; }
.legacy-group-title { display:block; padding:9px 10px 5px; color:rgba(243,201,130,.58); font-size:8px; font-weight:500; letter-spacing:.13em; text-transform:uppercase; }
.legacy-group-title:not(:first-child) { margin-top:5px; border-top:1px solid rgba(243,217,177,.09); }
.collaborator-panel-inner { width:min(780px,100%); }
.collaborator-panel-content { display:grid; gap:28px; padding-top:12px; }
.collaborator-code-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:22px; align-items:center; padding:22px; border:1px solid rgba(243,217,177,.17); border-radius:11px; background:rgba(255,244,224,.03); }
.collaborator-code-card small { display:block; margin-bottom:9px; color:var(--champagne); font-size:8px; letter-spacing:.14em; text-transform:uppercase; }
.collaborator-code-card strong { display:block; color:#fff0d2; font:500 29px/1 "Cormorant Garamond",serif; letter-spacing:.08em; }
.collaborator-code-card strong.is-disabled { color:var(--muted); }
.collaborator-code-card p { margin:10px 0 0;color:var(--muted);font-size:10px;line-height:1.5; }
.collaborator-code-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.collaborator-code-actions button,.collaborator-row button { min-height:36px;padding:0 13px;border:1px solid rgba(243,217,177,.22);border-radius:999px;color:var(--ivory);background:transparent;cursor:pointer;font-size:10px; }
.collaborator-code-actions button:hover,.collaborator-row button:hover { border-color:rgba(255,226,168,.5);color:var(--gold);background:rgba(255,238,210,.05); }
.collaborator-code-actions button:disabled { opacity:.4;cursor:default; }
.collaborator-list-section h3 { margin:0 0 10px;color:rgba(243,201,130,.7);font-size:9px;letter-spacing:.14em;text-transform:uppercase; }
.collaborator-row { display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 4px;border-bottom:1px solid rgba(243,217,177,.1); }
.collaborator-row strong,.collaborator-row small { display:block; }.collaborator-row strong{font-size:12px;font-weight:400}.collaborator-row small{margin-top:5px;color:var(--muted);font-size:9px}.collaborator-row .collaborator-remove{color:#dfaaa2}.collaborator-empty{padding:30px 0;color:var(--muted);font:400 20px/1.4 "Cormorant Garamond",serif;text-align:center}
.legacy-code-card { border-color:rgba(143,187,177,.23);background:linear-gradient(145deg,rgba(116,173,160,.055),rgba(255,244,224,.025)); }
.legacy-code-card small { color:#b9d8cf; }
.code-distinction { display:flex;gap:10px;padding:12px 15px;border-left:2px solid rgba(143,187,177,.4);color:var(--muted);font-size:9px;line-height:1.5; }
.code-distinction strong { flex:0 0 auto;color:rgba(220,238,232,.82);font-weight:500; }
.access-panel-inner{width:min(900px,100%)}.access-panel-content{display:grid;gap:22px;padding-top:12px}.access-owner-summary{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:15px 18px;border:1px solid rgba(243,217,177,.12);border-radius:10px;background:rgba(255,244,224,.025)}.access-owner-summary small,.access-invite-card small{display:block;color:var(--champagne);font-size:8px;letter-spacing:.14em;text-transform:uppercase}.access-owner-summary strong{display:block;margin-top:5px;font-size:12px;font-weight:400}.access-owner-summary p{margin:0;color:var(--muted);font-size:10px}.access-owner-summary b{color:var(--ivory);font-weight:500}.access-invite-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,.8fr);gap:24px;padding:20px;border:1px solid rgba(243,217,177,.17);border-radius:11px;background:linear-gradient(145deg,rgba(255,226,168,.05),rgba(255,244,224,.02))}.access-invite-card h3{margin:7px 0 4px;font:500 24px/1 "Cormorant Garamond",serif}.access-invite-card p{margin:0;color:var(--muted);font-size:10px;line-height:1.5}.access-invite-card form{display:grid;gap:8px}.access-invite-card input,.access-invite-card select{min-height:39px;padding:0 12px;border:1px solid rgba(243,217,177,.2);border-radius:7px;outline:0;color:var(--ivory);background:#0b0907;font-size:10px}.access-invite-card button{min-height:39px;border:1px solid rgba(255,236,202,.6);border-radius:999px;color:#171109;background:linear-gradient(145deg,#fff0d2,#e9b96d);cursor:pointer;font-size:10px}.access-code-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.access-code-grid .collaborator-code-card{grid-template-columns:1fr;align-content:start}.access-code-grid .collaborator-code-actions{justify-content:flex-start}.access-event-row{padding:11px 4px;border-bottom:1px solid rgba(243,217,177,.08);color:rgba(245,238,228,.76);font-size:10px}.access-event-row small{display:block;margin-top:4px;color:var(--muted)}
.chat-header { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; padding: 0 22px; border-bottom: 1px solid var(--line); }
.open-sidebar { visibility: hidden; }
.rya-heading { display: flex; align-items: center; justify-self: center; gap: 10px; }
.rya-heading h1 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 23px; font-weight: 500; line-height: 1; }
.rya-heading p { margin: 3px 0 0; color: var(--muted); font-size: 8px; letter-spacing: .08em; }

.conversation-pane { position: relative; display: grid; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
.messages { min-height: 0; overflow-y: auto; padding: 30px 0 18px; scrollbar-color: rgba(243,201,130,.2) transparent; }
.message { width: 100%; }
.message-inner { width: min(calc(100% - 48px), 840px); margin: 0 auto; padding: 17px 0 21px; }
.message-user .message-inner { padding: 14px 18px; border: 1px solid rgba(243,217,177,.13); border-radius: 8px; background: rgba(31,25,18,.48); }
.message + .message { margin-top: 6px; }
.message-label { display: block; margin-bottom: 8px; color: var(--champagne); font-size: 9px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.message-label-assistant { display: flex; align-items: center; gap: 8px; }
.message-user .message-label { color: rgba(245,238,228,.55); }
.message-content { margin: 0; color: rgba(245,238,228,.91); font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-pending .message-content::after {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255,226,168,.62);
  content: "";
  vertical-align: middle;
  animation: thinking 1.25s ease-in-out infinite;
}
.message-interrupted .message-content { color: rgba(245,238,228,.68); }

.markdown-content { white-space: normal; }
.markdown-content > :first-child { margin-top: 0; }
.markdown-content > :last-child { margin-bottom: 0; }
.markdown-content p { margin: 0 0 .82em; }
.markdown-content strong { color: #fff5df; font-weight: 600; }
.markdown-content em { color: rgba(255,232,190,.9); }
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
  margin: 1.15em 0 .42em;
  color: var(--ivory);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}
.markdown-content h1 { font-size: 26px; }
.markdown-content h2 { font-size: 22px; }
.markdown-content h3 { font-size: 18px; }
.markdown-content h4 { font-size: 15px; }
.markdown-content ul,
.markdown-content ol { margin: .55em 0 .9em; padding-left: 1.45rem; }
.markdown-content li + li { margin-top: .28em; }
.markdown-content li::marker { color: var(--champagne); }
.markdown-content blockquote {
  margin: .85em 0;
  padding: .12em 0 .12em 1rem;
  border-left: 2px solid rgba(243,201,130,.5);
  color: rgba(245,238,228,.74);
}
.markdown-content code {
  padding: .14em .38em;
  border: 1px solid rgba(243,201,130,.16);
  border-radius: 4px;
  background: rgba(255,226,168,.07);
  color: #ffe7b8;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: .9em;
}
.markdown-content pre {
  max-width: 100%;
  margin: .9em 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid rgba(243,201,130,.17);
  border-radius: 7px;
  background: rgba(4,4,3,.78);
  box-shadow: inset 0 1px rgba(255,238,200,.035);
}
.markdown-content pre code { padding: 0; border: 0; background: transparent; color: rgba(255,239,211,.9); }
.markdown-content a { color: #f3c982; text-decoration-color: rgba(243,201,130,.42); text-underline-offset: .18em; }
.markdown-content a:hover { color: #ffe2a8; text-decoration-color: currentColor; }
.markdown-content hr { margin: 1.15em 0; border: 0; border-top: 1px solid rgba(243,201,130,.16); }

.empty-state { position: absolute; z-index: 2; inset: 0 0 88px; display: grid; align-content: center; justify-items: center; padding: 20px; text-align: center; opacity: 1; transform: scale(1); transition: opacity 360ms ease, transform 360ms cubic-bezier(.22,1,.36,1); }
.empty-state.is-leaving { pointer-events: none; opacity: 0; transform: scale(.94); }
.empty-state h2 { margin: 5px 0 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(38px, 5vw, 52px); font-weight: 400; line-height: 1; }
.empty-state > p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.daily-question-card{width:min(430px,calc(100vw - 40px));margin-top:24px;padding:16px 18px;border:1px solid rgba(243,201,130,.18);border-radius:12px;background:linear-gradient(145deg,rgba(255,238,210,.045),rgba(12,10,7,.72));box-shadow:0 16px 45px rgba(0,0,0,.2);text-align:left}.daily-question-card header{display:flex;align-items:center;gap:11px}.daily-question-card header span:last-child{display:grid;gap:4px}.daily-question-card header strong{color:var(--ivory);font:500 17px/1 "Cormorant Garamond",serif}.daily-question-card small{color:var(--champagne);font-size:8px;letter-spacing:.16em;text-transform:uppercase}.daily-question-card>p{margin:11px 0 0;color:var(--muted);font-size:9px;line-height:1.45}.daily-question-card section{margin-top:14px;padding-top:13px;border-top:1px solid rgba(243,217,177,.1)}.daily-question-card section>p{margin:7px 0 12px;color:rgba(247,239,226,.94);font:400 18px/1.3 "Cormorant Garamond",serif}.daily-question-card div{display:flex;gap:8px}.daily-question-card button{padding:8px 12px;border:1px solid rgba(243,217,177,.2);border-radius:999px;color:var(--ivory);background:transparent;cursor:pointer;font-size:9px}.daily-question-card button:first-child{border-color:rgba(255,226,168,.42);color:#1b1309;background:linear-gradient(145deg,#f8e6c5,#d6a85f)}
@media(prefers-reduced-motion:reduce){.preservation-ring,.preservation-ring i{transition:none}.preservation-ring.is-completing,.journey-streak.is-milestone{animation:none}}
.progress-overview{margin:0 0 24px;padding:18px;border:1px solid rgba(243,201,130,.15);border-radius:11px;background:rgba(255,238,210,.025)}.progress-overview-header{display:flex;align-items:baseline;justify-content:space-between}.progress-overview-header strong{font:500 24px/1 "Cormorant Garamond",serif}.progress-overview-header span{color:var(--champagne);font-size:12px}.progress-track{height:3px;margin:12px 0 16px;border-radius:9px;background:rgba(255,255,255,.07);overflow:hidden}.progress-track i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#9b6d2f,#ffe0a3);box-shadow:0 0 14px rgba(243,201,130,.35)}.progress-domain{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 12px;margin-top:8px;color:var(--muted);font-size:9px}.progress-domain b{color:rgba(245,238,228,.75);font-weight:400}.progress-domain-line{grid-column:1/-1;height:2px;background:rgba(255,255,255,.05)}.progress-domain-line i{display:block;height:100%;background:rgba(243,201,130,.5)}.progress-next{margin:15px 0 0;color:rgba(245,238,228,.68);font-size:10px;line-height:1.5}.dashboard-streak-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 17px}.dashboard-streak-summary span{display:grid;gap:4px;padding:9px 10px;border:1px solid rgba(243,201,130,.09);border-radius:7px}.dashboard-streak-summary small{color:var(--muted);font-size:7px;letter-spacing:.07em;text-transform:uppercase}.dashboard-streak-summary strong{color:rgba(245,238,228,.84);font-size:10px;font-weight:400}@media(max-width:520px){.dashboard-streak-summary{grid-template-columns:1fr}.dashboard-streak-summary span{display:flex;justify-content:space-between}}
.legacy-quick-replies { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.legacy-quick-replies button { min-height: 42px; padding: 0 17px; border: 1px solid rgba(255,226,168,.25); border-radius: 999px; color: rgba(255,239,211,.9); background: rgba(255,238,210,.035); cursor: pointer; font-size: 11px; transition: transform 240ms ease, border-color 240ms ease, background 240ms ease; }
.legacy-quick-replies button:hover { border-color: rgba(255,226,168,.5); background: rgba(255,226,168,.075); transform: translateY(-1px); }
.rya-chat-visual { position: relative; width: clamp(220px, 27vw, 300px); aspect-ratio: 1; overflow: hidden; touch-action: manipulation; transition: filter 320ms ease; }
.rya-chat-visual canvas { position: relative; z-index: 1; display: block; width: 100%; height: 100%; }
.rya-chat-visual.is-paused { visibility: hidden; }
.rya-chat-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.rya-chat-fallback::before { position: absolute; width: 72%; height: 72%; border-radius: 50%; background: radial-gradient(circle, rgba(255,226,168,.18), rgba(217,154,82,.05) 48%, transparent 72%); filter: blur(8px); content: ""; }
.rya-chat-fallback span { position: relative; width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #fffaf0, #ffe2a8 46%, #d99a52); box-shadow: 0 0 16px rgba(255,240,207,.78), 0 0 48px rgba(243,201,130,.4); }
.rya-webgl-ready .rya-chat-fallback { display: none; }

.composer-wrap { position: relative; width: min(calc(100% - 48px), 840px); margin: 0 auto; padding: 10px 0 18px; background: linear-gradient(180deg, transparent, var(--black) 22%); }
.composer { position: relative; z-index: 3; display: grid; grid-template-columns: 38px minmax(0, 1fr) 46px; align-items: end; gap: 8px; padding: 8px 9px; border: 1px solid rgba(243,217,177,.24); border-radius: 24px; background: linear-gradient(180deg, rgba(255,244,224,.045), rgba(11,9,8,.92)); box-shadow: inset 0 1px rgba(255,255,255,.03), 0 14px 48px rgba(0,0,0,.32); }
.composer:has(.attachment-button:not([hidden])) { grid-template-columns: 44px 44px minmax(0, 1fr) 44px; }
.attachment-button { display: grid; width: 44px; height: 44px; align-self: center; place-items: center; padding: 0; border: 0; border-radius: 14px; color: rgba(243,217,177,.78); background: transparent; cursor: pointer; }
.attachment-button[hidden] { display: none; }
.attachment-button svg { width: 22px; height: 22px; }
.attachment-button:hover { color: var(--ivory); background: rgba(243,201,130,.08); }
.attachment-button:focus-visible { outline: 2px solid #ffe2a8; outline-offset: 2px; }
.composer:focus-within { border-color: rgba(255,226,168,.43); box-shadow: 0 0 0 3px rgba(243,201,130,.05), 0 14px 48px rgba(0,0,0,.32); }
.composer textarea { width: 100%; max-height: 150px; min-height: 44px; padding: 12px 0 8px; resize: none; overflow-y: auto; border: 0; outline: 0; color: var(--ivory); background: transparent; font-size: 14px; line-height: 1.5; }
.composer textarea::placeholder { color: rgba(167,155,139,.64); }
.send-button { display: grid; width: 46px; height: 46px; padding: 0; place-items: center; border: 1px solid rgba(255,236,202,.7); border-radius: 50%; color: #171109; background: linear-gradient(145deg, #fff0d2, #e9b96d); box-shadow: 0 6px 22px rgba(217,154,82,.2); cursor: pointer; font-size: 20px; transition: transform 280ms ease, box-shadow 280ms ease; }
.send-button:hover:not([aria-disabled="true"]) { transform: translateY(-1px) scale(1.02); box-shadow: 0 9px 28px rgba(217,154,82,.3); }
.send-button[aria-disabled="true"] { cursor: default; opacity: .32; box-shadow: none; }
.send-button.is-stopping { border-color: rgba(255,226,168,.38); color: var(--gold); background: rgba(21,17,12,.96); box-shadow: inset 0 1px rgba(255,255,255,.035), 0 0 22px rgba(217,154,82,.12); font-size: 11px; }
.send-button.is-stopping:hover { transform: translateY(-1px); box-shadow: inset 0 1px rgba(255,255,255,.05), 0 0 27px rgba(217,154,82,.2); }
.chat-status { min-height: 17px; margin: 4px 14px 0; color: var(--champagne); text-align: center; font-size: 10px; }
.chat-status.error-state { color: #e7a49c; }
.voice-icon { display: grid; width: 20px; height: 20px; place-items: center; }
.voice-icon svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.microphone-button { display: grid; width: 44px; height: 44px; align-self: center; place-items: center; padding: 0; border: 1px solid rgba(243,217,177,.14); border-radius: 14px; color: rgba(243,217,177,.78); background: rgba(255,244,224,.025); cursor: pointer; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease; }
.microphone-button:hover:not(:disabled) { border-color: rgba(255,226,168,.45); background: rgba(243,201,130,.08); }
.microphone-button.is-recording { color: #ffe7bf; border-color: rgba(243,201,130,.66); background: rgba(151,93,42,.13); box-shadow: 0 0 0 3px rgba(243,201,130,.07), 0 0 18px rgba(217,154,82,.15); }
.microphone-button.is-recording .voice-icon { animation: voice-recording-pulse 1.8s ease-in-out infinite; }
.microphone-button:disabled { opacity: .45; cursor: default; }
.message-speech-button { display: grid; width: 34px; height: 34px; margin: -7px 0 -7px auto; padding: 0; place-items: center; border: 0; border-radius: 10px; color: rgba(243,217,177,.72); background: transparent; cursor: pointer; transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.message-speech-button:hover, .message-speech-button:focus-visible { color: var(--ivory); background: rgba(243,201,130,.08); }
.message-speech-button.is-loading { color: var(--champagne); }
.message-speech-button.is-playing { color: #ffe0a3; background: rgba(243,201,130,.1); box-shadow: 0 0 16px rgba(217,154,82,.12); }
.message-speech-button.is-loading .voice-spinner { animation: voice-spinner .9s linear infinite; }
.voice-settings[hidden] { display: none; }
.voice-settings { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; }
.voice-settings-backdrop { position: absolute; inset: 0; border: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.voice-settings-panel { position: relative; width: min(100%, 500px); padding: 24px; border: 1px solid rgba(243,217,177,.24); border-radius: 16px; color: var(--ivory); background: #0d0b09; box-shadow: 0 30px 90px rgba(0,0,0,.7); }
.voice-settings-panel header { display: flex; align-items: flex-start; justify-content: space-between; }
.voice-settings-panel header small { color: var(--champagne); letter-spacing: .12em; text-transform: uppercase; }
.voice-settings-panel h2 { margin: 3px 0 0; font: 500 30px/1.1 "Cormorant Garamond", serif; }
.voice-settings-panel > p, .voice-disclosure { color: var(--muted); font-size: 12px; }
.voice-settings-panel header > button { border: 0; color: var(--ivory); background: transparent; font-size: 25px; cursor: pointer; }
.voice-options { display: grid; gap: 10px; margin: 20px 0 16px; }
.voice-options article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid rgba(243,217,177,.12); border-radius: 10px; background: rgba(255,255,255,.018); }
.voice-options article.is-selected { border-color: rgba(243,201,130,.5); box-shadow: inset 0 0 24px rgba(243,201,130,.045); }
.voice-options article > div:first-child { display: grid; gap: 3px; }
.voice-options article span { color: var(--muted); font-size: 11px; }
.voice-options article > div:last-child { display: flex; gap: 7px; }
.voice-options button { padding: 7px 10px; border: 1px solid rgba(243,217,177,.2); border-radius: 7px; color: var(--ivory); background: transparent; cursor: pointer; font-size: 11px; }
.voice-options article.is-selected [data-select-voice] { color: #090806; background: var(--champagne); }

@keyframes awareness { 0%,100% { opacity:.72; transform:scale(.94); } 52% { opacity:1; transform:scale(1.08); } }
@keyframes thinking { 0%,100% { opacity:.35; transform:scale(.72); } 50% { opacity:1; transform:scale(1); } }
@keyframes voice-recording-pulse { 0%,100% { opacity:.76; } 50% { opacity:1; } }
@keyframes voice-spinner { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .microphone-button.is-recording .voice-icon, .message-speech-button.is-loading .voice-spinner { animation: none; }
  .microphone-button, .message-speech-button { transition-duration: 0.01ms; }
}

@media (max-width: 800px) {
  .workspace { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 290px); transform: translateX(-105%); box-shadow: 20px 0 60px rgba(0,0,0,.58); transition: transform 300ms cubic-bezier(.22,1,.36,1); }
  .journey-summary { gap:6px; padding:8px 9px; }
  .preservation-ring--sidebar { width:31px; height:31px; }
  .preservation-ring--sidebar::before { width:23px; height:23px; }
  .journey-streak { gap:9px; }
  .journey-streak-copy strong b { font-size:20px; }
  .drawer-open .sidebar { transform: translateX(0); }
  .close-sidebar { display: grid; }
  .sidebar-backdrop { position: fixed; z-index: 15; inset: 0; display: block; visibility: hidden; opacity: 0; border: 0; background: rgba(0,0,0,.66); backdrop-filter: blur(3px); transition: opacity 250ms ease, visibility 250ms ease; }
  .drawer-open .sidebar-backdrop { visibility: visible; opacity: 1; }
  .chat-main { height: 100vh; height: 100svh; }
  .open-sidebar { visibility: visible; }
}

@media (max-width: 520px) {
  .chat-header { min-height: 62px; grid-template-columns: 44px minmax(0,1fr) 44px; padding: 0 10px; }
  .chat-main { grid-template-rows: 62px minmax(0,1fr); }
  .rya-heading { gap: 7px; }
  .rya-heading h1 { font-size: 21px; }
  .rya-heading p { font-size: 7px; }
  .message-inner { width: calc(100% - 28px); padding: 13px 0 17px; }
  .message-user .message-inner { padding: 12px 14px; }
  .message-content { font-size: 13px; line-height: 1.68; }
  .messages { padding-top: 19px; }
  .composer-wrap { width: calc(100% - 24px); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .composer { grid-template-columns: 44px minmax(0,1fr) 44px; padding: 6px 7px; }
  .send-button { width: 44px; height: 44px; }
  .empty-state h2 { font-size: 39px; }
  .empty-state { bottom: 80px; padding: 14px; }
  .rya-chat-visual { width: clamp(150px, 48vw, 195px); }
  .memory-dashboard { padding:0; place-items:stretch; }
  .memory-dashboard-panel { width:100%; max-height:100svh; border:0; border-radius:0; }
  .memory-dashboard-header { padding:22px 18px 18px; }
  .memory-dashboard-header h2 { font-size:31px; }
  .memory-dashboard-status { margin-right:18px; margin-left:18px; }
  .memory-dashboard-content { padding-right:18px; padding-left:18px; }
  .memory-card { grid-template-columns:1fr; gap:12px; }
  .memory-card-actions { justify-content:flex-start; }
  .collaborator-code-card { grid-template-columns:1fr; }
  .collaborator-code-actions { justify-content:flex-start; }
  .access-invite-card,.access-code-grid{grid-template-columns:1fr}.access-owner-summary{align-items:flex-start;flex-direction:column}
  .collaboration-context { top:62px; }
  .collaboration-entry-greeting { top:99px; width:calc(100% - 20px); padding:11px 12px; font-size:10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}
