/* 外出工作台頁面樣式：只用內網 theme.css 的 token（--canvas、--surface、--ink*、--border-*、--brand、--on-brand），
   標頭與側欄沿用 app_header.css／grouped_workspace.css，不覆寫其外觀，只調整定位。 */
/* 基本重設：外站不載入內網的 tailwind.css，這裡補上共用樣式預期的 preflight 行為（box-sizing、連結、清單、標題間距）。 */
*, *::before, *::after { box-sizing: border-box; }
a { color: inherit; text-decoration: inherit; }
ol, ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
html { scroll-padding-top: calc(var(--app-header-live-h, 64px) + 12px); }
body { min-height: 100vh; margin: 0; }
.od-workspace { min-height: calc(100vh - var(--app-header-live-h, 64px)); }
.od-main { outline: none; max-width: 1200px; }
.od-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 12px; border-radius: 8px; background: var(--brand); color: var(--on-brand); }
.od-skip:focus { left: 12px; }
.od-icon { width: 16px; height: 16px; }
.od-user-name { color: rgb(var(--c-zinc-300)); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12em; }
.od-noscript { padding: 16px; }

.od-section { margin: 0 0 24px; }
.od-section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.od-section-link { margin-left: auto; font-size: 12px; font-weight: 500; }
.od-panel { padding: 16px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); }
.od-muted { color: var(--ink-dim); font-size: 13px; margin: 4px 0 0; }
.od-small { font-size: 12px; }
.od-loading { color: var(--ink-dim); font-size: 13px; padding: 12px 0; }
.od-link { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.od-link:hover { color: var(--brand-dark); }

.od-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.od-search .grouped-search { flex: 1 1 240px; width: auto; color: var(--ink); }
.od-search .grouped-filter { color: var(--ink); flex: 0 1 180px; }
.od-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--brand);
    border-radius: 8px; background: var(--brand); color: var(--on-brand); font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; }
.od-button:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.od-button:focus-visible, .od-card:focus-visible, .od-tab:focus-visible, .od-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.od-button-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.od-button-ghost:hover { background: var(--surface); border-color: var(--brand); color: var(--ink); }
.od-button-small { min-height: 36px; padding: 6px 12px; }

.od-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 4px; }
.od-tab { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; border: 1px solid var(--border-soft); border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: 13px; cursor: pointer; }
.od-tab:hover { color: var(--ink); border-color: var(--border-strong); }
.od-tab.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.od-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.od-list { display: flex; flex-direction: column; gap: 10px; }
.od-list-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; }
.od-list-footer .grouped-empty { width: 100%; padding: 32px 16px; }
.od-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 10px;
    background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .2s, box-shadow .2s; }
a.od-card:hover { border-color: var(--brand); box-shadow: 0 3px 12px rgb(var(--c-brand) / .08); }
.od-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.od-card-title { margin: 6px 0 0; font-size: 15px; line-height: 1.55; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.od-excerpt { margin: 6px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink-soft); overflow-wrap: anywhere; }
.od-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.od-item.is-done .od-card-title { color: var(--ink-dim); text-decoration: line-through; }
.od-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.od-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border: 1px solid var(--border-soft); border-radius: 999px;
    background: var(--canvas); color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.od-chip-brand { border-color: var(--brand); color: var(--brand); }
/* 語意色例外：逾期提醒沿用主色反白，避免另立色票。 */
.od-chip-alert { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }

.od-highlights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.od-highlight { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 8px;
    background: var(--surface); color: var(--ink); text-decoration: none; }
a.od-highlight:hover { border-color: var(--brand); }
.od-highlight-title { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }

.od-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.od-facts dt { color: var(--ink-dim); }
.od-facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.od-details { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.od-details summary { cursor: pointer; min-height: 32px; color: var(--ink-2); }
.od-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.od-table th, .od-table td { padding: 8px 6px; border-bottom: 1px solid var(--border-soft); text-align: left; }
.od-table thead th { color: var(--ink-dim); font-weight: 500; font-size: 12px; }
.od-plain-list { margin: 0; padding-left: 1.2em; list-style: disc; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

.od-note { padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); }
.od-note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.od-note-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.od-prose { margin-top: 8px; font-size: 14px; line-height: 1.8; color: var(--ink-2); overflow-wrap: anywhere; }
.od-prose p { margin: 0 0 8px; }
.od-prose ul { margin: 0 0 8px; padding-left: 1.3em; list-style: disc; }
.od-prose .od-prose-heading { font-weight: 700; color: var(--ink); }
.od-prose code { padding: 1px 4px; border-radius: 4px; background: var(--canvas); font-size: 13px; }

.od-message { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--ink); }
.od-message p { margin: 0; flex: 1 1 200px; font-size: 14px; }
.od-message-error { border-color: var(--brand); }
.od-message-warn { margin: 0 0 16px; border-style: dashed; }
.od-banner { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 12px;
    max-width: calc(100vw - 32px); padding: 10px 14px; border: 1px solid var(--brand); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 13px;
    box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
.od-banner[hidden] { display: none; }

/* 登入畫面：登出狀態不顯示側欄、使用者名稱與登出鍵。 */
.od-logout { border: 0; background: transparent; cursor: pointer; }
.od-signed-out .app-sidebar, .od-signed-out #logout, .od-signed-out #user-name { display: none; }
.od-login { display: flex; justify-content: center; padding: 24px 0; }
.od-login-panel { width: 100%; max-width: 400px; padding: 24px; }
.od-login-title { margin: 0 0 4px; font-size: 20px; font-weight: 700; color: var(--ink); }
.od-login-panel .od-message { margin: 16px 0 0; }
.od-login-form { display: flex; flex-direction: column; gap: 6px; margin-top: 20px; }
.od-login-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.od-login-label + .od-login-input { margin-bottom: 10px; }
.od-login-input { width: 100%; min-height: 44px; color: var(--ink); }
.od-login-robot:empty { display: none; }
.od-login-robot { margin: 4px 0 8px; min-height: 0; }
.od-login-status { margin: 4px 0; padding: 10px 12px; border: 1px solid var(--brand); border-radius: 8px; font-size: 13px; color: var(--ink); }
.od-login-status[hidden] { display: none; }
.od-login-submit { width: 100%; margin-top: 8px; }
.od-login-submit:disabled { opacity: .7; cursor: progress; }

@media (max-width: 767px) {
    .od-user-name { display: none; }
    .od-card-grid { grid-template-columns: minmax(0, 1fr); }
    .od-search .grouped-filter { flex: 1 1 100%; }
    .od-search .od-button { flex: 1 1 100%; }
    .od-facts { grid-template-columns: 1fr; gap: 2px; }
    .od-facts dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .od-card { transition: none; } }
