@font-face{font-family:"Söhne";font-weight:100 900;font-display:swap;src:url("assets/fonts/soehne.ttf") format("truetype")}
  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
  :root {
    --bg: #FFFFFF;
    --surface: #F4F4F4;
    --surface-2: #FFFFFF;
    --surface-3: #ECECEC;
    --user-bubble: #F4F4F4;
    --text: #0D0D0D;
    --text-2: #5D5D5D;
    --text-3: #9B9B9B;
    --divider: rgba(0,0,0,0.10);
    --fill-soft: rgba(0,0,0,0.05);
    --fill-soft-2: rgba(0,0,0,0.07);
    --press: rgba(0,0,0,0.05);
    --ease: cubic-bezier(0.2, 0, 0, 1);
    --ease-emph: cubic-bezier(0.3, 0, 0, 1);
  }
  html, body {
    height: 100%;
    font-family: "Söhne", -apple-system, "PingFang SC", system-ui, "Inter", sans-serif;
    background: #e9e9ec;
  }
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 0;
    gap: 14px;
  }

  /* ===== Phone Frame ===== */
  .phone {
    position: relative;
    width: 390px;
    height: 844px;
    background: var(--bg);
    border-radius: 54px;
    box-shadow: 0 0 0 11px #0d0d0f, 0 0 0 13px #2a2a2e, 0 40px 90px rgba(0,0,0,0.4);
    overflow: hidden;
  }
  .notch {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 150px; height: 32px;
    background: #000;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 60;
  }
  /* status bar */
  .statusbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 30px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    z-index: 55;
    pointer-events: none;
  }
  .statusbar .right-icons { display: flex; align-items: center; gap: 6px; }

  /* ===== Top Bar ===== */
  .topbar {
    position: absolute;
    top: 54px; left: 0; right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    z-index: 40;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s var(--ease);
  }
  .topbar.scrolled { border-bottom: 1px solid var(--divider); }
  .icon-btn {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent;
    color: var(--text); border-radius: 100px;
    cursor: pointer;
    transition: background .12s var(--ease), transform .1s var(--ease);
  }
  .icon-btn:active { background: var(--press); transform: scale(0.92); }
  .topbar-right { display: flex; align-items: center; }

  .model-selector {
    display: flex; align-items: center; gap: 5px;
    height: 38px; padding: 0 12px;
    background: transparent; border: none;
    color: var(--text); border-radius: 100px;
    cursor: pointer; font-size: 16px; font-weight: 600;
    transition: background .12s var(--ease), transform .1s var(--ease);
  }
  .model-selector:active { background: var(--press); transform: scale(0.97); }
  .model-selector .sub { color: var(--text-3); font-weight: 500; }
  .model-selector svg { color: var(--text-3); transition: transform .2s var(--ease); }
  .model-selector.open svg { transform: rotate(180deg); }

  /* ===== Privacy banner ===== */
  .privacy-banner {
    position: absolute;
    top: 110px; left: 0; right: 0;
    height: 0;
    overflow: hidden;
    display: flex; align-items: center; gap: 8px;
    padding: 0 16px;
    background: var(--fill-soft);
    color: var(--text-2);
    font-size: 13px; font-weight: 500;
    z-index: 39;
    transition: height .25s var(--ease-emph);
    border-bottom: 1px solid transparent;
  }
  .privacy-banner.on { height: 38px; border-bottom: 1px solid var(--divider); }

  /* ===== Chat Scroll ===== */
  .chat-scroll {
    position: absolute;
    top: 110px; bottom: 0; left: 0; right: 0;
    overflow-y: auto;
    padding: 14px 16px 160px;
    scroll-behavior: smooth;
    transition: top .25s var(--ease-emph);
  }
  .chat-scroll.privacy { top: 148px; }
  .chat-scroll::-webkit-scrollbar { width: 0; }

  .day-divider {
    text-align: center;
    color: var(--text-3);
    font-size: 12px;
    margin: 4px 0 16px;
  }

  /* message rows */
  .msg { display: flex; margin-bottom: 22px; animation: fadeUp .35s var(--ease) both; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  .msg.user { justify-content: flex-end; }
  .msg.ai { justify-content: flex-start; }
  .avatar { display: none; }
  .bubble-user {
    max-width: 78%;
    background: var(--user-bubble);
    color: var(--text);
    padding: 11px 16px;
    border-radius: 24px;
    font-size: 16px; line-height: 1.5;
    border-bottom-right-radius: 8px;
  }
  .bubble-ai {
    max-width: 100%;
    color: var(--text);
    font-size: 16px; line-height: 1.6;
    padding-top: 3px;
  }
  .bubble-ai p { margin-bottom: 9px; }
  .bubble-ai p:last-child { margin-bottom: 0; }

  .tag {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 9px;
    border-radius: 100px;
    font-size: 11px; font-weight: 600;
    margin-bottom: 8px;
    background: transparent; border: 1px solid var(--divider); color: var(--text-2);
  }
  .tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

  /* task card */
  .task-card {
    margin-top: 4px;
    background: var(--surface-2);
    border: 1px solid var(--divider);
    border-radius: 20px;
    padding: 16px;
    max-width: 100%;
  }
  .task-card .tc-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
  .task-card .tc-ico {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 11px;
    background: var(--surface-2);
    border: 1px solid var(--divider);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
  }
  .task-card .tc-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
  .task-card .tc-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
  .task-card .tc-status {
    margin-left: auto; flex-shrink: 0;
    font-size: 11px; font-weight: 600;
    color: var(--text-2);
    display: flex; align-items: center; gap: 5px;
  }
  .task-card .tc-status .pulse {
    width: 7px; height: 7px; border-radius: 50%; background: var(--text-2);
    animation: pulse 1.4s ease-in-out infinite;
  }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

  .progress-wrap { margin: 6px 0 14px; }
  .progress-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 7px; }
  .progress-track {
    height: 6px; border-radius: 100px;
    background: rgba(0,0,0,0.10);
    overflow: hidden;
  }
  .progress-fill {
    height: 100%; border-radius: 100px;
    background: #0D0D0D;
    width: 64%;
    transition: width .6s var(--ease-emph);
  }
  .task-steps { list-style: none; margin: 0 0 14px; display: flex; flex-direction: column; gap: 9px; }
  .task-steps li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
  .task-steps li.done { color: var(--text-3); }
  .step-ico { width: 16px; height: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
  .step-ico.done { color: var(--text); }
  .step-ico.run { color: var(--text); }
  .step-ico.run .spin { animation: spin 1s linear infinite; transform-origin: center; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .step-ico.wait { color: var(--text-3); }

  .tc-btn {
    width: 100%; height: 44px;
    border: none; border-radius: 100px;
    background: #0D0D0D;
    color: #fff;
    font-size: 14.5px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    cursor: pointer;
    transition: transform .1s var(--ease), filter .12s var(--ease);
  }
  .tc-btn:active { transform: scale(0.97); filter: brightness(1.4); }

  /* typing indicator */
  .bubble-ai .typing { display: flex; gap: 5px; padding: 10px 2px; }
  .bubble-ai .typing span {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-3);
    animation: typing 1.3s infinite ease-in-out;
  }
  .bubble-ai .typing span:nth-child(2) { animation-delay: .18s; }
  .bubble-ai .typing span:nth-child(3) { animation-delay: .36s; }
  @keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

  /* ===== Input Bar ===== */
  .composer {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 8px 12px 26px;
    background: linear-gradient(to top, #fff 62%, rgba(255,255,255,0));
    z-index: 38;
  }
  .plus-tray {
    display: flex; gap: 10px;
    max-height: 0; overflow: hidden;
    padding: 0 4px;
    transition: max-height .25s var(--ease-emph), margin .25s var(--ease-emph), opacity .2s var(--ease);
    opacity: 0;
  }
  .plus-tray.open { max-height: 92px; margin-bottom: 10px; opacity: 1; }
  .tray-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 12px 4px;
    background: var(--surface-2);
    border: 1px solid var(--divider);
    border-radius: 18px;
    color: var(--text-2);
    cursor: pointer;
    font-size: 11.5px; font-weight: 500;
    transition: background .12s var(--ease), transform .1s var(--ease);
  }
  .tray-item:active { background: var(--press); transform: scale(0.95); }
  .tray-item .ti-ico { color: var(--text); }

  .input-row {
    display: flex; align-items: flex-end; gap: 8px;
    background: var(--bg);
    border: 1px solid var(--divider);
    border-radius: 28px;
    padding: 6px 6px 6px 8px;
    min-height: 52px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .input-row .rnd {
    width: 38px; height: 38px; flex-shrink: 0;
    border: none; background: transparent;
    color: var(--text); border-radius: 100px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .12s var(--ease), transform .1s var(--ease);
  }
  .input-row .rnd:active { background: rgba(0,0,0,0.08); transform: scale(0.9); }
  .input-field {
    flex: 1;
    border: none; background: transparent;
    color: var(--text); font-size: 16px; font-weight: 400;
    font-family: -apple-system, "PingFang SC", system-ui, sans-serif;
    resize: none; outline: none;
    padding: 9px 2px; max-height: 100px; line-height: 1.4;
  }
  .input-field::placeholder { color: var(--text-3); font-weight: 400; }
  .send-btn {
    width: 38px; height: 38px; flex-shrink: 0;
    border: none; background: #0D0D0D; color: #fff;
    border-radius: 100px;
    display: none; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform .1s var(--ease), opacity .12s var(--ease);
  }
  .send-btn:active { transform: scale(0.9); }
  /* typing state: show send, hide mic+plus */
  .composer.typing #voiceToggle,
  .composer.typing #plusBtn { display: none; }
  .composer.typing .send-btn { display: flex; }
  .voice-hint {
    flex: 1;
    display: none;
    align-items: center; justify-content: center;
    height: 40px;
    color: var(--text-2); font-size: 15px; font-weight: 500;
    border-radius: 100px;
    background: rgba(0,0,0,0.04);
    user-select: none;
  }
  .composer.voice .input-field { display: none; }
  .composer.voice .voice-hint { display: flex; }

  /* ===== Overlay / Scrim ===== */
  .scrim {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0; pointer-events: none;
    transition: opacity .25s var(--ease);
    z-index: 70;
  }
  .scrim.show { opacity: 1; pointer-events: auto; }

  /* ===== Slidebar ===== */
  .slidebar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 312px;
    background: var(--surface-2);
    z-index: 80;
    transform: translateX(-100%);
    transition: transform .3s var(--ease-emph);
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .slidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,0.25); }
  .sb-layer {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    background: var(--surface-2);
    transition: transform .3s var(--ease-emph);
  }
  .sb-main { transform: translateX(0); }
  .sb-main.pushed { transform: translateX(-26%); }
  .sb-settings { transform: translateX(100%); }
  .sb-settings.open { transform: translateX(0); box-shadow: -8px 0 30px rgba(0,0,0,0.15); }

  .sb-head {
    padding: 64px 18px 14px;
    border-bottom: 1px solid var(--divider);
  }
  .sb-head .sb-brand { display: flex; align-items: center; gap: 11px; }
  .sb-logo {
    width: 40px; height: 40px; border-radius: 13px;
    background: #0D0D0D;
    color: #fff; font-weight: 700; font-size: 19px;
    display: flex; align-items: center; justify-content: center;
  }
  .sb-name { font-size: 18px; font-weight: 700; color: var(--text); }
  .sb-status { font-size: 12.5px; color: var(--text-2); margin-top: 3px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
  .sb-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #1aa251; box-shadow: 0 0 0 3px rgba(26,162,81,0.18); }
  .sb-status .dot.off { background: transparent; border: 1.5px solid var(--text-3); box-shadow: none; }

  .sb-body { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
  .sb-body::-webkit-scrollbar { width: 0; }
  .sb-group-label {
    font-size: 11.5px; font-weight: 600;
    color: var(--text-3);
    padding: 14px 12px 6px;
    text-transform: uppercase; letter-spacing: .5px;
  }
  .sb-item {
    display: flex; align-items: center; gap: 13px;
    height: 50px; padding: 0 12px;
    border-radius: 14px;
    color: var(--text); font-size: 15px; font-weight: 500;
    cursor: pointer; border: none; background: transparent; width: 100%;
    text-align: left;
    transition: background .12s var(--ease);
  }
  .sb-item:active { background: var(--press); }
  .sb-item .si-ico { color: var(--text-2); display: flex; flex-shrink: 0; }
  .sb-item .si-arrow { margin-left: auto; color: var(--text-3); }
  .sb-divider { height: 1px; background: var(--divider); margin: 8px 12px; }

  .settings-head {
    display: flex; align-items: center; gap: 6px;
    padding: 60px 12px 12px;
    border-bottom: 1px solid var(--divider);
  }
  .settings-head .back-btn {
    width: 40px; height: 40px; border: none; background: transparent;
    color: var(--text); border-radius: 100px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s var(--ease);
  }
  .settings-head .back-btn:active { background: var(--press); }
  .settings-head .st-title { font-size: 18px; font-weight: 700; }

  /* ===== Bottom Sheet (model) ===== */
  .sheet-wrap {
    position: absolute; inset: 0; z-index: 90;
    pointer-events: none;
  }
  .sheet-scrim {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0; transition: opacity .25s var(--ease);
  }
  .sheet {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: var(--surface-2);
    border-top-left-radius: 28px; border-top-right-radius: 28px;
    transform: translateY(100%);
    transition: transform .25s var(--ease-emph);
    padding: 10px 12px calc(20px + env(safe-area-inset-bottom));
    max-height: 78%;
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.12);
  }
  .sheet::-webkit-scrollbar { width: 0; }
  .sheet-wrap.show { pointer-events: auto; }
  .sheet-wrap.show .sheet-scrim { opacity: 1; }
  .sheet-wrap.show .sheet { transform: translateY(0); }
  .sheet-grip { width: 38px; height: 5px; border-radius: 100px; background: rgba(0,0,0,0.18); margin: 6px auto 12px; }
  .sheet-title { font-size: 17px; font-weight: 700; padding: 0 8px 4px; }
  .sheet-desc { font-size: 12.5px; color: var(--text-3); padding: 0 8px 12px; line-height: 1.45; }
  .model-item {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: background .12s var(--ease);
  }
  .model-item:active { background: var(--press); }
  .mi-main { flex: 1; }
  .mi-name { font-size: 15.5px; font-weight: 500; color: var(--text); }
  .mi-name .reco { color: var(--text-2); font-size: 12px; font-weight: 600; margin-left: 7px; }
  .mi-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
  .mi-check { color: var(--text); opacity: 0; transition: opacity .12s var(--ease); flex-shrink: 0; }
  .model-item.selected .mi-check { opacity: 1; }

  /* generic action menu (3 dots) */
  .menu-pop {
    position: absolute;
    top: 104px; right: 10px;
    width: 220px;
    background: var(--surface-2);
    border: 1px solid var(--divider);
    border-radius: 18px;
    z-index: 92;
    padding: 6px;
    transform-origin: top right;
    transform: scale(0.85); opacity: 0; pointer-events: none;
    transition: transform .16s var(--ease-emph), opacity .16s var(--ease);
    box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  }
  .menu-pop.show { transform: scale(1); opacity: 1; pointer-events: auto; }
  .menu-row {
    display: flex; align-items: center; gap: 12px;
    height: 46px; padding: 0 12px;
    border-radius: 13px; cursor: pointer;
    color: var(--text); font-size: 15px; font-weight: 500;
    transition: background .12s var(--ease);
  }
  .menu-row:active { background: var(--press); }
  .menu-row .mr-ico { color: var(--text-2); display: flex; }

  /* call mode overlay */
  .call-overlay {
    position: absolute; inset: 0; z-index: 95;
    background: radial-gradient(120% 80% at 50% 0%, #f4f4f4 0%, #ffffff 70%);
    display: flex; flex-direction: column; align-items: center;
    opacity: 0; pointer-events: none;
    transition: opacity .3s var(--ease);
  }
  .call-overlay.show { opacity: 1; pointer-events: auto; }
  .call-orb {
    margin-top: 180px;
    width: 150px; height: 150px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #3a3a3a, #0d0d0d 70%);
    box-shadow: 0 12px 50px rgba(0,0,0,0.22);
    animation: orb 3s ease-in-out infinite;
  }
  @keyframes orb { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
  .call-title { color: var(--text); font-size: 22px; font-weight: 600; margin-top: 40px; }
  .call-sub { color: var(--text-2); font-size: 14px; margin-top: 8px; }
  .call-actions { margin-top: auto; margin-bottom: 70px; display: flex; gap: 28px; }
  .call-fab {
    width: 64px; height: 64px; border-radius: 50%;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text);
    transition: transform .1s var(--ease), background .15s var(--ease);
  }
  .call-fab:active { transform: scale(0.92); }
  .call-fab.mute { background: rgba(0,0,0,0.06); }
  .call-fab.video { background: #0D0D0D; color: #fff; }
  .call-fab.end { background: #0D0D0D; color: #fff; }
  /* active (engaged) state for mute = filled black */
  .call-fab.mute.muted { background: #0D0D0D; color: #fff; }
  /* icon swap: mic shows on by default, video shows off by default */
  .call-fab .ico-mic-off, .call-fab.muted .ico-mic { display: none; }
  .call-fab.muted .ico-mic-off { display: block; }
  .call-fab .ico-video, .call-fab.on .ico-video-off { display: none; }
  .call-fab.on .ico-video { display: block; }

  /* toast */
  .toast {
    position: absolute;
    bottom: 120px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0D0D0D;
    color: #fff;
    font-size: 13.5px; font-weight: 500;
    padding: 11px 18px; border-radius: 100px;
    z-index: 99; opacity: 0; pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    white-space: nowrap;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
