@import url('./danmuji-tokens.css');

:root {
  font-family: var(--dm-ui-font-family);
  color: var(--dm-ui-text-primary);
  background: var(--dm-ui-canvas);
  --dm-accent: var(--dm-ui-action-primary-bg);
  --dm-ink: var(--dm-ui-text-primary);
  --dm-muted: var(--dm-ui-text-secondary);
  --dm-blue: var(--dm-ui-action-primary-bg);
  --dm-border: var(--dm-ui-border);
  --dm-paper: var(--dm-ui-canvas);
  color: var(--dm-ink);
  background: var(--dm-paper);
}
body { background: var(--dm-paper); }
a { color: #3f61ad; }
:focus-visible { outline-color: var(--dm-blue); }

/* Local Lucide 1.61.0 icons share one stroke and inherit their container color. */
.ui-icon { display: inline-block; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.ui-icon-house { --icon: url('/static/assets/icons/house.svg'); }
.ui-icon-message-circle { --icon: url('/static/assets/icons/message-circle.svg'); }
.ui-icon-list-todo { --icon: url('/static/assets/icons/list-todo.svg'); }
.ui-icon-activity-bars { --icon: url('/static/assets/icons/activity-bars.svg'); }
.ui-icon-settings-gear { --icon: url('/static/assets/icons/settings-gear.svg'); }
.ui-icon-browser-window { --icon: url('/static/assets/icons/browser-window.svg'); }
.ui-icon-panel-left { --icon: url('/static/assets/icons/panel-left.svg'); }
.ui-icon-archive { --icon: url('/static/assets/icons/archive.svg'); }
.ui-icon-compass { --icon: url('/static/assets/icons/compass.svg'); }
.ui-icon-chevrons-up-down { --icon: url('/static/assets/icons/chevrons-up-down.svg'); }
.ui-icon-log-out { --icon: url('/static/assets/icons/log-out.svg'); }
.ui-icon-settings-2 { --icon: url('/static/assets/icons/settings-2.svg'); }
.ui-icon-chevron-right { --icon: url('/static/assets/icons/chevron-right.svg'); }
.ui-icon-arrow-up { --icon: url('/static/assets/icons/arrow-up.svg'); }
.ui-icon-plus { --icon: url('/static/assets/icons/plus.svg'); }
.ui-icon-bell { --icon: url('/static/assets/icons/bell.svg'); }
.ui-icon-calendar-days { --icon: url('/static/assets/icons/calendar-days.svg'); }
.ui-icon-sparkles { --icon: url('/static/assets/icons/sparkles.svg'); }
.ui-icon-circle-alert { --icon: url('/static/assets/icons/circle-alert.svg'); }
.ui-icon-check { --icon: url('/static/assets/icons/check.svg'); }
.ui-icon-loader-circle { --icon: url('/static/assets/icons/loader-circle.svg'); }
.ui-icon-globe { --icon: url('/static/assets/icons/globe.svg'); }
.ui-icon-shield-check { --icon: url('/static/assets/icons/shield-check.svg'); }
.ui-icon-phone { --icon: url('/static/assets/icons/phone.svg'); }
.ui-icon-map-pin { --icon: url('/static/assets/icons/map-pin.svg'); }
/* TASK-275 login method card and browser remote controls: Lucide 0.542.0 shapes in the same stroke. */
.ui-icon-smartphone { --icon: url('/static/assets/icons/smartphone.svg'); }
.ui-icon-mail { --icon: url('/static/assets/icons/mail.svg'); }
.ui-icon-key-round { --icon: url('/static/assets/icons/key-round.svg'); }
.ui-icon-qr-code { --icon: url('/static/assets/icons/qr-code.svg'); }
.ui-icon-circle-question-mark { --icon: url('/static/assets/icons/circle-question-mark.svg'); }
.ui-icon-log-in { --icon: url('/static/assets/icons/log-in.svg'); }
.ui-icon-apple { --icon: url('/static/assets/icons/apple.svg'); }
.ui-icon-chevron-up { --icon: url('/static/assets/icons/chevron-up.svg'); }
.ui-icon-chevron-down { --icon: url('/static/assets/icons/chevron-down.svg'); }

/* Product shell */
.danmuji-shell { grid-template-columns: 212px minmax(0, 1fr); max-width: none; background: var(--dm-paper); }
.danmuji-shell .rail { gap: 0; padding: 31px 15px 18px; background: #fffefa; border-right: 1px solid #eee8dc; }
.danmuji-shell .brand { width: max-content; padding: 0 14px; border: 0; background: transparent; text-align: left; }
.brand-wordmark { display: inline-flex; align-items: baseline; color: #202b36; font-size: 22px; font-weight: 800; letter-spacing: -.08em; line-height: 1.3; }
.brand-dot { color: var(--dm-accent); }
.rail-nav-label { margin: 48px 14px 12px; color: #5f6d78; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.danmuji-shell .nav { gap: 4px; overflow: visible; }
.danmuji-shell .nav button { gap: 13px; padding: 12px 14px; border-radius: 8px; color: #64717d; font-size: 13px; font-weight: 650; }
.danmuji-shell .nav button:hover { background: #fff8e4; color: #293847; }
.danmuji-shell .nav button.active { background: #fff0bd; color: #2b3540; }
.danmuji-shell .nav button.active .ui-icon { color: #c68a00; }
.danmuji-shell .rail-foot { padding: 0; }
.rail-extra { display: flex; align-items: center; gap: 13px; width: 100%; margin-bottom: 18px; padding: 11px 14px; border: 0; border-radius: 8px; background: transparent; color: #64717d; text-align: left; font-size: 12px; font-weight: 650; }
.rail-extra:hover { background: #fff8e4; }
.account-line { display: flex; align-items: center; border-top: 1px solid #ece7d9; padding-top: 15px; }
.danmuji-shell .account { flex: 1; min-width: 0; padding: 0 7px; border: 0; background: transparent; color: #3b4651; text-align: left; }
.danmuji-shell .account .avatar { width: 29px; height: 29px; background: #ffe178; color: #514216; }
.danmuji-shell .account .ui-icon { width: 14px; height: 14px; margin-left: auto; color: #89949e; }
.danmuji-shell .logout { display: grid; place-items: center; width: 28px; height: 30px; margin: 0; color: #80909c; }
.danmuji-shell .logout .ui-icon { width: 16px; height: 16px; }
.danmuji-shell .main { padding: 0; background: var(--dm-paper); }
.danmuji-shell .main-head { height: 66px; max-width: none; margin: 0; padding: 0 34px; border-color: #efede5; background: #fff; }
.danmuji-shell .head-title { display: flex; align-items: center; gap: 11px; }
.danmuji-shell .head-title h1 { color: #26323f; font-size: 13px; letter-spacing: -.03em; }
.danmuji-shell .head-title p { margin: 0; color: #5f6d78; font-size: 11px; }
.danmuji-shell .head-title p span { margin-right: 11px; }
.head-actions { display: flex; align-items: center; gap: 7px; }
.head-actions button { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 5px; border: 0; border-radius: 7px; background: transparent; color: #526478; }
.head-actions button:hover { background: #f4f6fa; }
.head-actions .head-back { display: inline-flex; gap: 5px; color: #526478; font-size: 11px; font-weight: 700; }
.head-actions .head-back .ui-icon { transform: rotate(180deg); width: 15px; height: 15px; }
.danmuji-shell .main-content { width: 100%; max-width: 1150px; margin: 0 auto; padding: 25px 34px 35px; }
.danmuji-shell .main-chat .main-content { max-width: 860px; padding-top: 0; }
.mobile-nav .ui-icon { display: block; margin: auto; }

/* Branded mascot: the source image stays still in message rows; featured instances move. */
.mascot { display: block; width: 34px; height: 34px; border: 0; border-radius: 0; background: none; box-shadow: none; object-fit: contain; transform: none; }
.message > .mascot { width: 31px; height: 33px; margin-top: 0; }
.welcome-mascot, .login-mascot { position: relative; display: grid; place-items: center; background: #fff3c2; border-radius: 50%; }
.welcome-mascot { width: 130px; height: 130px; margin-bottom: 22px; transform: none; }
.welcome-mascot .mascot { width: 105px; height: 110px; animation: danmuji-idle 3.6s ease-in-out infinite; }
.login-mascot { width: 145px; height: 145px; margin-bottom: 28px; }
.login-mascot .mascot { width: 125px; height: 132px; animation: danmuji-idle 3.6s ease-in-out infinite; }

/* Today: the mockup's structure uses only real account data. */
.home { width: 100%; }
.home-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 194px; }
.home-date { color: #876000; font-size: 11px; font-weight: 700; }
.home-intro h2 { margin: 13px 0 10px; color: #202c38; font-size: clamp(26px, 3vw, 34px); font-weight: 750; line-height: 1.35; letter-spacing: -.075em; }
.home-intro p { margin: 0; color: #667785; font-size: 13px; line-height: 1.7; }
.home-mascot { position: relative; display: grid; place-items: center; width: 210px; height: 180px; flex: none; }
.home-mascot-stage { position: relative; width: 151px; height: 170px; animation: home-mascot-bounce 3.6s ease-in-out infinite; }
.home-mascot-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; transform-origin: center bottom; opacity: 0; animation-duration: 18s; animation-timing-function: linear; animation-iteration-count: infinite; }
.home-mascot-idle { opacity: 1; animation-name: home-mascot-idle; }
.home-mascot-question { transform: translateX(3%); animation-name: home-mascot-question; }
.home-mascot-reminder { transform: translateX(1%) scale(1.16); animation-name: home-mascot-reminder; }
.home-mascot-phone { transform: translateX(6%) scale(1.1); animation-name: home-mascot-phone; }
.home-mascot-celebrate { transform: scale(1.3); animation-name: home-mascot-celebrate; }
@keyframes home-mascot-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes home-mascot-idle { 0%, 8%, 10%, 19.5%, 78%, 100% { opacity: 1; } 8.5%, 9.5%, 20%, 77.5% { opacity: 0; } }
@keyframes home-mascot-question { 0%, 19.5%, 38%, 100% { opacity: 0; } 20%, 37.5% { opacity: 1; } }
@keyframes home-mascot-reminder { 0%, 37.5%, 56%, 100% { opacity: 0; } 38%, 55.5% { opacity: 1; } }
@keyframes home-mascot-phone { 0%, 55.5%, 74%, 100% { opacity: 0; } 56%, 73.5% { opacity: 1; } }
@keyframes home-mascot-celebrate { 0%, 8%, 10%, 73.5%, 78%, 100% { opacity: 0; } 8.5%, 9.5%, 74%, 77.5% { opacity: 1; } }
.home-columns { display: grid; grid-template-columns: minmax(0, 1.47fr) minmax(260px, .85fr); gap: 17px; }
.home-brief, .home-work, .home-approval { min-width: 0; border-radius: 12px; }
.home-brief { padding: 23px 24px 20px; border: 1px solid var(--dm-border); background: #fff; box-shadow: 0 5px 20px #434d5809; }
.home-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.home-card-head h3 { margin: 0; color: #25313d; font-size: 16px; letter-spacing: -.05em; }
.home-card-head p { margin: 5px 0 0; color: #647564; font-size: 11px; }
.home-link { display: flex; align-items: center; gap: 4px; padding: 2px 0; border: 0; background: transparent; color: #4666ad; font-size: 11px; font-weight: 700; white-space: nowrap; }
.home-link .ui-icon { width: 14px; height: 14px; }
.home-agenda { min-height: 218px; margin-top: 21px; border-top: 1px solid #e9ece6; }
.home-agenda-row { display: grid; grid-template-columns: 55px minmax(0,1fr) 18px; align-items: center; gap: 10px; min-height: 72px; padding: 11px 0; border-bottom: 1px solid #edf0eb; }
.home-time { color: #607383; font-size: 12px; font-weight: 650; }
.home-agenda-row strong { display: block; color: #293542; font-size: 12px; }
.home-agenda-row small { display: block; margin-top: 4px; color: #5f6d78; font-size: 11px; }
.home-agenda-row > .ui-icon { width: 15px; height: 15px; color: #8099ac; }
.home-empty { display: flex; flex-direction: column; justify-content: center; gap: 7px; min-height: 215px; padding: 20px 2px; color: #617383; }
.home-empty strong { color: #334453; font-size: 13px; }
.home-empty span { font-size: 11px; line-height: 1.6; }
.home-insight { display: flex; gap: 11px; align-items: flex-start; margin-top: 18px; padding: 14px 15px; border-radius: 8px; background: #eef5ff; }
.home-insight > .ui-icon { color: #5377c8; }
.home-insight strong { color: #31579f; font-size: 11px; }
.home-insight p { margin: 3px 0 0; color: #526987; font-size: 11px; line-height: 1.6; }
.home-insight button { margin-top: 6px; padding: 0; border: 0; background: transparent; color: #375fb7; font-size: 11px; font-weight: 700; }
.home-side { display: flex; flex-direction: column; gap: 15px; }
.home-work { display: flex; flex: 1; flex-direction: column; min-height: 248px; padding: 21px 20px 19px; border: 1px solid #d6e7fb; background: #e9f3ff; }
.home-work .home-card-head h3 { font-size: 13px; }
.home-count { padding: 5px 8px; border-radius: 999px; background: #fff; color: #3c69ad; font-size: 10px; font-weight: 700; }
.home-work-item { display: grid; gap: 7px; margin-top: 16px; }
.home-work-item strong { color: #2d4058; font-size: 12px; line-height: 1.45; }
.home-status { display: flex; align-items: center; gap: 6px; color: #456fb5; font-size: 10px; font-weight: 700; }
.home-status-dot { width: 5px; height: 5px; border-radius: 50%; background: #4777d4; animation: danmuji-pulse 1.7s ease-in-out infinite; }
.home-work-empty { margin-top: 20px; color: #4d6481; font-size: 11px; line-height: 1.7; }
.home-work-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid #c8daf1; text-align: right; }
.home-work-footer button { display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: transparent; color: #3c63b3; font-size: 11px; font-weight: 700; }
.home-work-footer .ui-icon { width: 14px; height: 14px; }
.home-approval { padding: 16px 19px; border: 1px solid #f2e4bf; background: #fffaf0; }
.home-approval-label { display: flex; align-items: center; gap: 7px; color: #805d00; font-size: 11px; }
.home-approval-label .ui-icon { width: 15px; height: 15px; }
.home-approval p { margin: 8px 0 9px; color: #33404b; font-size: 11px; font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; }
.home-approval button { display: flex; align-items: center; gap: 3px; padding: 0; border: 0; background: transparent; color: #8e6500; font-size: 11px; font-weight: 700; }
.home-approval button .ui-icon { width: 14px; height: 14px; }
.home-composer { display: flex; align-items: center; gap: 12px; margin-top: 17px; padding: 10px 11px 10px 16px; border: 1px solid #e5e4df; border-radius: 12px; background: #fff; box-shadow: 0 8px 25px #48586b12; }
.home-composer > span { color: #8e9e90; }
.home-composer input { min-width: 0; flex: 1; border: 0; background: transparent; color: #354039; font-size: 13px; }
.home-composer input::placeholder { color: #7d8b7f; }
.home-composer button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--dm-blue); color: #fff; }
.home-composer button .ui-icon { width: 16px; height: 16px; }
.home-note { margin: 9px 0 0; color: #5f6d78; text-align: center; font-size: 11px; }

/* Existing screens use the same colors, type hierarchy, and radii. */
.section-kicker { color: #876000; font-size: 11px; }
.section-intro h2, .chat-welcome h2 { color: #202c38; }
.section-intro p, .chat-welcome p { color: #687786; }
.panel, .row, .explore-card, .library-summary button { border-color: var(--dm-border); border-radius: 12px; background: #fff; }
.panel h2, .section-heading h3, .row strong, .result-row strong { color: #293643; }
.muted, .row small, .result-row small, .empty-note { color: #687786; }
.primary, .send-button { border-radius: 8px; background: var(--dm-blue); color: #fff; }
.secondary, .row button { border-color: #d8e3f4; color: #3f61ad; }
.form input, .form textarea, .form select { border-color: #dbe2e8; color: #26323e; }
.form input:focus, .form textarea:focus, .form select:focus { border-color: #7190d8; box-shadow: 0 0 0 3px #c9d8fb; }
.bubble.user { background: #e9f3ff; color: #253d5e; }
.bubble.assistant { color: #344050; }
.composer { border-color: #dce4ec; border-radius: 12px; box-shadow: 0 8px 25px #48586b12; }
.composer:focus-within { border-color: #7190d8; box-shadow: 0 0 0 3px #c9d8fb; }
.composer textarea { color: #26323e; }
.composer textarea::placeholder { color: #7d8b7f; }
.composer-note { color: #73818a; font-size: 11px; }
.chat-toolbar { color: #687786; }
.chat-toolbar button { border-color: #e5e9ef; color: #4964a9; }
.chat-toolbar button .ui-icon { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.attach-button .ui-icon { width: 19px; height: 19px; }
.send-button .ui-icon { width: 18px; height: 18px; }
.progress-toggle { border-color: #dce6f2; background: #f5f8ff; color: #344050; }
.progress-meta { color: #687786; }
.is-running .progress-icon { color: #5175bf; }
.progress-icon .ui-icon { width: 16px; height: 16px; vertical-align: -3px; }
.is-running .progress-icon .ui-icon { animation: danmuji-spin 1.8s linear infinite; }
.progress-steps { border-color: #d5e2f4; color: #586d85; }
.progress-steps li.running { color: #456ac0; }
.profile-hero { border-radius: 12px; background: #fff3c2; }
.profile-hero h2 { color: #26323e; }
.setting-icon, .explore-icon { color: #5175bf; }
.explore-icon, .setting-icon { display: grid; place-items: center; }
.explore-icon .ui-icon, .setting-icon .ui-icon { width: 22px; height: 22px; }
.setting-row strong, .explore-card strong { color: #293643; }
.setting-row small, .explore-card small { color: #687786; }
.text-link, .link-button, .setting-row b, .explore-card b { color: #4567b4; }
.login-wrap { background: radial-gradient(circle at 50% 25%, #fff1af 0, #fffdf8 55%, #eff6ff 100%); }
.login-card { border-color: #eee8d8; border-radius: 17px; box-shadow: 0 20px 60px #48586b18; }
.login-card h1 { color: #202c38; }
.login-card p { color: #657686; }
.toast { background: #263746; }

@keyframes danmuji-idle { 0%,100% { transform: translateY(1px) rotate(-1deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes danmuji-pulse { 0%,100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes danmuji-spin { to { transform: rotate(360deg); } }

@media (max-width: 850px) {
  .danmuji-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .danmuji-shell .main-content { padding-inline: 22px; }
  .home-columns { grid-template-columns: 1fr; }
  .home-side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .danmuji-shell { display: block; }
  .danmuji-shell .rail { display: none; }
  .danmuji-shell .main-head { height: 62px; padding: 0 18px; }
  .danmuji-shell .main-head .mobile-brand { display: flex; }
  .danmuji-shell .main-head .head-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .danmuji-shell .main-content { padding: 18px 16px 25px; }
  .danmuji-shell .main-chat .main-content { padding-top: 0; }
  .mobile-nav { border-top-color: #e9e8e2; background: #fff; }
  .mobile-nav button { gap: 5px; color: #5f6d78; }
  .mobile-nav button.active { color: #4568b6; }
  .mobile-nav button .ui-icon { width: 20px; height: 20px; }
  .mobile-nav button span:last-child { font-size: 10px; line-height: 1.1; }
  .home-intro { min-height: 168px; }
  .home-mascot { width: 160px; height: 160px; }
  .home-mascot-stage { width: 125px; height: 141px; }
  .home-side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .home-intro { align-items: flex-start; gap: 0; min-height: 174px; }
  .home-intro > div:first-child { padding-top: 17px; }
  .home-intro h2 { max-width: 260px; font-size: 24px; }
  .home-intro p { max-width: 240px; font-size: 11px; }
  .home-mascot { align-self: flex-end; width: 115px; height: 145px; margin-left: -15px; }
  .home-mascot-stage { width: 102px; height: 115px; }
  .home-brief { padding: 20px 17px 17px; }
  .home-side { display: flex; }
  .home-work { min-height: 195px; }
  .home-approval { min-height: 110px; }
  .home-composer { margin-top: 15px; }
  .home-note { padding-bottom: 12px; }
  .welcome-mascot { width: 104px; height: 104px; }
  .welcome-mascot .mascot { width: 85px; height: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-mascot-stage, .home-mascot-frame, .home-status-dot,
  .welcome-mascot .mascot, .login-mascot .mascot, .is-running .progress-icon .ui-icon { animation: none; }
  .home-mascot-frame { opacity: 0; }
  .home-mascot-idle { opacity: 1; }
}
