/* One application surface, from a phone viewport to a desktop window. */
:root {
  --app-width: 580px;
  --canvas: #fbfaf8;
  --text: #292723;
  --secondary: #726e68;
  --hairline: #e9e4df;
  --coral: #c9503d;
  --inset: clamp(16px, 4.8vw, 28px);
}
body { color: var(--text); background: #edece9; }
#app { height: 100vh; height: 100dvh; }
.pa-shell {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%,var(--app-width)); height: 100%; margin: auto;
  isolation: isolate; overflow: hidden; background: var(--canvas);
  box-shadow: 0 0 0 1px #38332b0e, 0 0 60px #4941390b;
}
.pa-shell button:focus-visible, .pa-shell summary:focus-visible {
  outline: 2px solid var(--coral); outline-offset: 2px;
}
.app-bar {
  display: flex; justify-content: space-between; align-items: center; flex: none;
  min-height: calc(62px + env(safe-area-inset-top));
  padding: calc(8px + env(safe-area-inset-top)) var(--inset) 8px;
  background: var(--canvas); border-bottom: 1px solid var(--hairline);
}
.app-wordmark { width: 116px; height: auto; display: block; }
.app-back,.agent-status { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.app-back { color: #645f59; font-size: 15px; padding: 0 8px 0 0; }
.app-back svg { width: 17px; }
.agent-status { width: 44px; border-radius: 50%; border: 1px solid var(--hairline); background: #fff; position: relative; }
.agent-status span { position: absolute; top: -2px; right: -2px; color: #fff; background: var(--coral); border-radius: 9px; font-size: 10px; padding: 1px 4px; }
.app-tabs {
  position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--hairline);
}
.app-tabs button { min-height: 53px; display: grid; place-content: center; justify-items: center; gap: 3px; font-size: 11px; color: #77736d; }
.app-tabs .tab-icon { position: relative; display: grid; place-items: center; min-width: 40px; height: 26px; border-radius: 18px; }
.tab-icon svg { width: 19px; height: 19px; }
.tab-icon i { position: absolute; top: 0; right: 5px; background: var(--coral); border-radius: 50%; width: 7px; height: 7px; }
.app-tabs button[aria-current] { color: #a23c2c; font-weight: 600; }
.app-tabs button[aria-current] .tab-icon { background: #f9e9e2; }
.pa-chat {
  --chat-column: 680px;
  --ink: #232421;
  display:flex; flex-direction:column; min-width:0; min-height:0; color:var(--ink);
  background:#fbfaf8;
}
.chat-transcript,.secondary-page {min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;}
.chat-transcript {flex:1;padding:24px var(--inset) 22px;}
.chat-column,.chat-opening,.chat-composer {width:min(100%,var(--chat-column));margin-inline:auto;box-sizing:border-box;}
.chat-column {display:flex;flex-direction:column;gap:22px;}
.chat-timestamp {margin:0;color:#686962;font-size:12px;line-height:1.5;font-variant-numeric:tabular-nums;}
.chat-timestamp {text-align:center;}
.empty-chat {display:flex;align-items:safe center;}
.chat-opening {margin-block:auto;padding:clamp(14px,5vh,64px) 0;}
.opening-intro {display:flex;align-items:flex-start;flex-direction:column;gap:18px;}
.agent-portrait {display:grid;place-items:center;width:37px;height:37px;}
.agent-portrait img {display:block;width:100%;height:100%;}
.chat-opening h1 {
  font-family:inherit; font-size:clamp(34px,7.5vw,58px);font-weight:575;line-height:1.12;
  letter-spacing:-.055em;margin:0;text-wrap:balance;
}
:lang(zh) .chat-opening h1 {letter-spacing:-.055em;font-size:clamp(33px,7.5vw,52px);line-height:1.23;}
.reply-choices {display:grid;margin-top:clamp(28px,5vh,44px);border-top:1px solid #deded7;}
.reply-choices button {
  display:grid;grid-template-columns:35px minmax(0,1fr) 18px;align-items:center;gap:14px;
  width:100%;min-height:61px;padding:7px 4px 7px 0;background:transparent;color:var(--ink);
  text-align:left;border-bottom:1px solid #deded7;font:inherit;font-size:16px;font-weight:520;
}
.starter-icon {display:grid;place-items:center;width:34px;height:34px;background:#eeede7;border-radius:10px;color:#54594e;}
.starter-copy {display:grid;gap:2px;}
.starter-copy small {color:#6a6e63;font-size:12px;line-height:1.4;font-weight:400;}
.starter-icon svg {width:18px;height:18px;}
.reply-choices button>svg {width:15px;height:15px;justify-self:end;color:#777b71;}
.reply-choices button:hover .starter-icon,.reply-choices button:focus-visible .starter-icon {background:#f6e2d8;color:#99402e;}
.preference-row svg:last-child {width:13px;height:13px;color:#a1988f;}
.chat-message {min-width:0;display:flex;align-items:flex-start;gap:10px;font-size:15px;line-height:1.62;}
.chat-message.user {justify-content:flex-end;}
.message-avatar {display:grid;place-items:center;width:24px;height:27px;flex:0 0 24px;margin:2px 0 0;}
.message-avatar img {display:block;width:18px;height:18px;}
.message-content {min-width:0;max-width:calc(100% - 34px);overflow-wrap:anywhere;}
.chat-message.assistant .message-content:has(.cc-card) {flex:1;}
.chat-message.assistant .message-text {margin:0;padding:2px 0 4px;line-height:1.7;font-size:16px;}
.chat-message.user .message-content {max-width:85%;background:#eaeae3;color:#272921;border-radius:18px 18px 5px 18px;padding:10px 17px;}
.message-text {white-space:pre-wrap;}
.waiting {color:#6d6d66;}
.composer-region {padding:9px var(--inset) 14px;background:var(--canvas);}
.chat-composer {display:flex;align-items:center;gap:8px;padding:5px 6px 5px 10px;border:1px solid #cfcec5;border-radius:18px;background:white;box-shadow:0 2px 4px #24251d05;}
.chat-composer:focus-within {border-color:#a55a46;box-shadow:0 0 0 2px #e7c4b62e;}
.composer-action {display:grid;place-items:center;width:40px;height:40px;flex:0 0 40px;background:transparent;color:#575a52;border-radius:12px;}
.input-pill {flex:1;min-width:0;display:flex;align-items:end;gap:6px;}
.chat-composer textarea {min-width:0;flex:1;display:block;min-height:42px;height:42px;max-height:120px;border:0;outline:0;resize:none;box-shadow:none;padding:10px 5px;line-height:22px;font:inherit;font-size:16px;line-height:22px;border-radius:0;background:transparent;color:var(--text);}
.chat-composer textarea:focus {outline:0;}
.chat-composer textarea::placeholder {color:#74786f;}
.send-message {width:42px;height:42px;flex:0 0 42px;border-radius:13px;background:#282a25;color:white;display:grid;place-items:center;}
.send-message:disabled {opacity:1;color:#77796e;background:#eeeee8;}
.send-message svg {width:19px;height:19px;}
@media(min-width:780px) {
  .composer-region {padding-bottom:26px;}
  .chat-opening {padding-top:16px;}
  .reply-choices button {min-height:66px;}
}
@media(max-width:450px) {
  .chat-transcript {padding-inline:19px;}
  .empty-chat {padding-inline:26px;}
  .chat-message.assistant:has(.cc-card)>.message-avatar {display:none;}
  .chat-message.assistant .message-content:has(.cc-card) {max-width:100%;}
}
@media(max-height:650px) {
  .chat-opening {padding-block:8px;}
  .opening-intro {gap:10px;}
  .reply-choices {margin-top:18px;}
  .reply-choices button {min-height:48px;}
}
.secondary-page { padding: 20px var(--inset) 30px; background: #faf9f7; }
.profile-title { font-size: 27px; letter-spacing: -.05em; margin: 2px 0 23px; font-weight: 600; }
.settings-list { border: 1px solid var(--hairline); border-radius: 16px; padding: 0 15px; background: white; }
.sheet-list { margin-top: 18px; }
.preference-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 57px; padding: 10px 0; text-align: left; }
.preference-row strong { font-weight: 500; font-size: 15px; flex: 1; }
.preference-row small { font-size: 12px; color: #746e67; }
.preference-row>svg:first-child { color: #886959; }
.preference-row+.preference-row { border-top: 1px solid var(--hairline); }
.currency-symbol { width: 30px; height: 30px; object-fit: contain; flex: none; border-radius: 50%; }
:is(.currency-symbol, .cc-coin)[src$="/usd.svg"] { border-radius: 0; }
@media (hover:hover) {
  .reply-choices button:hover,.preference-row:hover,.app-tabs button:hover { background: #f7f3ef; }
}
@media (max-width:580px) {
  .pa-shell { width: 100%; box-shadow: none; }
}
html.soft-keyboard .app-tabs { display:none; }
html.soft-keyboard #app { height:var(--keyboard-viewport,100dvh); }
html.soft-keyboard .composer-region { padding-bottom: max(6px,env(safe-area-inset-bottom)); }

.chat-composer textarea { font-family: inherit; }

.resume-guide { align-self:center; min-height:44px; color:#844731; font-size:13px; background:transparent; }

/* Group the first prompt and suggested actions in one workspace on larger displays. */
@media (min-width: 950px) and (min-height: 620px) {
  .pa-home {justify-content:center;}
  .pa-home .empty-chat {flex:none; padding-block:0; overflow:visible;}
  .pa-home .chat-opening {padding:0; margin-block:0;}
  .pa-home .opening-intro {gap:20px;}
  .pa-home .reply-choices {grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; margin-top:34px;
    border-block:1px solid var(--hairline); padding-block:12px;}
  .pa-home .reply-choices button {position:relative; display:flex; flex-direction:column; align-items:flex-start;
    justify-content:flex-start; gap:10px; min-height:112px; border:0; padding:6px 16px; border-radius:0;}
  .pa-home .reply-choices button+button {border-left:1px solid var(--hairline);}
  .pa-home .reply-choices button>svg {position:absolute; right:14px; top:15px;}
  .pa-home .starter-copy {text-align:left; gap:5px;}
  .pa-home .starter-icon {width:30px; height:30px; background:#f4e9e2; color:#934531;}
  .pa-home .composer-region {padding-block:20px 0;}
}
