/* Shared modal surfaces, typography and compact layouts. */
:root { --state-running: #2874b4; --state-done: #247553; --state-paused: #966619; --state-error: #b44642; --state-pending: #66746a; }
:root[data-theme="dark"] { --state-running: #8abeff; --state-done: #76d9b5; --state-paused: #f1c582; --state-error: #ffa7b1; --state-pending: #a3adba; }
#view-home .studio-status.running::before, #view-create .works-status[data-state="running"]::before { background: var(--state-running); }
#view-home .studio-status.done::before, #view-create .works-status[data-state="done"]::before { background: var(--state-done); }
#view-home .studio-status.paused::before, #view-home .studio-status.attention::before, #view-home .studio-task-dot[data-state="attention"], #view-create .works-status[data-state="paused"]::before, #view-create .works-status[data-state="attention"]::before { background: var(--state-paused); }
#view-home .studio-status.error::before, #view-home .studio-status.interrupted::before, #view-home .studio-task-dot[data-state="error"], #view-home .studio-task-dot[data-state="interrupted"], #view-create .works-status[data-state="error"]::before, #view-create .works-status[data-state="interrupted"]::before { background: var(--state-error); }
#view-home .studio-status.pending::before, #view-create .works-status[data-state="pending"]::before { background: var(--state-pending); }
#view-home .studio-attention-copy { display: grid; gap: 6px; }
#view-home .studio-attention-copy strong { font-size: 12px; font-weight: 500; }
#view-home .studio-attention-copy small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.7; }
#view-home .studio-task-row .studio-attention-action { flex: none; color: var(--brand); white-space: nowrap; font-size: 11px; }
.mobile-nav-more { display: none !important; }
.experience-dialog { box-sizing: border-box; inset: 0; margin: auto; width: min(440px, calc(100% - 24px)); max-width: calc(100% - 24px); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 12px; }
.experience-dialog::backdrop { background: #07101b80; }
.experience-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.experience-dialog-head h2 { margin: 0; font-family: inherit; font-weight: 600; font-size: 18px; line-height: 1.5; }
.experience-dialog-head > button { width: 36px; min-height: 36px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-2); color: var(--text-sub); font-size: 22px; cursor: pointer; }
.experience-dialog :is(button, input, a):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.mobile-nav-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mobile-nav-options > button { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--card); color: var(--text); font-size: 13px; cursor: pointer; }
.mobile-nav-options > button[aria-current="page"] { color: var(--brand); background: var(--brand-soft); border-color: var(--brand); }
.mobile-nav-options .home-nav-item-icon { display: inline-flex; flex: 0 0 18px; width: 18px !important; height: 18px !important; background: transparent; color: inherit; }
.mobile-nav-options > button > span:last-child { min-width: 0; white-space: nowrap; }
.mobile-nav-options svg { width: 18px; height: 18px; }
.mobile-nav-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--border); font-size: 12px; }
.mobile-nav-footer button { min-height: 40px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-2); color: var(--text); cursor: pointer; }
.mobile-nav-footer a { color: var(--brand); text-decoration: none; }
.role-card-dialog > form { margin: 0; }
.role-card-dialog #chatRoleDialogDescription { margin: 0 0 16px; font-size: 13px; line-height: 1.8; color: var(--text-sub); overflow-wrap: anywhere; }
.role-card-name-field { display: grid; gap: 8px; font-size: 13px; }
.role-card-name-field[hidden] { display: none; }
.role-card-name-field input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 9px 12px; background: var(--input-bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.role-card-error { font-size: 13px; line-height: 1.7; color: var(--st-error, #b44642); margin-block: 12px 0; }
.experience-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.experience-dialog-actions button { min-height: 40px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-2); color: var(--text); font-size: 13px; cursor: pointer; }
.experience-dialog-actions button[type="submit"] { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.experience-dialog button:disabled { opacity: .6; cursor: wait; }
.experience-feedback { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 12px; margin: -5px 0 18px; font-size: 12px; line-height: 1.8; color: var(--text-sub); }
.experience-feedback[hidden] { display: none; }
.experience-feedback[data-type="err"] { color: var(--state-error); }
.experience-feedback[data-type="ok"] { color: var(--state-done); }
.experience-feedback button { padding: 2px 0; border: 0; background: transparent; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 700px) {
    .mobile-nav-options > button { padding-inline: 9px; gap: 8px; font-size: 12px; }
    .app-with-side-nav > .home-left-nav { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px !important; height: 52px !important; min-height: 52px !important; max-height: 52px !important; padding: 4px 8px !important; overflow: visible !important; }
    .home-left-nav > :is(.home-nav-group-label, .home-nav-footer, .studio-nav-intro),
    .home-left-nav > .home-nav-item:not([data-nav-key="home"]):not([data-nav-key="workspace"]):not([data-nav-key="works"]):not(.mobile-nav-more) { display: none !important; }
    .home-left-nav > .home-nav-item { display: flex !important; flex-direction: column; align-items: center; justify-content: center; flex: none !important; width: auto !important; min-width: 0 !important; height: 44px !important; min-height: 44px !important; padding: 3px 2px !important; gap: 2px !important; border: 0; font-size: 11px !important; line-height: 1.4; background: transparent; color: var(--text-sub); }
    .home-left-nav .home-nav-item-icon { width: 17px !important; height: 17px !important; display: inline-flex; }
    .home-left-nav .home-nav-item-icon svg { width: 17px; height: 17px; }
}
@media (max-width: 600px) {
    #view-home .studio-overview-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-right: 0; }
    #view-home .studio-overview-head > div { grid-column: 1 / -1; min-width: 0; }
    #view-home .studio-overview-head h2 { font-size: 22px; overflow-wrap: anywhere; }
    #view-home .studio-overview-head p { font-size: 12px; }
    #view-home .studio-overview-head > .studio-primary { grid-column: 1; grid-row: 2; justify-self: start; margin: 0; min-height: 36px; padding: 7px 12px; font-size: 12px; }
    #view-home .studio-overview-activity { position: relative; inset: auto; grid-column: 2; grid-row: 2; }
    #view-home .studio-overview-activity > summary { min-height: 36px; padding: 8px 10px; font-size: 12px; }
    #view-home .studio-overview-activity .studio-overview-rail { top: calc(100% + 8px); width: min(340px, calc(100vw - 24px)); max-height: min(440px, calc(100dvh - 250px)); }
    #view-home .studio-resume.is-empty { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    #view-home .studio-resume.is-empty > .studio-primary { grid-column: 1; min-height: 36px; padding: 8px 12px; font-size: 12px; }
    #view-home .studio-resume.is-empty h3 { font-size: 18px; line-height: 1.45; }
    #view-home .studio-resume-copy > small { font-size: 11px; }
    #view-home .studio-resume > .studio-primary { min-height: 36px; font-size: 12px; }
    #view-home :is(.studio-work-copy small, .studio-work-meta small, .studio-status, .studio-eyebrow, .studio-summary) { font-size: 11px; }
    #view-home .studio-home-flow span, #view-home .studio-home-flow b { font-size: 10px; }
    #view-home .studio-task-row { min-height: 44px; font-size: 13px; }
    #view-home .studio-task-row small { font-size: 11px; }
    #view-home .studio-text-button { min-height: 36px; font-size: 12px; }
}
@media (max-width: 600px) and (max-height: 650px) {
    #view-home .studio-overview-head > div > .studio-eyebrow { display: none; }
    #view-home .studio-overview-head h2 { font-size: 20px; margin-block: 3px; }
}
