:root {
  /* Sisense reference swatches, kept at the supplied hex values. */
  --palette-white: #efefef; --palette-blue: #d8dfe9; --palette-lime: #edff8c;
  --palette-sage: #cfe1ca; --palette-charcoal: #303030;
  --ink: var(--palette-white); --muted: rgba(239,239,239,.68); --paper: #000000; --card: var(--palette-charcoal);
  --surface-raised: #3b3b3b; --surface-soft: #242424; --line: rgba(239,239,239,.12); --brand: var(--palette-lime); --brand-dark: var(--palette-lime); --brand-light: rgba(237,255,140,.14);
  --snow-purple: var(--palette-blue); --snow-indigo: var(--palette-blue); --snow-blue: var(--palette-blue); --snow-cyan: var(--palette-blue);
  --snow-mint: var(--palette-sage); --snow-green: var(--palette-sage); --snow-yellow: var(--palette-lime); --snow-orange: var(--palette-lime); --snow-red: #ff8f87;
  --snow-purple-soft: rgba(216,223,233,.18); --snow-blue-soft: rgba(216,223,233,.18); --snow-cyan-soft: rgba(216,223,233,.18);
  --snow-mint-soft: rgba(207,225,202,.18); --snow-green-soft: rgba(207,225,202,.18); --snow-yellow-soft: rgba(237,255,140,.18); --snow-red-soft: rgba(255,143,135,.12);
  --radius-card: 16px;
  --accent: var(--palette-blue); --danger: var(--snow-red); --success: var(--palette-sage); --mint: var(--palette-sage);
  --shadow: 0 10px 30px rgba(0,0,0,.18);
  /* Urbanist 只有英文與數字，排在最前面；中文自動落到 Noto Sans TC */
  font-family: "Urbanist","Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); color-scheme: dark; font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button,input,select,textarea { font: inherit; }
button { cursor: pointer; border: 0; line-height: 1.25; }
button:focus-visible,a:focus-visible { outline: 2px solid rgba(237,255,140,.55); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; line-height: 18px; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg,#edf5f0,#dbece5); }
.login-card { width: min(100%,410px); background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 36px; box-shadow: var(--shadow); }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-weight:600; font-size: 20px; }
.brand-mark.small { width: 30px; height: 30px; border-radius: 10px; font-size: 15px; }
.login-card h1 { margin: 8px 0 4px; font-size: 30px; }
.stack-form { display: grid; gap: 14px; margin: 26px 0 18px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight:600; }
input,select,textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; color: var(--ink); outline: none; }
input:focus,select:focus,textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.button { min-height: 40px; border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 600; letter-spacing: 0; white-space: nowrap; transition: .2s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--brand); color: #fff; }
.button.secondary { background: #edf2ef; color: var(--ink); }
.button.tertiary { min-height: 36px; padding: 8px 11px; background: transparent; color: var(--muted); border: 1px solid var(--line); font-size: 12px; }
.button.tertiary:hover { color: var(--brand); background: var(--brand-light); border-color: transparent; }
.app-shell { display: flex; width:100%; min-height: 100vh; overflow-x:hidden; }
.sidebar { flex:0 0 212px; width:212px; min-width:212px; background: #fff; border-right: 1px solid var(--line); padding: 24px 14px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; font-weight:600; margin: 0 8px 36px; }
.nav-list { display: grid; gap: 5px; }

.nav-item { width: 100%; text-align: left; background: transparent; color: var(--muted); padding: 11px 13px; border-radius: 10px; font-weight: 500; }
.nav-item.active { font-weight: 600; }
.nav-item:hover,.nav-item.active { background: var(--brand-light); color: var(--brand); }
.main-content { flex:1 1 0; width:auto; min-width:0; max-width:1440px; margin:0 auto; padding:22px 28px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.topbar h2 { margin: 0; font-size: 24px; letter-spacing:0; }
.top-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.data-menu { position: relative; }
.data-menu summary { list-style: none; display: flex; align-items: center; gap: 7px; }
.data-menu summary::-webkit-details-marker { display: none; }
.data-menu summary { justify-content:center; }
.menu-chevron { width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg) translateY(-1px); transform-origin:center; transition:transform .18s ease; }
.data-menu[open] .menu-chevron { transform:rotate(225deg) translate(-1px,-1px); }
.data-menu-panel { position: absolute; z-index: 15; top: calc(100% + 8px); right: 0; width: 190px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.10); }

.menu-item { display: block; width: 100%; padding: 10px 9px; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; font-size: 13px; font-weight: 500; }
.menu-item small { display: block; margin-top: 4px; color: var(--muted); font-size:12px; font-weight: 400; line-height: 1.4; }
.menu-item:hover { background: var(--brand-light); color: var(--brand); }
.user-badge { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 8px 12px; color: var(--brand); font-size: 13px; font-weight:600; }
.toast { position: fixed; z-index: 20; right: 24px; top: 24px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transform: translateY(-8px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.error-card { padding: 28px; border: 1px solid #f0c9cd; border-radius: 12px; background: #fff7f7; color: var(--danger); }
.error-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.table-card { min-width:0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 18px; box-shadow: 0 4px 12px rgba(25,52,45,.03); }

.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }.table-card h3 { margin: 0 0 15px; font-size: 16px; }

.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:18px; }.stat-card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius-card); padding:16px 18px; min-height:108px; box-shadow:var(--shadow); }
.stat-top { display:flex; align-items:center; gap:10px; color:var(--muted); }.stat-icon { display:grid; place-items:center; width:28px; height:28px; border-radius:8px; font-size:16px; font-weight:600; }
.stat-number { font-size:30px; font-weight:600; line-height:1; margin:13px 0 10px; letter-spacing:0; }.stat-footer { display:flex; justify-content:space-between; align-items:center; color:var(--muted); font-size:12px; }.inline-action { border:0; background:transparent; color:var(--brand); padding:4px 0; font-size:12px; font-weight:600; white-space:nowrap; }
.refined-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }.data-block { background:var(--card); border:1px solid var(--line); border-radius:var(--radius-card); min-height:220px; padding:18px 20px; box-shadow:var(--shadow); }.chart-block { min-height:258px; }.chart-block canvas { display:block; width:100%; height:170px; }.recent-block { grid-column:1/-1; min-height:216px; }.block-heading { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:15px; }.block-heading :is(h2,h3) { margin:0; font-size:14px; font-weight:600; }.block-description { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:18px; max-width:390px; }.block-meta { color:var(--muted); font-size:12px; white-space:nowrap; }.bar-list { display:grid; gap:12px; }.bar-label { display:flex; justify-content:space-between; gap:15px; font-size:13px; color:var(--muted); }.bar-label strong { color:var(--ink); font-size:13px; font-weight:600; white-space:nowrap; }.bar-track { height:7px; background:#f0f1f4; border-radius:99px; overflow:hidden; }.bar-track i { display:block; height:100%; background:linear-gradient(90deg,var(--snow-blue),var(--snow-purple)); border-radius:inherit; }.empty.compact { padding:20px 0; }

.recent-table { display:grid; }.recent-head,.recent-row { display:grid; grid-template-columns:1fr 1.4fr 120px; gap:16px; align-items:center; min-height:40px; border-bottom:1px solid rgba(0,0,0,.06); font-size:14px; line-height:20px; }.recent-head { min-height:32px; color:var(--muted); font-size:12px; font-weight:500; }.recent-row > span { color:var(--muted); }.recent-row:last-child { border-bottom:0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.toolbar input { max-width: 360px; }.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 780px; }.data-table th,.data-table td { text-align: left; padding: 15px 12px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; font-weight: 400; vertical-align: middle; }
.data-table th { font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 500; white-space: nowrap; }.data-table tbody tr:hover { background: rgba(125,187,255,.045); }
.data-table a { text-decoration: none; }.contact-cell { min-width: 220px; }.contact-methods { display:flex; flex-direction:column; align-items:flex-start; gap:6px; }.contact-link { display:inline-flex; align-items:center; width:max-content; max-width:100%; padding:2px 4px; border-radius:6px; color:#4f5f78; background:transparent; font-size:13px; line-height:18px; overflow-wrap:anywhere; }.contact-link:hover { color:#d8dfe9; background:var(--snow-blue-soft); }.extension { color:var(--muted); }
.website-button { display:inline-flex; align-items:center; gap:6px; width:max-content; max-width:100%; padding:7px 10px; border:1px solid var(--line); border-radius:8px; color:#4f5968; background:#f6f7f9; font-size:13px; line-height:18px; font-weight:500; overflow-wrap:anywhere; }.website-button:hover { color:#d8dfe9; background:var(--snow-blue-soft); border-color:rgba(125,187,255,.30); }.website-button span { color:var(--muted); font-size:12px; }
.contact-name-line { display:flex; align-items:center; gap:8px; }.detail-toggle { display:grid; place-items:center; width:26px; height:26px; padding:0; border-radius:7px; color:var(--muted); background:transparent; }.detail-toggle:hover { color:#d8dfe9; background:var(--snow-blue-soft); }.row-chevron { width:7px; height:7px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg) translate(-1px,-1px); transition:transform .18s ease; }.detail-toggle.expanded .row-chevron { transform:rotate(225deg) translate(-1px,-1px); }
.client-detail-row td { padding:0 12px 16px; background:rgba(125,187,255,.035); border-bottom:1px solid var(--line); }.client-detail-panel { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px 20px; padding:18px 20px; border:1px solid rgba(23,23,26,.07); border-radius:12px; background:#fafbfc; }.detail-item { display:grid; align-content:start; gap:4px; min-width:0; }.detail-item > span { color:var(--muted); font-size:12px; line-height:16px; font-weight:500; }.detail-item strong { color:#343b46; font-size:13px; line-height:19px; font-weight:500; overflow-wrap:anywhere; }.detail-wide { grid-column:span 2; }
.link-button { background:none; color:#2f3847; font-weight:600; text-align:left; padding:0; }.link-button:hover { color:#d8dfe9; }.tag,.type-tag { display:inline-flex; align-items:center; width:max-content; padding:5px 9px; border-radius:999px; font-size:12px; line-height:16px; font-weight:500; white-space:nowrap; }

.empty { padding:40px 20px; text-align:center; color:var(--muted); }
.dialog { border: 0; border-radius: 20px; padding: 0; width: min(760px,calc(100% - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }.dialog::backdrop { background: rgba(12,30,26,.48); }.dialog-form { padding: 25px; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 20px; }.dialog-header h2 { margin: 0; }.icon-button { background: #eef3f0; border-radius: 99px; width: 32px; height: 32px; font-size: 23px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }.form-grid .full { grid-column: 1/-1; }
.card-preview { max-height: 130px; max-width: 100%; margin-top: 12px; border-radius: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@media(max-width:900px){.main-content{padding:24px}.dashboard-grid{grid-template-columns:1fr}.stats-grid{grid-template-columns:repeat(2,1fr);gap:16px}.refined-grid{gap:16px}.recent-block{grid-column:1/-1}.client-detail-panel{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.app-shell{display:block}.sidebar{width:100%;padding:12px 14px;border-right:0;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:10}.brand{margin:0 4px 10px}.nav-list{display:flex;overflow:auto}.nav-item{white-space:nowrap;width:auto;padding:9px 11px}.main-content{padding:18px 16px 90px}.topbar{align-items:center;margin-bottom:18px}.topbar h2{font-size:20px}.top-actions{width:100%; justify-content:flex-start; gap:8px}.data-menu{order:2}.data-menu-panel{left:0;right:auto}.top-actions .user-badge{display:none}.top-actions > .button{order:1}.top-actions > .button.primary{margin-left:auto}.stats-grid{grid-template-columns:repeat(2,1fr);gap:8px}.stat-card{padding:16px;min-height:112px}.stat-number{font-size:28px;margin:14px 0 10px}.stat-footer{display:block;font-size:12px}.refined-grid{grid-template-columns:1fr;gap:16px}.data-block{padding:16px;min-height:220px}.chart-block{min-height:300px}.chart-block canvas{height:210px}.block-description{font-size:12px}.recent-block{grid-column:auto}.recent-head,.recent-row{grid-template-columns:1fr 1.2fr 82px;gap:8px}.recent-row{font-size:12px}.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}.dialog-form{padding:20px}.dialog-header h2{font-size:21px}.toolbar input{max-width:none}.toolbar>*{flex:1;min-width:120px}.toolbar .button{flex:0 0 auto}}
@media(max-width:640px){.client-detail-panel{grid-template-columns:1fr}.detail-wide{grid-column:auto}}

/* Dark workspace — Figma dashboard + SnowUI DatePicker */
.login-screen { background: radial-gradient(circle at 18% 12%,rgba(237,255,140,.14),transparent 34%),#202220; }
.login-card,.sidebar,.user-badge { background:var(--card); }
.login-card { border-color:var(--line); }

.brand { font-weight:650; }
input,select,textarea { background:var(--surface-raised); color:var(--ink); }
input::placeholder,textarea::placeholder { color:#a4a8a5; }
.button.primary { background:var(--brand); color:#141414; }
.button.secondary,.icon-button { background:var(--surface-raised); color:var(--ink); }
.data-menu-panel,.dialog { background:var(--card); color:var(--ink); }
.menu-item:hover,.nav-item:hover,.nav-item.active { color:var(--brand); background:var(--brand-light); }
.user-badge { color:var(--brand); font-weight:600; }
.toast { background:#e9f5f2; color:#141414; }
.error-card { background:rgba(255,71,71,.08); border-color:rgba(255,71,71,.24); }
.table-card,.stat-card,.data-block { background:var(--card); border-color:var(--line); box-shadow:var(--shadow); }

.bar-track { background:rgba(255,255,255,.08); }.bar-track i { background:linear-gradient(90deg,#edff8c,#7dbbff); }

.recent-head,.recent-row { border-color:var(--line); }
.data-table tbody tr:hover { background:rgba(237,255,140,.045); }
.contact-link { color:#b7c9c6; }.contact-link:hover,.link-button:hover { color:var(--brand); background:var(--brand-light); }
.website-button { color:#d2dbd9; background:var(--surface-raised); }.website-button:hover { color:var(--brand); background:var(--brand-light); border-color:rgba(237,255,140,.28); }
.link-button { color:#eef3f2; font-weight:600; }
.detail-toggle-head,.detail-toggle-cell { width:48px; padding-left:4px !important; padding-right:4px !important; text-align:right !important; }
.detail-toggle-cell .detail-toggle { margin-left:auto; }
.detail-toggle { width:36px; height:36px; color:var(--muted); }.detail-toggle:hover { color:var(--brand); background:var(--brand-light); }
.client-summary-row.expanded td { border-bottom-color:transparent; }
.client-detail-row td { padding:0 12px 18px; background:transparent; border-bottom:1px solid var(--line); }
.client-detail-panel { gap:16px 24px; padding:6px 0 4px; border:0; border-radius:0; background:transparent; }
.client-detail-organized { display:block; }
.detail-section { padding:16px 0; border-bottom:1px solid rgba(255,255,255,.08); }
.detail-section:first-child { padding-top:8px; }
.detail-section:last-child { border-bottom:0; }
.detail-section h4 { margin:0 0 14px; color:var(--brand); font-size:12px; line-height:16px; font-weight:650; letter-spacing:0; }
.detail-section-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px 28px; }
.detail-website-link { display:inline-flex; align-items:center; width:max-content; max-width:100%; color:#c8d4d2; font-size:13px; line-height:19px; font-weight:500; overflow-wrap:anywhere; }
.detail-website-link:hover { color:var(--brand); }

.contact-plain { color:#dbe4e2; font-size:13px; line-height:19px; overflow-wrap:anywhere; }
.rate-field input { color:var(--snow-orange) !important; }
.detail-item strong { color:#dbe4e2; white-space:pre-line; }
.person-chips { display:flex; flex-wrap:wrap; gap:6px; }.person-chip { min-height:30px; padding:6px 10px; border-radius:999px; background:rgba(237,255,140,.12); color:#cfe1ca; font-size:12px; font-weight:500; }.person-chip:hover { background:rgba(237,255,140,.20); }

.dialog::backdrop { background:rgba(8,10,9,.72); }.dialog-form { background:var(--card); }

.choice-field { display:grid; align-content:start; gap:7px; }.choice-label,.field-label { color:var(--ink); font-size:13px; font-weight:600; }
.field-label { display:grid; gap:2px; }.field-label small { color:var(--muted); font-size:12px; font-weight:400; }
.date-field { position:relative; display:grid; gap:7px; }.date-trigger { min-height:42px; display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface-raised); color:var(--ink); text-align:left; }.date-trigger:hover { border-color:rgba(237,255,140,.34); }.calendar-icon { width:14px; height:14px; border:1.5px solid currentColor; border-radius:3px; position:relative; color:var(--brand); }.calendar-icon::before { content:""; position:absolute; left:2px; right:2px; top:3px; border-top:1.5px solid currentColor; }
.date-popover { position:absolute; z-index:30; top:calc(100% + 8px); right:0; width:min(360px,calc(100vw - 40px)); padding:16px; border:1px solid var(--line); border-radius:16px; background:#383b38; box-shadow:0 8px 28px rgba(0,0,0,.34); }
.date-selection { display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:6px; margin-bottom:10px; }.date-selection span { min-height:36px; display:grid; place-items:center; border-radius:10px; background:rgba(255,255,255,.06); color:var(--muted); font-size:13px; }.date-quick { display:flex; gap:8px; margin-bottom:14px; }.date-quick button { min-height:30px; padding:6px 10px; border-radius:9px; background:var(--brand-light); color:var(--brand); font-size:12px; }
.calendar-heading { display:grid; grid-template-columns:36px 1fr 36px; align-items:center; margin-bottom:10px; }.calendar-heading strong { text-align:center; font-size:13px; font-weight:600; }.calendar-heading button { width:36px; height:36px; border-radius:10px; background:transparent; color:var(--muted); font-size:22px; }.calendar-heading button:hover { background:rgba(255,255,255,.06); color:var(--ink); }.calendar-grid { display:grid; grid-template-columns:repeat(7,36px); justify-content:space-between; gap:3px 2px; }.calendar-grid.weekdays { margin-bottom:4px; }.calendar-grid.weekdays span { display:grid; place-items:center; height:28px; color:var(--muted); font-size:12px; }.calendar-day { width:36px; height:36px; border-radius:12px; background:transparent; color:var(--ink); font-size:12px; }.calendar-day:hover { background:rgba(255,255,255,.08); }.calendar-day.other-month { color:rgba(255,255,255,.25); }.calendar-day.is-today { box-shadow:inset 0 0 0 1px rgba(237,255,140,.45); }.calendar-day.selected { background:var(--brand); color:#141414; box-shadow:none; }

.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }.settings-card { display:grid; align-content:start; gap:20px; min-height:280px; padding:22px; border:1px solid var(--line); border-radius:var(--radius-card); background:var(--card); box-shadow:var(--shadow); }.settings-card :is(h2,h3) { margin:0 0 5px; font-size:17px; }.settings-values { display:flex; flex-wrap:wrap; align-content:flex-start; gap:8px; }.setting-chip { display:inline-flex; align-items:center; gap:7px; min-height:34px; padding:6px 7px 6px 9px; border-radius:999px; background:var(--brand-light); color:#cfe1ca; font-size:12px; }.setting-chip button { width:22px; height:22px; border-radius:50%; background:rgba(255,255,255,.07); color:var(--muted); }.setting-color-picker { position:relative; display:grid; place-items:center; width:22px; height:22px; cursor:pointer; }.setting-color-picker input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }.setting-color-picker i { width:14px; height:14px; border-radius:50%; box-shadow:0 0 0 2px rgba(255,255,255,.14); }.setting-color-picker:hover i { box-shadow:0 0 0 3px rgba(255,255,255,.22); }.setting-add-form { display:flex; gap:8px; margin-top:auto; }.setting-add-form input { min-width:0; }
@media(max-width:900px){.settings-grid{grid-template-columns:1fr}}
@media(max-width:640px){.date-popover{position:fixed;left:12px;right:12px;top:auto;bottom:18px;width:auto}.settings-card{padding:18px}.setting-add-form{align-items:stretch}.setting-add-form .button{flex:0 0 auto}}

/* Refined dashboard, SnowUI popovers and editable settings */
input,select,.date-trigger,.choice-dropdown > summary { min-height:44px; }
textarea { min-height:92px; resize:vertical; }
.form-grid > label,.form-grid > .choice-field,.form-grid > .date-field { min-width:0; align-self:start; }
.form-grid > label:not(.full),.form-grid > .choice-field,.form-grid > .date-field { height:69px; min-height:69px; }
.form-grid > label:not(.full) > input,.form-grid > .choice-field .choice-dropdown > summary,.form-grid > .date-field .date-trigger { height:44px; box-sizing:border-box; }
.department-block { grid-column:1/-1; min-height:210px; }
.department-bars { grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:28px; }
.block-heading :is(h2,h3) { font-size:15px; }

.choice-dropdown { position:relative; }
.choice-dropdown > summary { list-style:none; display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface-raised); color:var(--ink); cursor:pointer; }
.choice-dropdown > summary::-webkit-details-marker { display:none; }
.choice-dropdown > summary [data-choice-display] { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:400; }
.dropdown-chevron { flex:0 0 auto; width:7px; height:7px; border-right:1.5px solid var(--muted); border-bottom:1.5px solid var(--muted); transform:rotate(45deg) translateY(-2px); transition:transform .18s ease; }
.choice-dropdown[open] .dropdown-chevron { transform:rotate(225deg) translate(-1px,-1px); }
.choice-popover { position:absolute; z-index:40; top:calc(100% + 8px); left:0; right:0; max-height:270px; overflow:auto; display:flex; flex-direction:column; padding:12px; border:1px solid rgba(255,255,255,.12); border-radius:16px; background:rgba(56,59,56,.94); backdrop-filter:blur(40px); box-shadow:0 8px 28px rgba(0,0,0,.30); }
.choice-option { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; min-height:36px; padding:8px; border-radius:12px; background:transparent; color:rgba(255,255,255,.76); text-align:left; font-size:14px; line-height:20px; font-weight:400; }
.choice-option:hover { background:rgba(255,255,255,.08); color:#fff; }
.choice-option i { display:none; color:var(--brand); font-style:normal; font-weight:600; }
.choice-option[aria-pressed="true"] { background:rgba(237,255,140,.16); color:#d5f4f0; }
.choice-option[aria-pressed="true"] i { display:block; }

.settings-tabs { display:inline-flex; gap:4px; margin-bottom:12px; padding:4px; border:1px solid var(--line); border-radius:14px; background:var(--surface-soft); }
.settings-tabs button { min-height:38px; padding:8px 15px; border-radius:10px; background:transparent; color:var(--muted); font-size:13px; font-weight:500; }
.settings-tabs button[aria-selected="true"] { background:var(--brand); color:#141414; }
.settings-note { margin:0 0 18px; color:var(--muted); font-size:12px; }
.settings-card { min-height:250px; }
.setting-chip { background:rgba(237,255,140,.17); color:#d3f3ef; }

@media(max-width:900px){.department-bars{grid-template-columns:1fr}}
@media(max-width:640px){.choice-popover{position:fixed;left:12px;right:12px;top:auto;bottom:18px;max-height:52vh}.department-block{grid-column:auto}}

/* Three-column overview and inline table filters */
.refined-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.department-block { grid-column:auto; min-height:258px; }
.department-bars { grid-template-columns:1fr; }
.recent-block { grid-column:1/-1; }
.chart-block canvas { height:170px; }

.choice-dropdown > summary { min-height:44px; height:auto; }
.choice-summary-values { min-width:0; display:flex; flex-wrap:nowrap; gap:6px; align-items:center; overflow:hidden; }
.choice-summary-chip { display:inline-flex; align-items:center; min-height:26px; padding:4px 8px; border-radius:8px; background:rgba(237,255,140,.15); color:#cfe1ca; font-size:12px; line-height:18px; white-space:nowrap; }
.choice-placeholder { color:var(--muted); }
.choice-option + .choice-option { margin-top:3px; }

.upload-copy { display:flex; align-items:center; gap:12px; min-width:0; }.upload-copy > div { display:grid; gap:3px; }.upload-copy strong { color:#d8f4f0; font-size:14px; font-weight:600; }.upload-copy small { color:var(--muted); font-size:12px; }
.upload-control { display:flex; align-items:center; justify-content:flex-end; gap:10px; min-width:0; }.upload-button { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:8px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface-raised); color:var(--ink); font-size:12px; font-weight:500; cursor:pointer; white-space:nowrap; }.upload-button:hover { border-color:rgba(237,255,140,.35); }.upload-control > span { max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:12px; }.card-preview { grid-column:1/-1; }.upload-remove { border:0; background:transparent; padding:0 2px; color:var(--muted); font-size:12px; text-decoration:underline; cursor:pointer; }.upload-remove:hover { color:var(--ink); }.detail-card-image { display:block; margin-top:6px; }.detail-card-image img { display:block; max-height:150px; max-width:100%; border:1px solid var(--line); border-radius:8px; }

.data-table th { overflow:visible; }
.table-filter { position:relative; width:max-content; }
.table-filter > summary { list-style:none; display:inline-flex; align-items:center; gap:7px; min-height:28px; padding:4px 6px; margin:-4px -6px; border-radius:8px; color:var(--muted); cursor:pointer; }
.table-filter > summary::-webkit-details-marker { display:none; }.table-filter > summary:hover,.table-filter.has-value > summary { background:rgba(237,255,140,.11); color:var(--brand); }
.filter-chevron { width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg) translateY(-1px); transition:transform .18s ease; }.table-filter[open] .filter-chevron { transform:rotate(225deg) translate(-1px,-1px); }
.table-filter-menu { position:absolute; z-index:50; top:calc(100% + 7px); left:-6px; min-width:180px; max-width:260px; max-height:280px; overflow:auto; display:flex; flex-direction:column; padding:12px; border:1px solid rgba(255,255,255,.12); border-radius:16px; background:rgba(56,59,56,.96); backdrop-filter:blur(40px); box-shadow:0 8px 28px rgba(0,0,0,.30); }
.data-table th:nth-last-child(2) .table-filter-menu { left:auto; right:-6px; }
.table-filter-menu button { width:100%; min-height:36px; padding:8px; border-radius:12px; background:transparent; color:rgba(255,255,255,.76); text-align:left; font-size:13px; font-weight:400; }.table-filter-menu button:hover { background:rgba(255,255,255,.08); color:#fff; }.table-filter-menu button[aria-pressed="true"] { background:rgba(237,255,140,.16); color:#cfe1ca; }
.toolbar input,.toolbar .button { border-radius:12px; min-height:44px; }.toolbar input { flex:1; max-width:none; }.toolbar .button { flex:0 0 auto; }
@media(min-width:901px){.table-wrap{overflow:visible}}
@media(max-width:1100px){.refined-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.department-block{grid-column:1/-1}}
@media(max-width:900px){.refined-grid{grid-template-columns:1fr}.department-block{grid-column:auto}.upload-control{justify-content:flex-start}}
@media(max-width:640px){.upload-control{align-items:flex-start;flex-direction:column}.table-filter-menu{position:fixed;left:12px;right:12px;top:auto;bottom:18px;max-width:none}}

/* Compact overview, subtle selections and account menu */
.refined-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.department-block { grid-column:auto; }
.recent-block { grid-column:1/-1; min-height:0; }
.recent-head,.recent-row { min-height:36px; }
.recent-block .block-heading { margin-bottom:8px; }

.choice-option,.table-filter-menu button { border-radius:8px; }
.choice-option[aria-pressed="true"],.table-filter-menu button[aria-pressed="true"] { background:transparent; color:var(--brand); }
.table-filter-menu button[aria-pressed="true"]::after { content:"✓"; float:right; color:var(--brand); font-weight:600; }
.choice-option:hover,.table-filter-menu button:hover { background:rgba(255,255,255,.045); }
.choice-summary-chip { background:transparent; border:1px solid rgba(237,255,140,.22); }

.settings-card { grid-template-rows:auto minmax(92px,1fr) auto; align-content:stretch; height:100%; }
.settings-values { align-self:start; }
.setting-add-form { align-self:end; margin-top:0; }

.user-menu { position:relative; }
.user-menu > summary { list-style:none; display:flex; align-items:center; gap:8px; cursor:pointer; }
.user-menu > summary::-webkit-details-marker { display:none; }
.user-menu-panel { position:absolute; z-index:60; top:calc(100% + 8px); right:0; width:150px; padding:8px; border:1px solid var(--line); border-radius:14px; background:rgba(56,59,56,.96); backdrop-filter:blur(40px); box-shadow:0 8px 28px rgba(0,0,0,.28); }
.user-menu-panel button { display:flex; align-items:center; gap:9px; width:100%; min-height:38px; padding:8px 10px; border-radius:9px; background:transparent; color:var(--ink); text-align:left; font-size:13px; }
.user-menu-panel button:hover { background:rgba(255,255,255,.06); color:var(--brand); }
.active-filter-groups { display:grid; gap:8px; padding:4px 0 14px; }
.active-filter-group { display:flex; align-items:flex-start; gap:12px; width:max-content; max-width:100%; padding:9px 10px; border-radius:12px; background:rgba(255,255,255,.035); }
.active-filter-label { min-width:72px; padding:5px 2px; color:var(--muted); font-size:12px; line-height:18px; }
.active-filter-values { display:flex; flex-wrap:wrap; gap:6px; }
.active-filter-value { display:inline-flex; align-items:center; gap:7px; min-height:28px; padding:4px 7px 4px 10px; border-radius:8px; background:rgba(237,255,140,.10); color:var(--brand); font-size:12px; }
.active-filter-value i { display:grid; place-items:center; width:18px; height:18px; border-radius:6px; background:rgba(255,255,255,.06); color:var(--muted); font-style:normal; }
@media(max-width:900px){.refined-grid{grid-template-columns:1fr}}

.user-menu-panel { width:60px; padding:6px; }
.user-menu-panel button { justify-content:center; min-height:46px; padding:8px; font-size:22px; }

/* Separate client and talent data tables */
.client-data-table { min-width:940px; }
.client-data-table th:nth-child(1) { width:18%; }
.client-data-table th:nth-child(2) { width:28%; }
.client-data-table th:nth-child(3) { width:27%; }
.client-data-table th:nth-child(4) { width:13%; }
.client-data-table th:nth-child(5) { width:14%; }
.client-data-table .contact-cell { min-width:250px; }
.table-wrap { max-width:100%; overflow-x:auto; }

.talent-filter-chips { display:flex; flex-wrap:wrap; gap:6px; }
.talent-filter-chip { min-height:30px; padding:6px 10px; border:1px solid rgba(237,255,140,.12); border-radius:999px; background:rgba(237,255,140,.07); color:#cfe1ca; font-size:12px; font-weight:500; text-align:left; }
.talent-filter-chip:hover,.talent-filter-chip[aria-pressed="true"] { border-color:rgba(237,255,140,.28); background:rgba(237,255,140,.14); color:var(--brand); }
.person-chip[aria-pressed="true"] { box-shadow:inset 0 0 0 1px rgba(237,255,140,.38); background:rgba(237,255,140,.22); color:#cfe1ca; }
.department-chip { min-height:30px; padding:6px 10px; border:0; border-radius:999px; font-size:12px; font-weight:500; text-align:left; }
.department-chip[aria-pressed="true"] { box-shadow:none; filter:brightness(1.12); }
.table-pagination { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 4px 2px; color:var(--muted); font-size:12px; }
.pagination-actions,.pagination-number-strip { display:flex; align-items:center; gap:6px; }
.pagination-actions button { min-width:34px; height:34px; padding:0 8px; border:1px solid var(--line); border-radius:9px; background:var(--surface-raised); color:var(--muted); font-size:12px; }
.pagination-actions button:hover:not(:disabled) { border-color:rgba(237,255,140,.3); color:var(--brand); }
.pagination-actions button[aria-current="page"] { border-color:transparent; background:var(--brand-light); color:var(--brand); }
.pagination-actions button:disabled { opacity:.35; cursor:not-allowed; }
.pagination-ellipsis { display:grid; place-items:center; min-width:18px; height:34px; color:var(--muted); }
.page-jump { position:relative; margin-left:6px; }
.page-jump > summary { list-style:none; display:flex; align-items:center; gap:8px; height:34px; padding:0 11px; border:1px solid var(--line); border-radius:9px; background:var(--surface-raised); color:var(--ink); cursor:pointer; white-space:nowrap; }
.page-jump > summary::-webkit-details-marker { display:none; }
.page-jump[open] > summary,.page-jump > summary:hover { border-color:rgba(237,255,140,.3); color:var(--brand); }
.page-jump-menu { position:absolute; z-index:60; right:0; bottom:calc(100% + 8px); width:96px; max-height:190px; overflow:auto; display:flex; flex-direction:column; gap:3px; padding:6px; border:1px solid rgba(255,255,255,.12); border-radius:11px; background:rgba(56,59,56,.98); box-shadow:0 8px 24px rgba(0,0,0,.30); }
.page-jump-menu button { min-width:0; width:100%; height:30px; border:0; background:transparent; }
.page-jump-menu button[aria-current="page"] { background:var(--brand-light); }
.option-color-tag { border:0; }
@media(max-width:900px){.detail-section-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.detail-section-grid{grid-template-columns:1fr}.detail-section-grid .detail-wide{grid-column:auto}.active-filter-group{display:grid;gap:4px;width:100%}.active-filter-label{min-width:0}.table-pagination{align-items:flex-start;flex-direction:column}.pagination-actions{width:100%;justify-content:flex-end;overflow:visible;padding-bottom:3px}.pagination-number-strip{display:none}.pagination-prev{order:1}.page-jump{order:2;margin:0}.pagination-next{order:3}.page-jump-menu{left:0;right:auto}.pagination-range{width:100%}}

/* Department drill-down, chart tooltip and compact floating controls */
.refined-grid { grid-template-columns:minmax(0,1.16fr) minmax(360px,.84fr); align-items:stretch; }
.chart-block,.department-block { min-height:382px; }
.monthly-chart-wrap { position:relative; min-height:246px; }
.chart-block canvas { display:block; width:100%; height:246px; }
.chart-tooltip { position:absolute; z-index:3; min-width:80px; padding:7px 9px; border:1px solid rgba(237,255,140,.22); border-radius:8px; background:rgba(32,34,32,.94); color:var(--ink); box-shadow:0 8px 20px rgba(0,0,0,.24); font-size:12px; line-height:16px; text-align:center; pointer-events:none; white-space:nowrap; }
.department-bars { display:grid; grid-template-columns:1fr; gap:8px; }
.department-bar-row { display:grid; gap:4px; width:100%; padding:2px 0; border-radius:8px; background:transparent; text-align:left; }
.department-bar-row:hover { background:rgba(237,255,140,.045); }
.department-bar-row:hover .bar-label span { color:var(--brand); }
.department-bar-row .bar-label { width:100%; }
.department-bar-row .bar-track { width:100%; }
.detail-section-grid .detail-full { grid-column:1/-1; }
.detail-relationship-section { padding-top:18px; }
.client-department-buttons { display:flex; flex-wrap:wrap; gap:6px; }
.client-department-chip { min-height:28px; padding:5px 9px; border:0; border-radius:999px; background:rgba(255,255,255,.07); color:var(--muted); font-size:12px; font-weight:500; }
.client-department-chip:hover { filter:brightness(1.12); }
.active-filter-groups { display:flex; flex-wrap:wrap; align-items:flex-start; gap:8px; }
.page-jump-menu { width:72px; padding:4px; border-radius:9px; }
.page-jump-menu button { height:28px; padding:0 5px; border-radius:7px; }
.user-menu-panel { width:auto; padding:0; border:0; border-radius:0; background:transparent; backdrop-filter:none; box-shadow:none; }
.user-menu-panel button { display:grid; place-items:center; width:44px; min-height:44px; height:44px; padding:0; border:1px solid var(--line); border-radius:12px; background:var(--surface-raised); color:var(--brand); box-shadow:0 8px 22px rgba(0,0,0,.20); font-size:20px; }
.user-menu-panel button:hover { border-color:rgba(237,255,140,.28); background:#3d413e; }
@media(max-width:1100px){.refined-grid{grid-template-columns:1fr}.chart-block,.department-block{min-height:0}.department-block{grid-column:auto}}
@media(max-width:640px){.chart-block canvas{height:220px}.monthly-chart-wrap{min-height:220px}.detail-section-grid .detail-full{grid-column:auto}.active-filter-groups{display:grid}.active-filter-group{width:100%}}

/* Save feedback: toast actions, inline form errors, confirm and import dialogs */
:root { --danger-text:#ff8f87; --danger-soft:rgba(255,71,71,.12); }
.login-screen.is-checking .login-card { visibility:hidden; }
.toast { display:flex; align-items:center; gap:14px; max-width:min(440px,calc(100vw - 32px)); line-height:20px; }
.toast.show { pointer-events:auto; }
.toast[data-tone="error"] { background:#3a2624; color:#ffd9d5; border:1px solid rgba(255,143,135,.35); }
.toast-action { flex:0 0 auto; min-height:32px; padding:6px 12px; border-radius:8px; background:rgba(30,41,39,.1); color:inherit; font-weight:600; text-decoration:underline; text-underline-offset:3px; }
.toast[data-tone="error"] .toast-action { background:rgba(255,255,255,.08); }
.form-error { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:18px 0 0; padding:12px 14px; border:1px solid rgba(255,143,135,.32); border-radius:10px; background:var(--danger-soft); color:#ffd9d5; font-size:13px; line-height:20px; }
.form-error[hidden] { display:none; }
.form-error-action { flex:0 0 auto; min-height:32px; padding:6px 12px; border-radius:8px; background:rgba(255,255,255,.08); color:var(--ink); font-size:13px; font-weight:600; }
.form-error-action:hover { background:rgba(255,255,255,.14); }
input[aria-invalid="true"],textarea[aria-invalid="true"] { border-color:var(--danger-text); box-shadow:0 0 0 3px var(--danger-soft); }
.button:disabled { opacity:.6; cursor:progress; transform:none; }
.button.danger { background:#c9302c; color:#fff; }
.button.danger:hover { background:#b52a26; }
.button.danger-text { margin-right:auto; padding-left:4px; background:transparent; color:var(--danger-text); }
.button.danger-text:hover { background:var(--danger-soft); transform:none; }
.dialog-small { width:min(440px,calc(100% - 24px)); }
.dialog-medium { width:min(560px,calc(100% - 24px)); }
.dialog-title { margin:0 0 10px; font-size:19px; line-height:28px; font-weight:600; }
.dialog-body { margin:0; color:var(--muted); font-size:14px; line-height:22px; }
.import-summary { display:grid; gap:10px; margin:18px 0; }
.import-stat { display:grid; grid-template-columns:auto 1fr; column-gap:10px; row-gap:2px; align-items:baseline; padding:12px 14px; border-radius:10px; background:var(--surface-soft); }
.import-stat strong { font-size:22px; font-weight:600; font-variant-numeric:tabular-nums; }
.import-stat span { color:var(--ink); font-size:14px; }
.import-stat small { grid-column:1/-1; color:var(--muted); font-size:12px; line-height:18px; }
.error-card .button { margin-top:16px; }
@media(max-width:640px){.toast{left:16px;right:16px;top:auto;bottom:calc(16px + env(safe-area-inset-bottom));max-width:none}.dialog-actions{flex-wrap:wrap}.button.danger-text{width:100%;order:3;margin-right:0}}

/* Icons, navigation and account menu */
.icon-sprite { position:absolute; width:0; height:0; overflow:hidden; }
.icon { width:18px; height:18px; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.nav-item { display:flex; align-items:center; gap:10px; min-height:44px; }
.nav-item .icon { width:19px; height:19px; }
.nav-item[aria-current="page"] { color:var(--brand); background:var(--brand-light); font-weight:600; }

.user-badge { display:flex; align-items:center; gap:8px; min-height:40px; padding:4px 14px 4px 4px; color:var(--ink); font-weight:500; }
.user-initial { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:var(--brand-light); color:var(--brand); font-size:14px; font-weight:600; }
.user-menu-panel { width:200px; padding:6px; border:1px solid var(--line); border-radius:12px; background:var(--surface-raised); backdrop-filter:none; box-shadow:0 12px 32px rgba(0,0,0,.36); }
.user-menu-panel button { display:flex; place-items:initial; align-items:center; gap:10px; width:100%; min-height:44px; height:auto; padding:10px 12px; border:0; border-radius:8px; background:transparent; color:var(--ink); box-shadow:none; font-size:14px; }
.user-menu-panel button:hover { background:rgba(255,255,255,.06); border-color:transparent; color:var(--brand); }
.user-menu-name { margin:0; padding:8px 12px 10px; border-bottom:1px solid var(--line); margin-bottom:6px; color:var(--muted); font-size:12px; line-height:18px; }
.add-button { display:inline-flex; align-items:center; gap:6px; }
.add-button .icon { width:17px; height:17px; stroke-width:2; }
.contact-link { gap:6px; }
.contact-link .icon { width:14px; height:14px; color:var(--muted); }
.contact-link > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

html:has(dialog[open]) { overflow:hidden; }

/* Phone: bottom tab bar, card rows, thumb-reach actions */
@media(max-width:640px){
  input,select,textarea { font-size:16px; }
  .app-shell { display:block; }
  .sidebar { position:fixed; z-index:30; left:0; right:0; bottom:0; top:auto; width:auto; min-width:0; padding:6px 8px calc(6px + env(safe-area-inset-bottom)); border:0; border-top:1px solid var(--line); background:rgba(42,45,43,.94); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); }
  .sidebar .brand { display:none; }
  .nav-list { display:grid; grid-template-columns:repeat(4,1fr); gap:4px; overflow:visible; }
  .nav-item { flex-direction:column; justify-content:center; gap:3px; width:auto; min-height:52px; padding:6px 4px; border-radius:10px; font-size:12px; line-height:14px; text-align:center; white-space:nowrap; }
  .nav-item .icon { width:22px; height:22px; }
  .nav-item.active { background:transparent; }
  .nav-item.active .icon { stroke-width:2; }
  .main-content { padding:16px 16px calc(150px + env(safe-area-inset-bottom)); }
  .topbar { flex-wrap:nowrap; align-items:center; gap:12px; margin-bottom:16px; }
  .topbar > div:first-child { min-width:0; }
  
  .top-actions { width:auto; flex-wrap:nowrap; justify-content:flex-end; gap:8px; }
  .top-actions .user-badge { display:flex; padding:4px; min-height:44px; }
  .user-badge #userName { display:none; }
  .user-initial { width:36px; height:36px; }
  .data-menu-panel { left:auto; right:0; width:min(260px,calc(100vw - 32px)); }
  .data-menu > summary { min-height:44px; }
  .menu-item { min-height:52px; }

  /* 清單：表頭變成可橫向滑動的篩選列，每筆資料變成一張卡 */
  .table-card { padding:0; background:transparent; border:0; box-shadow:none; }
  .toolbar { margin-bottom:12px; }
  .toolbar input { min-height:48px; }
  .toolbar .add-button { position:fixed; z-index:25; right:16px; bottom:calc(78px + env(safe-area-inset-bottom)); min-height:52px; padding:12px 20px 12px 16px; border-radius:999px; box-shadow:0 12px 28px rgba(0,0,0,.42); font-size:15px; }
  .table-wrap { overflow:visible; }
  .data-table,.client-data-table { display:block; min-width:0; }
  .data-table thead { display:block; }
  .data-table thead tr { display:flex; gap:8px; margin:0 -16px; padding:0 16px 12px; overflow-x:auto; scrollbar-width:none; }
  .data-table thead tr::-webkit-scrollbar { display:none; }
  /* 表頭文字在手機上不顯示，但不能用 display:none——那會讓它從無障礙樹整個消失，
     儲存格就失去欄位名稱。改成視覺隱藏：絕對定位脫離 flex 流，所以下面那排篩選膠囊
     的版面完全不受影響。width 要 !important 才壓得過上面 nth-child 的欄寬百分比。 */
  .data-table thead th { position:absolute; width:1px !important; height:1px; margin:-1px; padding:0; border:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .data-table thead th:has(.table-filter) { position:static; display:block; flex:0 0 auto; width:auto !important; height:auto; margin:0; overflow:visible; clip-path:none; white-space:normal; }
  .table-filter > summary { min-height:40px; margin:0; padding:8px 14px; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--ink); font-size:13px; }
  .table-filter.has-value > summary { border-color:rgba(237,255,140,.4); }
  .table-filter-menu,.choice-popover { position:fixed; left:12px; right:12px; top:auto; bottom:calc(78px + env(safe-area-inset-bottom)); max-width:none; max-height:56vh; }
  .table-filter-menu button,.choice-option { min-height:44px; font-size:15px; }
  .data-table tbody { display:grid; gap:10px; }
  .data-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 12px; align-items:center; padding:14px 12px 12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--card); }
  .data-table tbody tr:hover { background:var(--card); }
  .data-table tbody td { display:block; min-width:0; padding:0; border:0; font-size:14px; }
  .data-table tbody td:empty,.data-table tbody td:has(> .empty-value:only-child) { display:none; }
  .top-actions .data-menu { order:0; }
  .top-actions .user-menu { order:1; }
  .top-actions .user-badge { border:0; background:transparent; }
  .contact-plain { flex-basis:100%; color:var(--muted); font-size:13px; line-height:19px; }
  .data-table .link-button { font-size:16px; line-height:24px; min-height:24px; }
  .detail-toggle { width:44px; height:44px; margin:-6px -4px -6px 0; }
  .contact-methods { flex-direction:row; flex-wrap:wrap; gap:8px; }
  .contact-link { min-height:44px; max-width:100%; padding:10px 14px 10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface-raised); color:var(--ink); font-size:14px; }
  .contact-link .icon { width:17px; height:17px; color:var(--brand); }
  .contact-cell { grid-column:1/-1; min-width:0 !important; margin-top:6px; }
  

  /* 客戶卡：姓名＋展開｜公司＋狀態｜撥打、寄信 */
  .client-summary-row td:nth-child(1) { grid-column:1; grid-row:1; }
  .client-summary-row td.detail-toggle-cell { grid-column:2; grid-row:1; width:auto; }
  .client-summary-row td:nth-child(2) { grid-column:1; grid-row:2; color:var(--muted); font-size:13px; }
  .client-summary-row td:nth-child(4) { grid-column:2; grid-row:2; justify-self:end; }
  .client-summary-row td:nth-child(3) { grid-row:3; }
  .client-summary-row td:nth-child(5) { display:none; }

  
  
  
  
  
  

  .company-row td:nth-child(1) { grid-column:1; }
  .company-row td:nth-child(2) { grid-column:2; grid-row:1; justify-self:end; }
  .company-row td:nth-child(3),.company-row td:nth-child(4),.company-row td:nth-child(5) { grid-column:1/-1; }
  .company-row td:nth-child(5) { color:var(--muted); font-size:13px; }
  .company-row .company-name { font-size:16px; line-height:24px; font-weight:600; }
  .company-row .link-button { font-size:14px; line-height:22px; font-weight:500; color:var(--ink); }

  .client-summary-row.expanded { border-bottom-left-radius:0; border-bottom-right-radius:0; border-bottom-color:transparent; }
  .client-detail-row { display:block; margin-top:-10px; border:1px solid var(--line); border-top:0; border-radius:0 0 12px 12px; background:var(--card); }
  .client-detail-row td { display:block; padding:0 14px 14px; border:0; }
  .talent-filter-chip,.person-chip,.department-chip,.client-department-chip { min-height:36px; }
  .website-button { min-height:44px; }

  .table-pagination { padding-top:14px; }
  .pagination-actions button,.page-jump > summary { min-width:44px; height:44px; }
  .page-jump-menu button { height:40px; }

  .stats-grid { gap:8px; }
  .department-bar-row { min-height:44px; align-content:center; }
  .inline-action { min-height:44px; }
  .recent-row .link-button { min-height:44px; }

  .dialog { width:100%; max-width:none; height:100dvh; max-height:100dvh; margin:0; border-radius:0; }
  .dialog-form { min-height:100%; padding:16px 16px 0; }
  .dialog-header { position:sticky; top:0; z-index:2; margin:-16px -16px 16px; padding:14px 16px; background:var(--card); border-bottom:1px solid var(--line); align-items:center; }
  .icon-button { width:44px; height:44px; }
  .dialog-actions { position:sticky; bottom:0; z-index:2; margin:18px -16px 0; padding:12px 16px calc(12px + env(safe-area-inset-bottom)); background:var(--card); border-top:1px solid var(--line); }
  .dialog-actions .button { flex:1; min-height:48px; }
  .dialog-small,.dialog-medium { height:auto; max-height:90dvh; margin:auto 0 0; border-radius:16px 16px 0 0; }
  .dialog-small .dialog-form,.dialog-medium .dialog-form { min-height:0; padding-top:20px; }
}

/* Long filter lists: wrap long names, searchable when over 8 options */
.table-filter-menu { overflow-x:hidden; }
.table-filter-menu button { white-space:normal; overflow-wrap:anywhere; line-height:20px; }
.table-filter-menu button[hidden] { display:none; }
.filter-search { flex:0 0 auto; min-height:40px; margin:0 0 8px; padding:8px 12px; border-radius:8px; background:var(--surface-soft); font-size:14px; }
.table-filter-menu:has(.filter-search) { min-width:260px; max-height:340px; }
@media(max-width:640px){.filter-search{min-height:44px;font-size:16px}}
.table-filter-menu > *,.choice-popover > * { flex-shrink:0; }

/* Grouped forms: three sections, quiet disclosure, sticky header and actions */
.visually-hidden { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.dialog-form { padding:0 28px; }
.dialog-header { position:sticky; top:0; z-index:3; display:flex; align-items:center; justify-content:space-between; margin:0 -28px; padding:20px 28px 16px; background:var(--card); }
.dialog-header h2 { font-size:20px; line-height:28px; font-weight:600; }
.form-section { margin:0; padding:20px 0 22px; border:0; border-top:1px solid var(--line); min-width:0; }
.form-section legend { float:left; width:100%; margin:0 0 14px; padding:0; color:var(--ink); font-size:15px; line-height:22px; font-weight:600; }
.form-section legend + * { clear:both; }
.form-section-hint { margin:-8px 0 14px; color:var(--muted); font-size:13px; line-height:20px; }
.form-section .form-grid { gap:16px 18px; }
.form-section .form-grid > * { height:auto !important; min-height:0 !important; }
.form-section label { font-weight:500; color:var(--ink); }
.choice-label,.field-label { font-weight:500; }
.required-mark { display:inline-block; margin-left:4px; padding:1px 6px; border-radius:6px; background:var(--brand-light); color:var(--brand); font-size:12px; line-height:16px; font-weight:500; vertical-align:1px; }
.field-hint { color:var(--muted); font-size:12px; line-height:18px; font-weight:400; }
.phone-pair { display:grid; grid-template-columns:minmax(0,1fr) 96px; gap:10px; }
.form-more { margin-top:14px; }
.form-more > summary { display:inline-flex; align-items:center; gap:8px; min-height:36px; padding:6px 0; color:var(--brand); font-size:13px; font-weight:500; cursor:pointer; list-style:none; }
.form-more > summary::-webkit-details-marker { display:none; }
.form-more > summary::before { content:""; width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(-45deg); transition:transform .18s ease; }
.form-more[open] > summary::before { transform:rotate(45deg); }
.form-more > .form-grid { margin-top:10px; }
.draft-note { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px 0 0; color:var(--ink); font-size:13px; }
.draft-note button { min-height:40px; padding:8px 4px; background:transparent; color:var(--brand); text-decoration:underline; text-underline-offset:3px; }
.return-context { margin-bottom:12px; }
.company-conflict { color:var(--snow-yellow); font-size:13px; font-weight:500; }
.company-variants { display:grid; gap:8px; margin:8px 0 0; padding-left:20px; }
.company-variants li span { display:block; font-size:12px; }
.login-card .button.primary { min-height:44px; }
.upload-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px 16px; margin-top:18px; padding:14px 16px; border:1px dashed rgba(237,255,140,.24); border-radius:10px; }
.upload-row .upload-copy { display:grid; gap:2px; }
.upload-row .upload-copy strong { font-size:13px; font-weight:500; color:var(--ink); }
.upload-row .upload-copy span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:12px; }
.upload-row .upload-control { display:flex; align-items:center; gap:8px; }
.upload-row .upload-button { display:inline-flex; align-items:center; gap:6px; min-height:40px; }
.upload-row .upload-button:focus-visible,.form-more > summary:focus-visible { outline:2px solid var(--brand); outline-offset:3px; }
.upload-row .upload-button .icon { width:16px; height:16px; }
.upload-row .card-preview { grid-column:1/-1; margin:0; }
.upload-remove { min-height:40px; padding:8px 12px; border-radius:10px; background:transparent; color:var(--muted); font-size:12px; }
.dialog-form > .form-error { margin:0 0 4px; }
.dialog-actions { position:sticky; bottom:0; z-index:3; margin:0 -28px; padding:14px 28px 20px; background:var(--card); border-top:1px solid var(--line); }
.dialog-small .dialog-form,.dialog-medium .dialog-form { padding:24px 28px 0; }
.dialog-small .dialog-actions,.dialog-medium .dialog-actions { border-top:0; }
@media(max-width:640px){
  .dialog-form { padding:0 16px; }
  .dialog-header { margin:0 -16px; padding:12px 16px; border-bottom:1px solid var(--line); }
  .form-section:first-of-type { border-top:0; }
  .dialog-actions { margin:0 -16px; padding:12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .phone-pair { grid-template-columns:minmax(0,1fr) 88px; }
  .upload-row { grid-template-columns:1fr; }
  .dialog-small .dialog-form,.dialog-medium .dialog-form { padding:20px 16px 0; }
}
.label-text { display:flex; align-items:center; gap:6px; }
.required-mark { margin-left:0; }
.dialog-actions { flex-wrap:wrap; }
.dialog-actions > .form-error { flex:1 0 100%; margin:0 0 4px; }

/* Overview KPIs, page title, empty states */
.page-title { margin:0; font-size:24px; line-height:32px; font-weight:600; }
.stat-top { gap:10px; }
.stat-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:8px; background:var(--brand-light); color:var(--brand); }
.stat-icon .icon { width:18px; height:18px; }
.stat-label { color:var(--ink); font-size:14px; line-height:20px; font-weight:500; }
.stat-number { font-variant-numeric:tabular-nums; letter-spacing:0; }
.stat-footer { display:block; color:var(--muted); font-size:13px; line-height:18px; }
.empty { display:grid; justify-items:center; gap:10px; }
.empty p { margin:0; }
.empty > p:first-child { color:var(--ink); font-size:15px; }
.empty-hint { max-width:36ch; color:var(--muted); font-size:13px; line-height:20px; }
.empty .button { display:inline-flex; align-items:center; gap:6px; margin-top:4px; }
.empty.compact { padding:24px 16px; }
.recent-row .empty-value,.data-table .empty-value { color:var(--muted); }
.date-selection span { font-variant-numeric:tabular-nums; }
@media(max-width:640px){.page-title{font-size:20px;line-height:28px}.stat-footer{font-size:12px}.stat-label{font-size:13px}}

/* Type roles: one family (Noto Sans TC 400/500/600), 12px floor, no tracking on CJK */
h1,h2,h3,h4 { letter-spacing:0; }
/* 總覽區塊、設定卡片、人才卡片的標題從 h3 改成 h2（它們直屬頁面的 h1，中間不該跳過一層），樣式沿用原本 h3 的規則 */
.block-heading :is(h2,h3),.settings-card :is(h2,h3),.table-card h3 { font-size:16px; line-height:24px; font-weight:600; }
.block-description { font-size:13px; line-height:20px; }
.detail-section h4 { margin:0 0 12px; color:var(--ink); font-size:13px; line-height:20px; font-weight:600; }
.detail-item > span { font-size:12px; line-height:18px; }
.stat-number { font-size:32px; line-height:1; font-weight:600; }
.data-table td,.data-table th,.pagination-range,.bar-label strong,.import-stat strong { font-variant-numeric:tabular-nums; }
.button { font-size:14px; font-weight:500; }
.button.tertiary { font-size:13px; }
.brand { font-weight:600; font-size:15px; }
.login-card h1 { font-size:28px; line-height:36px; font-weight:600; }
::selection { background:rgba(237,255,140,.32); color:var(--ink); }
input,textarea { caret-color:var(--brand); }

/* Studio identity: crescent mark, no colored glows */
.brand-mark,.brand-mark.small { display:grid; place-items:center; background:var(--surface-raised); border:1px solid var(--line); box-shadow:none; color:var(--brand); }
.brand-moon { width:100%; height:100%; fill:currentColor; stroke:none; }
.button.primary { box-shadow:none; }
.button.primary:hover { background:#edff8c; }

/* Talents: work-first card wall */
.filter-bar { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; margin:0 0 14px; }
.filter-bar .table-filter > summary { min-height:36px; margin:0; padding:6px 12px; border:1px solid var(--line); border-radius:999px; color:var(--ink); }
.filter-bar .table-filter-menu { left:0; }
.filter-count { margin-left:auto; color:var(--muted); font-size:13px; font-variant-numeric:tabular-nums; }
.talent-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; }
.talent-card { display:flex; flex-direction:column; min-width:0; overflow:hidden; border:1px solid var(--line); border-radius:12px; background:var(--card); transition:border-color .2s ease, transform .2s ease; }
.talent-card:hover { border-color:rgba(237,255,140,.28); }
.talent-cover { position:relative; display:block; width:100%; aspect-ratio:16/9; padding:0; overflow:hidden; border-radius:0; background:var(--surface-soft); }
.talent-cover img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:0; transition:opacity .35s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1); }
.talent-cover.has-image img { opacity:1; }
.talent-cover:hover img { transform:scale(1.03); }
.talent-cover:focus-visible { outline-offset:-3px; }
.talent-cover-placeholder { position:absolute; inset:0; display:grid; place-items:center; color:rgba(237,255,140,.52); font-size:44px; font-weight:500; background:radial-gradient(120% 90% at 78% 12%, rgba(237,255,140,.10), transparent 60%), var(--surface-soft); }
.talent-cover.has-image .talent-cover-placeholder { opacity:0; }
.talent-card-body { display:grid; align-content:start; gap:10px; padding:14px 16px 16px; flex:1; }
.talent-name { margin:0; font-size:16px; line-height:24px; font-weight:600; }
.talent-name .link-button { font-size:inherit; line-height:inherit; }
.talent-card .talent-filter-chips { gap:6px; }
.talent-card-contact .contact-methods { gap:4px; }
.talent-card-contact .contact-plain { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; color:var(--muted); font-size:13px; }
.talent-card-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:auto; padding-top:10px; border-top:1px solid var(--line); font-size:12px; }
.talent-creator { color:var(--muted); white-space:nowrap; }
.portfolio-link { display:inline-flex; align-items:center; gap:6px; min-width:0; max-width:100%; padding:4px 0; color:var(--brand); font-size:13px; text-decoration:none; }
.portfolio-link span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.portfolio-link .icon { width:14px; height:14px; }
.portfolio-link:hover span { text-decoration:underline; text-underline-offset:3px; }

/* Talent detail drawer */
.drawer { position:fixed; inset:0 0 0 auto; width:min(520px,100%); max-width:none; height:100dvh; max-height:none; margin:0; padding:0; border:0; border-left:1px solid var(--line); border-radius:0; background:var(--card); color:var(--ink); box-shadow:-24px 0 60px rgba(0,0,0,.35); }
.drawer::backdrop { background:rgba(8,10,9,.6); }
.drawer[open] { display:flex; flex-direction:column; animation:drawer-in .32s cubic-bezier(.16,1,.3,1); }
@keyframes drawer-in { from { transform:translateX(24px); opacity:0; } }
@media (prefers-reduced-motion:reduce) { .drawer[open] { animation:none; } .talent-cover img { transition:none; } }
.drawer-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 24px; border-bottom:1px solid var(--line); }
.drawer-header h2 { margin:0; font-size:20px; line-height:28px; font-weight:600; overflow-wrap:anywhere; }
.drawer-actions { display:flex; align-items:center; gap:8px; }
.drawer-body { flex:1; overflow:auto; padding:20px 24px 32px; }
.drawer-cover { display:block; margin-bottom:18px; overflow:hidden; border-radius:10px; aspect-ratio:16/9; background:var(--surface-soft); }
.drawer-cover img { width:100%; height:100%; object-fit:cover; }
.drawer-contact { margin-bottom:8px; }
.drawer-contact .contact-methods { flex-direction:row; flex-wrap:wrap; gap:8px; }
.drawer-contact .contact-link { min-height:40px; padding:8px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface-raised); color:var(--ink); }
.drawer-contact .contact-link .icon { color:var(--brand); }
.drawer-contact .contact-plain { flex-basis:100%; color:var(--muted); }
.drawer-section { padding:18px 0; border-top:1px solid var(--line); }
.drawer-section h3 { margin:0 0 12px; font-size:13px; line-height:20px; font-weight:600; }
.drawer-section dl { display:grid; gap:12px; margin:0; }
.drawer-item { display:grid; grid-template-columns:96px minmax(0,1fr); gap:12px; }
.drawer-item dt { color:var(--muted); font-size:13px; line-height:22px; }
.drawer-item dd { display:grid; gap:6px; margin:0; font-size:14px; line-height:22px; overflow-wrap:anywhere; }
.drawer-chips { display:flex; flex-wrap:wrap; gap:6px; }
.drawer-chip { padding:2px 9px; border-radius:999px; background:var(--brand-light); color:#cfe1ca; font-size:13px; line-height:20px; }
.drawer-links { display:grid; gap:2px; }
.drawer-rate { margin:0; color:var(--snow-orange); font-size:14px; line-height:22px; }
.pre-line { white-space:pre-line; }
.drawer .detail-card-image img { max-width:100%; border-radius:8px; }
@media(max-width:640px){
  .filter-bar { flex-wrap:nowrap; margin:0 -16px 12px; padding:0 16px; overflow-x:auto; scrollbar-width:none; }
  .filter-bar .table-filter > summary { min-height:40px; white-space:nowrap; }
  .filter-count { flex:0 0 auto; }
  .talent-grid { grid-template-columns:1fr; gap:12px; }
  .talent-card-contact .contact-link { min-height:44px; padding:10px 14px 10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface-raised); color:var(--ink); }
  .talent-card-contact .contact-methods { flex-direction:row; flex-wrap:wrap; gap:8px; }
  .portfolio-link { min-height:44px; }
  .drawer { width:100%; border-left:0; }
  .drawer-header { padding:12px 16px; }
  .drawer-body { padding:16px 16px calc(24px + env(safe-area-inset-bottom)); }
  .drawer-item { grid-template-columns:1fr; gap:2px; }
  .drawer-contact .contact-link { min-height:44px; }
}

/* Login lockup: mark beside the name instead of a tile stacked above the heading */
.login-brand { display:flex; align-items:center; gap:12px; margin:0 0 6px; }
.login-brand h1 { margin:0; }
.login-brand .brand-mark { width:40px; height:40px; border-radius:10px; }

/* 排序膠囊：收起來時左邊是「排序」標籤、右邊是目前照什麼排，不用展開也看得出來。
   桌機的表頭放不進排序（篩選下拉已經佔滿），手機的表頭又只留篩選膠囊，所以兩邊都放這一顆。 */
.sort-filter > summary { gap:6px; }
.sort-label { color:var(--muted); }
.filter-bar .sort-filter > summary { color:var(--ink); }
.list-sort-bar { margin:0 0 10px; }
/* 排序列跟其他篩選列一樣是 .filter-bar，手機上那條規則用 -16px 外距搭配 16px 內距讓膠囊貼齊畫面邊緣；
   這裡原本把外距歸零、內距卻留著，排序膠囊因此比其他篩選多縮了 16px。 */
@media(max-width:640px){ .list-sort-bar { margin:0 -16px 8px; } }

/* 搜尋框 */
.toolbar .search-field { position:relative; display:flex; flex:1; max-width:360px; }
.search-field input { flex:1; min-width:0; }
@media(max-width:640px){ .toolbar .search-field { max-width:none; } }

/* 詳細面板底下的「編輯」：編輯是明確按出來的動作，不再是點名字的副作用。
   靠左對齊——這張表在視窗窄一點時會水平捲動，靠右的話這顆唯一的編輯入口會被捲出畫面外。 */
.detail-actions { display:flex; justify-content:flex-start; padding:14px 0 2px; border-top:1px solid rgba(255,255,255,.08); }
@media(max-width:640px){ .detail-actions .button { width:100%; min-height:44px; } }

/* 客戶列的姓名是開啟聯絡人的主要入口（點姓名展開詳細），所以它要是個合格的觸控目標。
   用偽元素往上下撐開命中區，而不是加 padding：每列加高 20px 會讓手機一屏看到的人更少，
   而「一屏看不到 4 個人」本來就是這頁最大的問題。文字位置與列高都不變。
   手機 44px（DESIGN.md §10），桌面 24px（WCAG 2.5.8 AA 的最小目標）。 */
.contact-name-line .link-button { position:relative; }
.contact-name-line .link-button::after { content:""; position:absolute; left:0; right:0; top:50%; height:24px; transform:translateY(-50%); }
@media(max-width:640px){ .contact-name-line .link-button::after { height:44px; } }

/* 公司抽屜的聯絡人清單：每位一小塊，姓名可點進客戶名單，聯絡方式沿用列表那組撥打／寄信按鈕。 */
.company-contacts { display:grid; gap:14px; }
.company-contact { display:grid; gap:6px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--surface-soft); }
.company-contact-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.company-contact .link-button { font-size:15px; }
.company-row .company-name { font-weight:600; }

/* 設定頁的改名：chip 就地換成輸入框。改名是為了讓選項清單能當成唯一真實來源——
   只能新增和移除的話，同事打錯字就只能再加一個，清單就是這樣漂移成一堆同義詞的。 */
.setting-rename { color:var(--muted); font-size:12px; line-height:1; }
.setting-rename:hover { color:var(--brand); }
.setting-rename-input { min-width:120px; height:28px; padding:2px 8px; border:1px solid var(--brand); border-radius:8px; background:var(--surface-raised); color:var(--ink); font-size:13px; }
.setting-rename-ok,.setting-rename-cancel { min-width:24px; color:var(--muted); }
.setting-rename-ok:hover { color:var(--brand); }

/* Toast 堆疊容器。以前 .toast 自己是 position:fixed 的單一元素，第二則訊息會把第一則
   連同它的「復原」按鈕一起蓋掉；現在每則是容器裡的一個子元素，各自計時、各自關閉。 */
.toast-stack { position:fixed; z-index:20; top:24px; right:24px; display:flex; flex-direction:column-reverse; align-items:flex-end; gap:10px; max-height:calc(100dvh - 48px); pointer-events:none; }
.toast { position:static; top:auto; right:auto; left:auto; bottom:auto; }
.toast-close { flex:0 0 auto; width:24px; min-height:24px; margin-right:-4px; padding:0; border-radius:6px; background:transparent; color:inherit; opacity:.55; font-size:16px; line-height:1; }
.toast-close:hover { opacity:1; background:rgba(127,127,127,.18); }
/* 手機放底部：靠近拇指，也不會蓋住頂部的搜尋與導覽。新的一則在最下面。
   底部已經被 tab bar（65px）和浮動的新增按鈕佔住：那顆按鈕的 bottom 是 78px、高 52px，
   上緣等於離底部 130px。所以堆疊抬到 142px，剛好讓過它、再留 12px 空隙。
   貼在 16px 的話第二則會整個落在 tab bar 底下，實測連中心點都按不到。 */
@media(max-width:640px){
  .toast-stack { top:auto; left:16px; right:16px; bottom:calc(142px + env(safe-area-inset-bottom)); flex-direction:column; align-items:stretch; }
  .toast { max-width:none; }
  .toast-close { min-height:44px; width:44px; margin-right:-8px; }
}

/* 判斷不出撥號格式的電話只顯示文字：外觀沿用聯絡方式膠囊，但不要有可以按的 hover 回饋 */
.contact-link-plain { cursor:text; user-select:text; }
.contact-link-plain:hover { color:inherit; background:transparent; }

/* 公司抽屜裡「以這筆為準」：文字按鈕，放在每種寫法的來源底下，不搶不一致提示本身的注意力 */
.company-variants li { display:grid; gap:4px; }
.company-apply { justify-self:start; min-height:32px; padding:4px 0; background:transparent; color:var(--brand); font-size:12px; text-decoration:underline; text-underline-offset:3px; }
.company-apply:hover { color:var(--ink); }
.company-apply:focus-visible { outline:2px solid var(--brand); outline-offset:2px; border-radius:4px; }
@media(max-width:640px){ .company-apply { min-height:44px; } }

/* 「狀態」暫時收起來（app.js 的 SHOW_CLIENT_STATUS）。欄位留在 DOM 裡只是不顯示：
   手機卡片是照第幾欄排版的，真的拿掉一欄，後面的展開箭頭會遞補成被隱藏的第 5 欄。 */
.client-data-table.status-off .status-col { display:none !important; }
.recent-table.no-status .recent-head,.recent-table.no-status .recent-row { grid-template-columns:1fr 1.4fr; }

/* ── 手機觸控目標（/impeccable critique 2026-10-02，Casey）──
   DESIGN.md §10 要求 44×44，以下實測都不到：空狀態按鈕 40、
   匯入／匯出 38、篩選膠囊 40、人才姓名 24、人才專長 36、公司頁聯絡人 24、設定頁 ✎ × 22。
   姓名與專長這類一行一個、或排得很密的，用偽元素往外撐命中區，不把畫面撐大。 */
@media(max-width:640px){
  .main-content .button { min-height:44px; }
  /* .button.tertiary 的優先級比原本那條 .data-menu > summary 高，把 44px 蓋成了 36px */
  .data-menu > summary.button { min-height:44px; }
  .table-filter > summary,.filter-bar .table-filter > summary { min-height:44px; }
  .contact-name-line .link-button { min-width:44px; }
  .company-row td:nth-child(3) .link-button { display:inline-flex; align-items:center; min-height:44px; min-width:44px; }
  /* 兩個字的姓名（「阿尼」32px）和短專長（「3D」37px）高度夠了、寬度不夠；正式資料才量得到 */
  .talent-name .link-button { position:relative; display:inline-block; min-width:44px; }
  .talent-name .link-button::after { content:""; position:absolute; left:0; right:0; top:50%; height:44px; transform:translateY(-50%); }
  .talent-filter-chip { position:relative; min-width:44px; }
  .talent-filter-chip::after { content:""; position:absolute; left:0; right:0; top:50%; height:44px; transform:translateY(-50%); }
  .setting-chip { min-height:44px; padding:0 0 0 12px; gap:0; }
  .setting-chip button { width:44px; height:44px; background:transparent; }
  .settings-tabs button { min-height:44px; }
  .setting-color-picker { width:44px; height:44px; display:grid; place-items:center; }
  .setting-color-picker input { width:44px; height:44px; }
  /* 人才頁的篩選列在手機上可以左右滑，「73 位」排在最後會一開始就在畫面外；移到最前面 */
  .filter-count { order:-1; }
}

/* 關閉、編輯、勾選以前是用 × ✎ ✓ 這些文字字元充當圖示，跟其他線條圖示的粗細、大小對不起來，
   換字型時還會跑掉。現在都用同一套 SVG（index.html 的 #i-close／#i-edit／#i-check，1.7px 線）。 */
.toast-close,.setting-chip button,.setting-rename-ok,.setting-rename-cancel,.active-filter-value i { display:inline-grid; place-items:center; }
.toast-close .icon,.setting-chip button .icon,.setting-rename-ok .icon,.setting-rename-cancel .icon { width:14px; height:14px; }
.active-filter-value i .icon { width:11px; height:11px; stroke-width:2; }
.choice-option i .icon { width:15px; height:15px; stroke-width:2; }
/* 篩選選單的勾號原本是 content:"✓"；改用同一個勾號的形狀當遮罩，顏色仍跟著文字 */
.table-filter-menu button[aria-pressed="true"]::after { content:""; float:right; width:15px; height:15px; margin-top:2px; background:currentColor; color:var(--brand); -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 12.5 4 4 9-9.5'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 12.5 4 4 9-9.5'/%3E%3C/svg%3E") center/contain no-repeat; }
.settings-note .icon { width:14px; height:14px; vertical-align:-2px; }

/* 跳到主要內容：平常藏起來，用鍵盤 Tab 進來的第一站才出現，不用先經過整排側欄 */
.skip-link { position:absolute; left:16px; top:-60px; z-index:30; padding:10px 14px; border-radius:10px; background:var(--brand); color:#141414; font-weight:600; text-decoration:none; transition:top .15s ease; }
.skip-link:focus { top:12px; }
.main-content:focus { outline:none; }
/* 0 位的部門：照樣列出但不是按鈕，沒有 hover 回饋 */
.department-bar-row.is-empty { cursor:default; }
.department-bar-row.is-empty .bar-label span { color:var(--muted); }
/* 費用參考不是警示訊息，不用橘色 */
.drawer-rate { color:var(--ink); }
/* 聯絡方式連結：表格裡沒有底線，抽屜裡卻有；統一不加底線，靠圖示與膠囊外框表示可以按 */
.contact-link { text-decoration:none; }
/* 桌機 toast 往下移，讓開右上角的「匯入／匯出」與帳號選單 */
@media(min-width:641px){ .toast-stack { top:88px; } }

/* Sisense-inspired dark workspace: exact supplied swatches on charcoal surfaces. */
body { background:var(--paper); }
.login-screen { background:var(--paper); }
.sidebar { background:var(--paper); border-right:0; }
.brand-mark,.brand-mark.small { color:var(--brand); background:transparent; border:0; }
.button { border-radius:999px; transition:background-color .18s ease,color .18s ease,border-color .18s ease,transform .18s ease; }
.button.primary { background:var(--palette-lime); color:var(--paper); }
.button.primary:hover { background:var(--palette-lime); filter:brightness(.94); }
.button.secondary { background:var(--palette-charcoal); color:var(--palette-white); border:1px solid var(--line); }
.button.secondary:hover { background:var(--surface-raised); border-color:rgba(239,239,239,.28); }
.button.tertiary { color:var(--palette-white); background:var(--palette-charcoal); border-color:var(--line); }
.button.tertiary:hover { color:var(--palette-lime); background:var(--palette-charcoal); border-color:var(--palette-lime); }
.nav-item { border-radius:999px; color:var(--muted); }
.nav-item:hover { background:var(--palette-charcoal); color:var(--palette-white); }
.nav-item.active,.nav-item[aria-current="page"] { background:var(--palette-white); color:var(--paper); }
.nav-item.active:hover,.nav-item[aria-current="page"]:hover { background:var(--palette-white); color:var(--paper); }
.user-badge { background:var(--palette-charcoal); border-radius:999px; }
.user-initial { background:var(--palette-sage); color:var(--paper); }
.login-card,.stat-card,.data-block,.table-card,.talent-card,.settings-card { background:var(--card); border:0; box-shadow:none; }
.stat-card:first-child { background:var(--palette-sage); color:var(--paper); }
.stat-card:nth-child(3) { background:var(--palette-blue); color:var(--paper); }
.stat-card:is(:first-child,:nth-child(3)) :is(.stat-label,.stat-number,.stat-footer,.stat-top) { color:var(--paper); }
.stat-card:is(:first-child,:nth-child(3)) .stat-icon { color:var(--paper); background:rgba(0,0,0,.09); }
.stat-card:is(:first-child,:nth-child(3)) .stat-footer { opacity:.72; }
.stat-icon { border-radius:50%; background:var(--surface-soft); color:var(--palette-white); }
.bar-track i { background:var(--palette-lime); }
.inline-action,.portfolio-link { color:var(--palette-lime); }
.contact-link,.drawer-contact .contact-link,.talent-card-contact .contact-link { border-radius:999px; }
.icon-button,.detail-toggle,.pagination-actions button { border-radius:50%; }
.table-filter > summary,.filter-bar .table-filter > summary { border-radius:999px; }
.required-mark { color:var(--paper); background:var(--palette-lime); }
.drawer-chip,.person-chip { color:var(--palette-sage); }
.talent-filter-chip { color:var(--palette-sage); border-color:rgba(207,225,202,.2); background:rgba(207,225,202,.08); }
.talent-filter-chip:hover,.talent-filter-chip[aria-pressed="true"] { color:var(--palette-sage); border-color:rgba(207,225,202,.42); background:rgba(207,225,202,.17); }
.person-chip[aria-pressed="true"] { color:var(--palette-sage); box-shadow:inset 0 0 0 1px rgba(207,225,202,.42); }
.chart-tooltip { border:0; border-radius:999px; background:var(--palette-lime); color:var(--paper); }
.chart-block canvas { cursor:pointer; touch-action:pan-y; }
::selection { background:var(--palette-lime); color:var(--paper); }
button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid var(--palette-lime); outline-offset:3px; }
@media(max-width:640px){
  .sidebar { background:var(--paper); }
  .nav-item.active,.nav-item[aria-current="page"] { background:var(--palette-white); color:var(--paper); }
  .table-card { background:transparent; border:0; }
  .data-table tbody tr { border:0; }
  .toolbar .add-button { background:var(--palette-lime); color:var(--paper); }
}

/* Compact desktop navigation and a task-first overview. */
@media(min-width:641px){
  .sidebar { flex:0 0 76px; width:76px; min-width:76px; align-items:center; padding:22px 12px 16px; }
  .sidebar .brand { display:flex; justify-content:center; width:100%; margin:0 0 42px; }
  .sidebar-brand-label,.sidebar .nav-item span { display:none; }
  .sidebar .nav-list { width:100%; gap:10px; }
  .sidebar .nav-item { position:relative; justify-content:center; width:52px; min-height:52px; margin:auto; padding:0; border-radius:50%; }
  .sidebar .nav-item .icon { width:21px; height:21px; }
  .sidebar .nav-item[data-label]::after { content:attr(data-label); position:absolute; z-index:40; left:calc(100% + 12px); top:50%; transform:translateY(-50%) translateX(-4px); padding:8px 11px; border-radius:8px; background:var(--palette-charcoal); color:var(--palette-white); white-space:nowrap; font-size:13px; font-weight:500; opacity:0; pointer-events:none; transition:opacity .15s ease,transform .15s ease; }
  .sidebar .nav-item[data-label]:is(:hover,:focus-visible)::after { opacity:1; transform:translateY(-50%) translateX(0); }
}
.home-add-button { display:inline-flex; align-items:center; gap:7px; min-height:44px; }
.home-add-button .icon { width:18px; height:18px; }
.home-overview { display:grid; grid-template-columns:minmax(300px,.38fr) minmax(0,.62fr); gap:16px; align-items:stretch; margin-bottom:16px; }
.home-overview .stats-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:0; }
.home-overview .stat-card { min-height:170px; display:flex; flex-direction:column; justify-content:space-between; padding:20px 22px; }
.home-overview .stat-number { margin:12px 0; font-size:clamp(30px,3vw,42px); font-variant-numeric:tabular-nums; }
.home-overview .stat-card:first-child { background:var(--palette-charcoal); color:var(--palette-white); }
.home-overview .stat-card:first-child :is(.stat-label,.stat-number,.stat-footer,.stat-top) { color:var(--palette-white); opacity:1; }
.home-overview .stat-card:first-child .stat-icon { color:var(--palette-white); background:var(--surface-soft); }
.home-feature { display:flex; flex-direction:column; min-width:0; min-height:356px; padding:22px 24px; background:var(--palette-sage); color:var(--paper); }
.home-feature-head { display:flex; justify-content:space-between; align-items:center; gap:12px; color:rgba(0,0,0,.68); font-size:12px; }
.home-feature-icon { display:grid; place-items:center; width:38px; height:38px; border-radius:50%; background:rgba(0,0,0,.08); color:var(--paper); }
.home-feature-icon .icon { width:20px; height:20px; }
.home-feature-title { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin:20px 0 14px; }
.home-feature-title h2 { max-width:8em; margin:0; font-size:clamp(20px,2vw,27px); line-height:1.25; font-weight:500; }
.home-feature-title strong { flex:0 0 auto; font-size:clamp(46px,4vw,64px); line-height:.95; font-weight:500; font-variant-numeric:tabular-nums; letter-spacing:-.035em; }
.home-feature-title small { font-size:14px; letter-spacing:0; }
.home-recent-list { display:grid; gap:0; margin:0; padding:0; list-style:none; }
.home-recent-list li { border-top:1px solid rgba(0,0,0,.13); }
.home-recent-list li button { display:grid; grid-template-columns:minmax(0,1fr) auto 18px; align-items:center; gap:8px; width:100%; min-height:44px; padding:8px 2px; background:transparent; color:var(--paper); text-align:left; }
.home-recent-list li button:hover strong { text-decoration:underline; text-underline-offset:3px; }
.home-recent-list li strong,.home-recent-list li span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-recent-list li strong { font-weight:600; }
.home-recent-list li span { max-width:15ch; color:rgba(0,0,0,.67); font-size:12px; }
.home-recent-list li .icon { width:15px; height:15px; }
.home-recent-empty { display:grid; align-content:center; flex:1; gap:12px; border-top:1px solid rgba(0,0,0,.13); }
.home-recent-empty p { margin:0; color:rgba(0,0,0,.68); }
.home-recent-empty button,.home-feature-link { align-self:flex-start; min-height:44px; padding:8px 0; background:transparent; color:var(--paper); font-size:13px; font-weight:600; }
.home-feature-link { margin-top:auto; border-top:1px solid rgba(0,0,0,.13); width:100%; text-align:left; }
.home-feature-link span { float:right; font-size:18px; }
.home-dashboard .refined-grid { grid-template-columns:minmax(0,1.16fr) minmax(320px,.84fr); }
.home-dashboard .chart-block,.home-dashboard .department-block { min-height:348px; }
@media(max-width:1100px){
  .home-dashboard .refined-grid { grid-template-columns:1fr; }
  .home-dashboard .chart-block,.home-dashboard .department-block { min-height:0; }
}
@media(max-width:900px){
  .home-overview { grid-template-columns:1fr; }
  .home-overview .stats-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .home-overview .stat-card { min-height:136px; padding:16px; }
  .home-overview .stat-number { font-size:30px; }
}
@media(max-width:760px){ .home-overview .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:640px){
  .sidebar .nav-item span { display:inline; }
  .home-add-button { width:44px; min-width:44px; padding:0; justify-content:center; }
  .home-add-button span { display:none; }
  .home-overview { gap:12px; margin-bottom:12px; }
  .home-overview .stats-grid { gap:8px; }
  .home-overview .stat-card { min-height:126px; padding:16px; }
  .home-overview .stat-number { font-size:29px; }
  .home-feature { min-height:300px; padding:20px; }
  .home-feature-title { margin:16px 0 12px; }
  .home-feature-title h2 { font-size:21px; }
  .home-feature-title strong { font-size:50px; }
  .home-dashboard .refined-grid { gap:12px; }
}

/* Shared header alignment, card shapes and department emphasis. */
.topbar { align-items:center; min-height:44px; }
.topbar .top-actions { align-items:center; }
.topbar .user-badge,.topbar .data-menu > summary { min-height:44px; }
.stat-card,.data-block,.table-card,.talent-card,.settings-card { border-radius:var(--radius-card); }
.data-menu-panel,.user-menu-panel,.table-filter-menu { border-radius:12px; }
.home-dashboard .home-feature.department-block { min-height:356px; padding:22px 24px; }
.home-feature .block-heading { align-items:center; margin-bottom:16px; }
.home-feature .block-heading h2 { font-size:24px; line-height:32px; font-weight:500; }
.home-feature .block-description { color:rgba(0,0,0,.68); }
.home-feature .department-bars { gap:4px; }
.home-feature .department-bar-row { min-height:44px; padding:4px 0; }
.home-feature .bar-label,.home-feature .bar-label strong,.home-feature .department-bar-row.is-empty .bar-label span { color:var(--paper); }
.home-feature .department-bar-row:hover { background:rgba(0,0,0,.05); }
.home-feature .department-bar-row:hover .bar-label span { color:var(--paper); }
.home-feature .bar-track { height:8px; background:rgba(0,0,0,.12); }
.home-feature .bar-track i { background:var(--palette-charcoal); }
.home-dashboard .recent-block { grid-column:auto; display:flex; flex-direction:column; }
.recent-block .home-recent-list li,.recent-block .home-feature-link,.recent-block .home-recent-empty { border-color:var(--line); }
.recent-block .home-recent-list li button,.recent-block .home-feature-link,.recent-block .home-recent-empty button { color:var(--palette-white); }
.recent-block .home-recent-list li span,.recent-block .home-recent-empty p { color:var(--muted); }
.recent-block .home-feature-link { color:var(--palette-lime); }
.recent-block .home-recent-empty { min-height:220px; }
@media(max-width:900px){ .home-overview { grid-template-columns:1fr; } }
@media(max-width:640px){
  .home-dashboard .home-feature.department-block { min-height:0; padding:20px; }
  .home-feature .block-heading h2 { font-size:21px; line-height:28px; }
}

/* 英文與數字全站用 Urbanist（Sisense 參考作品指定的字體）。它的字面比 Noto Sans TC 小一點，
   所以大標題與統計數字用偏細的字重拉開層次，而不是靠加粗。 */
.page-title { font-size:36px; line-height:44px; font-weight:400; letter-spacing:-.01em; }
.stat-number,.home-overview .stat-number { font-weight:400; letter-spacing:-.01em; }
.topbar { margin-bottom:22px; }
@media(max-width:640px){ .page-title { font-size:28px; line-height:36px; } .topbar { margin-bottom:16px; } }

/* 圓角系統（參考圖）：外層板塊大圓角，往內一層一層變小，可以按的東西一律膠囊或正圓。
   板塊 28 → 板塊裡的面板／浮層 18 → 輸入框 14 → 按鈕、標籤、搜尋 999。 */
:root { --radius-card:28px; --radius-panel:18px; --radius-control:14px; }
.stat-card,.data-block,.table-card,.talent-card,.settings-card,.login-card,.error-card { border-radius:var(--radius-card); }
.dialog { border-radius:var(--radius-card); }
.data-menu-panel,.user-menu-panel,.table-filter-menu,.choice-popover,.date-popover,.page-jump-menu,.company-contact,.upload-row,.import-stat,.form-error,.drawer-cover,.active-filter-group { border-radius:var(--radius-panel); }
.menu-item,.user-menu-panel button,.choice-option,.table-filter-menu button,.page-jump-menu button,.filter-search { border-radius:12px; }
input,select,textarea,.date-trigger,.choice-dropdown > summary { border-radius:var(--radius-control); }
.toolbar input,.setting-add-form input { border-radius:999px; padding-left:18px; padding-right:18px; }
.upload-button,.upload-remove,.website-button,.page-jump > summary,.active-filter-value,.choice-summary-chip,.toast,.toast-action,.form-error-action { border-radius:999px; }
.table-card { padding:24px; }
.data-block { padding:22px 24px; }
.settings-card { padding:24px; }
.toast { padding:12px 18px; }
@media(max-width:640px){
  :root { --radius-card:24px; --radius-panel:16px; }
  .table-card { padding:0; }
  .data-block,.settings-card { padding:20px; }
  .data-table tbody tr { border-radius:20px; padding:16px 14px 14px 16px; }
  .client-summary-row.expanded { border-bottom-left-radius:0; border-bottom-right-radius:0; }
  .client-detail-row { border-radius:0 0 20px 20px; }
  .dialog { border-radius:0; }
  .dialog-small,.dialog-medium { border-radius:var(--radius-card) var(--radius-card) 0 0; }
}

/* 人才卡：每張同樣大小。都有 16:9 封面（沒有預覽圖就是首字），同一列等高、每一列也等高；
   專長標籤最多兩排，多的進抽屜看。 */
.talent-grid { grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); grid-auto-rows:1fr; gap:16px; }
.talent-card-body { display:flex; flex-direction:column; }
.talent-cover-placeholder { background:var(--surface-soft); color:rgba(239,239,239,.42); font-weight:300; font-size:52px; }
.talent-card-body { padding:16px 20px 18px; }
.talent-card .talent-filter-chips { max-height:66px; overflow:hidden; }
.talent-card:hover { box-shadow:inset 0 0 0 1px rgba(239,239,239,.22); }
/* 手機是單欄，全部撐到最高那張會多出一大段空白，所以只統一寬度與封面 */
@media(max-width:640px){ .talent-grid { grid-template-columns:1fr; grid-auto-rows:auto; gap:12px; } .talent-card .talent-filter-chips { max-height:78px; } }

/* 選單設定：選項是一顆膠囊，裡面的色點、改名、移除各佔一個置中的正圓命中區，
   不再各自帶底色（三個小圓擠在一顆膠囊裡，看起來像歪掉）。 */
.settings-tabs { margin-bottom:18px; border-radius:999px; background:var(--card); border:0; }
.settings-tabs button { border-radius:999px; padding:8px 18px; }
.settings-tabs button[aria-selected="true"] { background:var(--palette-white); color:var(--paper); }
.settings-grid { align-items:stretch; }
.settings-card { grid-template-rows:auto minmax(80px,1fr) auto; gap:18px; min-height:240px; }
.settings-card h2 { margin:0; }
.settings-values { gap:8px; }
.setting-chip { display:inline-flex; align-items:center; gap:0; min-height:36px; padding:0 4px 0 14px; border-radius:999px; background:var(--surface-raised); color:var(--ink); font-size:13px; line-height:20px; }
.setting-chip > span { margin-right:6px; white-space:nowrap; }
.setting-chip:has(.setting-color-picker) { padding-left:6px; }
.setting-color-picker { flex:0 0 auto; width:28px; height:28px; margin-right:2px; }
.setting-color-picker i { width:14px; height:14px; box-shadow:0 0 0 2px rgba(239,239,239,.16); }
.setting-chip button { flex:0 0 auto; display:grid; place-items:center; width:28px; height:28px; padding:0; border-radius:50%; background:transparent; color:var(--muted); font-size:13px; line-height:1; }
.setting-chip button:hover { background:rgba(239,239,239,.10); color:var(--ink); }
.setting-chip button[data-setting-remove]:hover { color:var(--danger-text); }
.setting-chip button .icon { width:14px; height:14px; }
.setting-chip[data-renaming] { padding-left:4px; }
.setting-rename-input { width:140px; min-height:0; height:28px; margin-right:4px; padding:2px 12px; border-radius:999px; }
.setting-add-form { gap:10px; }
.setting-add-form .button { flex:0 0 auto; }
@media(max-width:640px){
  .setting-chip { min-height:44px; padding:0 0 0 14px; }
  .setting-chip:has(.setting-color-picker) { padding-left:0; }
  .setting-chip button,.setting-color-picker { width:44px; height:44px; }
  .setting-rename-input { height:36px; font-size:16px; }
}

/* 統計卡：整張可點。標題列＝圓形圖示＋名稱＋右上 ↗；「本週新增客戶」用黃綠色當這一區的焦點。 */
button.stat-card { width:100%; text-align:left; color:var(--ink); font:inherit; cursor:pointer; transition:transform .2s cubic-bezier(.16,1,.3,1); }
button.stat-card > span { display:block; }
button.stat-card .stat-top { display:flex; align-items:center; }
.stat-open { display:grid; place-items:center; width:32px; height:32px; margin-left:auto; border:1px solid var(--line); border-radius:50%; color:var(--muted); transition:background-color .18s ease,color .18s ease,border-color .18s ease; }
.stat-open .icon { width:16px; height:16px; transition:transform .25s cubic-bezier(.16,1,.3,1); }
button.stat-card:hover { transform:translateY(-2px); }
button.stat-card:hover .stat-open { background:var(--palette-white); border-color:transparent; color:var(--paper); }
button.stat-card:hover .stat-open .icon { transform:translate(1px,-1px); }
.home-overview .stat-card:nth-child(4) { background:var(--palette-lime); color:var(--paper); }
.home-overview .stat-card:nth-child(4) :is(.stat-label,.stat-number,.stat-footer,.stat-top) { color:var(--paper); }
.home-overview .stat-card:nth-child(4) .stat-footer { opacity:.72; }
.home-overview .stat-card:nth-child(4) .stat-icon { color:var(--paper); background:rgba(0,0,0,.09); }
.stat-card:is(:nth-child(3),:nth-child(4)) .stat-open { border-color:rgba(0,0,0,.2); color:rgba(0,0,0,.7); }
.stat-card:is(:nth-child(3),:nth-child(4)):hover .stat-open { background:var(--paper); color:var(--palette-white); }
@media (prefers-reduced-motion:reduce) { button.stat-card,.stat-open .icon { transition:none; } button.stat-card:hover { transform:none; } }

/* 首字圓形頭像，可疊成一排（公司頁的聯絡人、人才卡的建立人） */
.avatar { flex:0 0 auto; display:inline-grid; place-items:center; width:30px; height:30px; padding:0; border-radius:50%; background:var(--palette-sage); color:var(--paper); font-size:13px; line-height:1; font-weight:600; }
.avatar-1 { background:var(--palette-blue); }
.avatar-2 { background:var(--palette-white); }
.avatar-more { background:var(--surface-raised); color:var(--ink); font-size:12px; font-weight:500; }
.avatar-stack { display:flex; align-items:center; }
.avatar-stack .avatar { box-shadow:0 0 0 2px var(--card); }
.avatar-stack .avatar + .avatar { margin-left:-8px; }
.avatar-stack button.avatar { position:relative; transition:transform .18s cubic-bezier(.16,1,.3,1); }
.avatar-stack button.avatar:hover,.avatar-stack button.avatar:focus-visible { z-index:1; transform:translateY(-3px); }
.contact-people { display:flex; align-items:center; gap:10px; min-width:0; }
.avatar-caption { min-width:0; color:var(--muted); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.talent-creator { display:inline-flex; align-items:center; gap:6px; }
.talent-creator .avatar { width:22px; height:22px; font-size:11px; }
@media(max-width:640px){
  .avatar-stack { gap:6px; }
  .avatar-stack .avatar { width:44px; height:44px; font-size:15px; box-shadow:none; }
  .avatar-stack .avatar + .avatar { margin-left:0; }
  .contact-people { flex-wrap:wrap; }
}

/* 帳號選單：點頭像後彈出一條膠囊托盤，裡面是白色圓形圖示鈕（參考圖的工具列）。
   文字收進滑鼠提示；螢幕閱讀器仍讀得到按鈕裡的文字。 */
.user-menu[open] > .user-badge { background:var(--palette-white); color:var(--paper); border-color:transparent; }
.user-menu-panel { top:calc(100% + 12px); display:flex; align-items:center; gap:6px; width:auto; padding:6px; border:0; border-radius:999px; background:var(--surface-raised); box-shadow:0 14px 34px rgba(0,0,0,.5); transform-origin:calc(100% - 28px) -12px; }
.user-menu[open] > .user-menu-panel { animation:tray-in .26s cubic-bezier(.16,1,.3,1); }
@keyframes tray-in { from { opacity:0; transform:translateY(-6px) scale(.86); } }
.user-menu-panel::before { content:""; position:absolute; right:22px; top:-5px; width:12px; height:12px; border-radius:3px; background:var(--surface-raised); transform:rotate(45deg); }
.user-menu-name { position:absolute; width:1px; height:1px; margin:-1px; padding:0; border:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.user-menu-panel button { position:relative; display:grid; place-items:center; flex:0 0 auto; width:46px; min-height:46px; height:46px; padding:0; border-radius:50%; background:var(--palette-white); color:var(--paper); transition:background-color .18s ease,transform .18s cubic-bezier(.16,1,.3,1); }
.user-menu-panel button .icon { width:19px; height:19px; }
.user-menu-panel button > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.user-menu-panel button:hover { background:var(--palette-lime); color:var(--paper); transform:translateY(-1px); }
.user-menu-panel button[data-label]::after { content:attr(data-label); position:absolute; top:calc(100% + 12px); left:50%; transform:translateX(-50%); padding:6px 10px; border-radius:999px; background:var(--palette-charcoal); color:var(--palette-white); font-size:12px; line-height:16px; white-space:nowrap; opacity:0; pointer-events:none; transition:opacity .15s ease; }
.user-menu-panel button[data-label]:is(:hover,:focus-visible)::after { opacity:1; }
.user-menu-panel button#logoutButton[data-label]::after { left:auto; right:0; transform:none; }
@media (prefers-reduced-motion:reduce) { .user-menu[open] > .user-menu-panel { animation:none; } }

/* ── 內距系統（對照 Sisense 參考圖量出來的比例）──
   板塊：內距＝圓角（28／手機 22），文字不會落在圓角的弧線裡。
   膠囊：左右內距＝高度的一半（44 高 → 22；36 高 → 16；30 高 → 14）。
   膠囊裡包圓形（頭像、圖示）：圓形四周留 6，文字離右緣 18。
   浮層：外框 8，選項 12×14。 */
.stat-card,.home-overview .stat-card { padding:24px; }
.data-block,.settings-card,.table-card,.home-feature,.home-dashboard .home-feature.department-block { padding:28px; }
.talent-card-body { padding:18px 22px 22px; }
.drawer-header { padding:20px 28px; }
.drawer-body { padding:24px 28px 32px; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:0 22px; }
.button.tertiary,.topbar .data-menu > summary { min-height:44px; padding:0 20px; gap:10px; }
.toolbar input,.setting-add-form input { min-height:44px; padding:0 22px; }
.user-badge,.topbar .user-badge { gap:10px; min-height:44px; padding:6px 18px 6px 6px; }
.table-filter > summary,.filter-bar .table-filter > summary { gap:8px; min-height:36px; padding:0 16px; margin:0; }
.data-table th .table-filter > summary { margin:0 -16px; }
.page-jump > summary { padding:0 16px; }
.tag,.type-tag { padding:5px 12px; }
.talent-filter-chip,.person-chip,.department-chip,.client-department-chip { padding:6px 14px; }
.choice-summary-chip { padding:4px 10px; }
.drawer-chip { padding:3px 12px; }
.website-button { padding:7px 14px; }
.upload-button { padding:0 16px; }
.active-filter-group { padding:10px 14px; }
.active-filter-value { padding:4px 8px 4px 12px; }
input,select,textarea,.date-trigger,.choice-dropdown > summary { padding-left:14px; padding-right:14px; }
.data-menu-panel { padding:8px; }
.menu-item { padding:12px 14px; }
.table-filter-menu,.choice-popover { padding:8px; }
.table-filter-menu button,.choice-option { padding:10px 12px; }
.filter-search { padding:8px 14px; }
.chart-tooltip { padding:6px 12px; }
.toast { padding:12px 20px; }
.company-contact,.import-stat,.form-error { padding:14px 16px; }
.upload-row { padding:16px 18px; }
.sidebar .nav-item[data-label]::after { padding:8px 14px; border-radius:999px; }
.setting-chip { padding-left:16px; }
/* 表格：儲存格文字對齊板塊內距；hover 的底色往外多出 12px，文字不貼底色邊 */
.table-card .table-wrap { margin-inline:-12px; }
.data-table tbody tr:hover td:first-child { border-radius:14px 0 0 14px; }
.data-table tbody tr:hover td:last-child { border-radius:0 14px 14px 0; }
.table-pagination { padding:18px 0 0; }
@media(max-width:640px){
  .stat-card,.home-overview .stat-card { padding:18px; }
  .data-block,.settings-card,.home-feature,.home-dashboard .home-feature.department-block { padding:22px; }
  .table-card { padding:0; }
  .table-card .table-wrap { margin-inline:0; }
  .data-table tbody tr { padding:18px; }
  .data-table tbody tr:hover td { border-radius:0; }
  .drawer-header { padding:14px 18px; }
  .drawer-body { padding:18px 18px calc(24px + env(safe-area-inset-bottom)); }
  .table-filter > summary,.filter-bar .table-filter > summary { min-height:44px; padding:0 16px; }
  .contact-link { padding:10px 16px 10px 14px; }
  .toolbar input { min-height:48px; }
}

/* 新增：只留一顆黃綠色的 ＋ 圓鈕，和右上角的頭像膠囊同高（44） */
.add-button,.home-add-button { flex:0 0 44px; width:44px; min-width:44px; height:44px; min-height:44px; padding:0; border-radius:50%; }
.add-button .icon,.home-add-button .icon { width:20px; height:20px; stroke-width:2; }
.add-button > span,.home-add-button > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media(max-width:640px){
  .toolbar .add-button { width:56px; min-width:56px; height:56px; min-height:56px; padding:0; border-radius:50%; }
  .toolbar .add-button .icon { width:24px; height:24px; }
  .home-add-button span { display:block; }
}

/* 圖示的虛實（照參考圖）：標題左邊的圖示是「外框圓」，右邊可以按的是「實心圓」 */
.stat-top { gap:12px; }
.stat-icon { width:40px; height:40px; border:1px solid rgba(239,239,239,.24); background:transparent; color:var(--palette-white); }
.home-overview .stat-card:first-child .stat-icon { background:transparent; }
.stat-open { width:40px; height:40px; border:0; background:var(--surface-raised); color:var(--palette-white); }
.stat-card:is(:nth-child(3),:nth-child(4)) .stat-icon,.home-overview .stat-card:nth-child(4) .stat-icon { border-color:rgba(0,0,0,.28); background:transparent; color:var(--paper); }
.stat-card:is(:nth-child(3),:nth-child(4)) .stat-open { border:0; background:rgba(0,0,0,.09); color:var(--paper); }
.block-icon { flex:0 0 auto; display:grid; place-items:center; width:44px; height:44px; border:1px solid rgba(0,0,0,.28); border-radius:50%; color:var(--paper); }
.block-icon .icon { width:20px; height:20px; }
.home-feature .block-heading { justify-content:flex-start; align-items:center; gap:14px; margin-bottom:20px; }

/* 各部門新增客戶：名稱｜長條｜人數與佔比，三欄各自對齊；長條加粗成圓頭 */
.home-feature .department-bars { gap:2px; }
.home-feature .department-bar-row { display:grid; grid-template-columns:5.5em minmax(0,1fr) auto; align-items:center; gap:18px; width:auto; min-height:44px; margin:0 -14px; padding:0 14px; border-radius:999px; color:var(--paper); font-size:14px; }
.home-feature .department-bar-row:hover { background:rgba(0,0,0,.07); }
.dept-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; }
.home-feature .bar-track { height:12px; background:rgba(0,0,0,.10); }
.home-feature .bar-track i { min-width:12px; background:var(--palette-charcoal); }
.home-feature .department-bar-row.is-empty .bar-track i { display:none; }
.home-feature .department-bar-row.is-empty { color:rgba(0,0,0,.6); }
.dept-count { display:grid; grid-template-columns:2.6ch 4.2ch; align-items:baseline; gap:6px; text-align:right; font-variant-numeric:tabular-nums; }
.dept-count strong { font-size:18px; line-height:24px; font-weight:500; }
.dept-count small { color:rgba(0,0,0,.62); font-size:12px; line-height:18px; }
@media(max-width:640px){ .home-feature .department-bar-row { grid-template-columns:4.8em minmax(0,1fr) auto; gap:12px; } }

/* 分段切換（客戶資料庫／人才資料庫）：外框留 6，裡面的膠囊 44 高、左右 24 */
.settings-tabs { gap:4px; padding:6px; margin-bottom:20px; }
.settings-tabs button { min-height:44px; padding:0 24px; font-size:14px; }
@media(max-width:640px){ .data-table th .table-filter > summary { margin:0; } }
.toolbar .add-button,.setting-add-form .add-button { border-radius:50%; }

/* ── 形狀：不是全部膠囊。可以按、裝文字的東西改成圓角矩形；只有人（頭像）、圖示底圓、長條維持圓形。
   板塊 28 → 控制項 14 → 標籤 9。 */
:root { --radius-control:14px; --radius-chip:9px; }
.button,.toolbar input,.toolbar .button,.setting-add-form input,.user-badge,.page-jump > summary,.upload-button,.upload-remove,.website-button,.toast,.table-filter > summary,.filter-bar .table-filter > summary,.toolbar .add-button,.setting-add-form .add-button,.add-button,.home-add-button { border-radius:var(--radius-control); }
.button { padding:0 18px; }
.add-button,.home-add-button { padding:0; }
.toolbar input,.setting-add-form input { padding:0 16px; }
.user-badge,.topbar .user-badge { padding:6px 16px 6px 6px; }
.table-filter > summary,.filter-bar .table-filter > summary { padding:0 14px; }
.data-table th .table-filter > summary { margin:0 -14px; }
.contact-link,.drawer-contact .contact-link,.talent-card-contact .contact-link { border-radius:12px; }
.icon-button,.detail-toggle,.pagination-actions button { border-radius:12px; }
.tag,.type-tag,.talent-filter-chip,.person-chip,.department-chip,.client-department-chip,.drawer-chip,.active-filter-value,.choice-summary-chip,.required-mark { border-radius:var(--radius-chip); }
.tag,.type-tag { padding:4px 10px; }
.chart-tooltip,.toast-action,.form-error-action,.sidebar .nav-item[data-label]::after,.user-menu-panel button[data-label]::after { border-radius:10px; }
.nav-item { border-radius:var(--radius-control); }
@media(min-width:641px){ .sidebar .nav-item { border-radius:16px; } }
.home-feature .department-bar-row { border-radius:12px; }
.settings-tabs { border-radius:16px; padding:5px; }
.settings-tabs button { border-radius:11px; padding:0 26px; }
.setting-chip { border-radius:11px; }
.setting-chip button,.setting-rename-input { border-radius:8px; }
.user-menu-panel { border-radius:20px; }
.user-menu-panel button { border-radius:14px; }
@media(max-width:640px){
  .toolbar .add-button { border-radius:18px; }
  .data-table th .table-filter > summary { margin:0; }
}

/* 圖示虛實換回原本的：左邊的圖示是實心底圓，右上的 ↗ 是外框圓 */
.stat-icon,.home-overview .stat-card:first-child .stat-icon { border:0; background:var(--surface-soft); }
.stat-open { border:1px solid var(--line); background:transparent; color:var(--muted); }
.stat-card:is(:nth-child(3),:nth-child(4)) .stat-icon,.home-overview .stat-card:nth-child(4) .stat-icon { border:0; background:rgba(0,0,0,.09); }
.stat-card:is(:nth-child(3),:nth-child(4)) .stat-open { border:1px solid rgba(0,0,0,.24); background:transparent; color:rgba(0,0,0,.72); }
.block-icon { border:0; background:rgba(0,0,0,.08); }

/* 部門列的人數與佔比：同一個字級、同一條基線，只用粗細和深淺分主次 */
.dept-count { grid-template-columns:2.4ch 3.8ch; align-items:center; gap:10px; font-size:14px; line-height:20px; }
.dept-count strong { font-size:inherit; line-height:inherit; font-weight:600; }
.dept-count small { font-size:inherit; line-height:inherit; color:rgba(0,0,0,.6); }

/* 客戶、公司、人才三頁同一種版面：搜尋列與篩選列直接放在頁面上，內容（表格或卡片牆）在下面 */
.list-view .toolbar,.talent-view .toolbar { margin:0 0 12px; }
.list-view .filter-bar,.talent-view .filter-bar,.list-view .list-sort-bar { margin:0 0 16px; }
.list-view .active-filter-groups { padding:0 0 16px; }
@media(max-width:640px){ .list-view .filter-bar,.list-view .list-sort-bar { margin:0 -16px 12px; } }

/* 標籤：文字垂直置中、同一個高度，不靠 padding 猜 */
.tag,.type-tag,.talent-filter-chip,.person-chip,.department-chip,.client-department-chip,.drawer-chip { display:inline-flex; align-items:center; justify-content:center; min-height:28px; padding:0 10px; font-size:12px; line-height:1; }
.talent-card .talent-filter-chips { align-items:center; max-height:62px; }
.table-filter > summary { line-height:1; }
.table-filter > summary .filter-chevron { transform:rotate(45deg) translate(-2px,-2px); }
.table-filter[open] > summary .filter-chevron { transform:rotate(225deg) translate(-1px,-1px); }
@media(max-width:640px){ .talent-filter-chip,.person-chip,.department-chip,.client-department-chip { min-height:36px; } .talent-card .talent-filter-chips { max-height:78px; } }

/* 名字：滑過或展開時只變色，不加底色 */
.link-button:hover,.link-button:focus-visible,.company-row .link-button:hover { background:transparent; color:var(--palette-lime); }
.link-button[aria-expanded="true"] { color:var(--palette-lime); }
@media(min-width:641px){ .data-table .contact-link:hover { background:transparent; } }
/* 列的 hover 底色是直角 */
.data-table tbody tr:hover td:first-child,.data-table tbody tr:hover td:last-child { border-radius:0; }

/* 編輯：一顆筆的圖示鈕 */
.edit-button { display:inline-grid; place-items:center; width:40px; height:40px; background:var(--surface-raised); color:var(--ink); }
.edit-button:hover { background:var(--palette-lime); color:var(--paper); }
.edit-button .icon { width:17px; height:17px; }
.icon-button { display:inline-grid; place-items:center; width:40px; height:40px; }
.setting-label { width:auto !important; height:auto !important; margin-right:6px; padding:0; border-radius:4px !important; background:transparent !important; color:var(--ink) !important; font-size:13px; line-height:20px; white-space:nowrap; cursor:text; }
.setting-label:hover { color:var(--palette-lime) !important; }

/* 手機：展開的詳細內容和上面那張卡接成一張，中間不留圓角缺口。
   之前把每列的圓角加大時，連詳細列也套到四個圓角。 */
@media(max-width:640px){
  .data-table tbody tr.client-summary-row.expanded { border-radius:20px 20px 0 0; }
  .data-table tbody tr.client-detail-row { display:block; margin-top:-10px; padding:0; border:0; border-radius:0 0 20px 20px; background:var(--card); }
  .data-table tbody tr.client-detail-row.hidden { display:none; }
  .data-table tbody tr.client-detail-row > td { display:block; padding:0 18px 18px; }
  .detail-actions .edit-button,.edit-button,.icon-button { width:44px; height:44px; }
  .setting-label { min-height:44px; }
}
/* 統計卡在中等寬度維持兩欄：四欄會把名稱擠成兩行 */
@media(max-width:900px){ .home-overview .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.stat-label { white-space:nowrap; }

/* 形狀規則（定案）：按下去會「做事」的是圓角矩形（按鈕、輸入框、分頁、＋、導覽）；
   用來「標示或篩選」的是膠囊（標籤、篩選／排序鈕、設定頁的選項）。 */
.tag,.type-tag,.talent-filter-chip,.person-chip,.department-chip,.client-department-chip,.drawer-chip,.active-filter-value,.choice-summary-chip,.setting-chip { border-radius:999px; }
.table-filter > summary,.filter-bar .table-filter > summary,.page-jump > summary { border-radius:999px; padding:0 16px; }
.data-table th .table-filter > summary { margin:0 -16px; }
.tag,.type-tag,.talent-filter-chip,.person-chip,.department-chip,.client-department-chip,.drawer-chip { padding:0 12px; }
.setting-chip button:not(.setting-label) { border-radius:50%; }
@media(max-width:640px){ .data-table th .table-filter > summary { margin:0; } }

/* 中等寬度（平板、半個螢幕的視窗）：表格不再往右被切掉。欄位跟著縮，聯絡方式太長就省略，
   公司頁把地址收進抽屜（點公司名就看得到）。 */
@media(min-width:641px) and (max-width:1100px){
  .table-card { padding:22px; }
  .table-wrap { overflow-x:visible; }
  .data-table,.client-data-table { min-width:0; table-layout:fixed; }
  .data-table th,.data-table td { padding:14px 10px; overflow-wrap:anywhere; }
  .client-data-table .contact-cell,.contact-cell { min-width:0; }
  .contact-methods { max-width:100%; }
  .contact-link { max-width:100%; }
  .client-data-table th:nth-child(1) { width:24%; }
  .client-data-table th:nth-child(2) { width:26%; }
  .client-data-table th:nth-child(3) { width:30%; }
  .client-data-table th:nth-child(5) { width:auto; }
  .detail-toggle-head,.detail-toggle-cell { width:44px; }
  .company-row td:nth-child(5),.data-table:not(.client-data-table) th:nth-child(5) { display:none; }
  .detail-section-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .avatar-caption { white-space:normal; }
}
@media(min-width:641px) and (max-width:820px){
  .client-data-table th:nth-child(5),.client-data-table .client-summary-row td:nth-child(5) { display:none; }
  .client-data-table th:nth-child(1) { width:30%; }
  .client-data-table th:nth-child(2) { width:30%; }
  .client-data-table th:nth-child(3) { width:auto; }
}

/* 客戶詳細內容的編輯鈕：放在面板右上角、和第一個小標同一列，一展開就看得到 */
.client-detail-panel { position:relative; }
.client-detail-panel .detail-actions { position:absolute; top:4px; right:0; padding:0; border:0; }
@media(min-width:641px) and (max-width:1100px){
  .avatar-caption { white-space:nowrap; overflow-wrap:normal; }
  .data-table:not(.client-data-table) th:nth-child(1) { width:30%; }
  .data-table:not(.client-data-table) th:nth-child(2) { width:19%; }
  .data-table:not(.client-data-table) th:nth-child(3) { width:31%; }
}
/* 固定欄寬時，欄寬要加總到 100%：被隱藏的欄位（狀態、窄版的夢想 P）在展開詳細內容時
   會被 colspan 撐出空欄，沒有分完的寬度會被它們吃掉。 */
@media(min-width:641px) and (max-width:1100px){
  .client-data-table th:nth-child(5) { width:calc(20% - 44px); }
}
@media(min-width:641px) and (max-width:820px){
  .client-data-table th:nth-child(3) { width:calc(40% - 44px); }
}
/* 表格欄寬不能用 calc() 混百分比（瀏覽器會當成 auto），改成純百分比 */
@media(min-width:641px) and (max-width:1100px){
  .client-data-table th:nth-child(5) { width:14%; }
  .person-chip,.talent-filter-chip,.department-chip { white-space:nowrap; }
}
@media(min-width:641px) and (max-width:820px){
  .client-data-table th:nth-child(3) { width:34%; }
}

/* 每列右邊：編輯（筆）＋展開（箭頭）排在一起 */
.row-actions { display:flex; align-items:center; justify-content:flex-end; gap:2px; }
.row-edit { display:grid; place-items:center; flex:0 0 auto; width:36px; height:36px; padding:0; border-radius:12px; background:transparent; color:var(--muted); }
.row-edit .icon { width:16px; height:16px; }
.row-edit:hover,.detail-toggle:hover { background:transparent; color:var(--palette-lime); }
.detail-toggle-head,.detail-toggle-cell { width:92px; }
.detail-toggle-cell .detail-toggle { margin-left:0; }
@media(max-width:640px){
  .row-edit { width:44px; height:44px; }
  .row-actions { margin:-6px -4px -6px 0; }
  .detail-toggle { margin:0; }
}

/* 中等寬度：被收起來的欄位改成「寬度 0 的儲存格」而不是 display:none。
   欄位數量和展開列的 colspan 對得上，剩下的寬度才會留給聯絡方式，而不是被空欄吃掉。 */
@media(min-width:641px) and (max-width:1100px){
  .client-data-table.status-off .status-col { display:table-cell !important; width:0 !important; padding:0 !important; border-left:0; border-right:0; visibility:hidden; overflow:hidden; white-space:nowrap; }
  .client-data-table th:nth-child(1) { width:24%; }
  .client-data-table th:nth-child(2) { width:25%; }
  .client-data-table th:nth-child(3) { width:auto; }
  .client-data-table th:nth-child(5) { width:15%; }
  .detail-toggle-head,.detail-toggle-cell,.client-data-table th:nth-child(6) { width:88px; }
}
@media(min-width:641px) and (max-width:820px){
  .client-data-table th:nth-child(5),.client-data-table .client-summary-row td:nth-child(5) { display:table-cell; width:0 !important; padding:0 !important; visibility:hidden; overflow:hidden; white-space:nowrap; }
  .client-data-table th:nth-child(1) { width:29%; }
  .client-data-table th:nth-child(2) { width:27%; }
  .client-data-table th:nth-child(3) { width:auto; }
}

/* 總覽在很窄的寬度（手機、窄視窗）：圖示不被擠扁，名稱放不下就換到圖示下面一行，↗ 收起來（整張卡本來就能點） */
.stat-icon,.stat-open,.block-icon { flex:0 0 auto; }
.stat-label { min-width:0; overflow:hidden; text-overflow:ellipsis; }
@media(max-width:480px){
  button.stat-card .stat-top { flex-wrap:wrap; gap:10px; }
  .stat-icon { width:36px; height:36px; }
  .stat-label { flex:1 0 100%; white-space:normal; }
  .stat-open { display:none; }
  .home-feature .block-heading { gap:12px; margin-bottom:14px; }
  .home-feature .block-heading h2 { font-size:19px; line-height:26px; }
  .block-icon { width:40px; height:40px; }
  .home-feature .department-bar-row { grid-template-columns:4.6em minmax(0,1fr) auto; gap:10px; margin:0 -8px; padding:0 8px; }
  .dept-count { grid-template-columns:2.2ch 3.4ch; gap:6px; }
}
@media(max-width:340px){
  .data-block,.settings-card,.home-feature,.home-dashboard .home-feature.department-block { padding:18px; }
  .stat-card,.home-overview .stat-card { padding:16px; }
  .page-title { font-size:24px; line-height:32px; }
}

/* ── 表單 ──
   聚焦：只把外框變亮，不加一圈光暈。 */
input:focus,select:focus,textarea:focus { border-color:rgba(239,239,239,.62); box-shadow:none; }
.date-trigger:hover,.date-trigger:focus-visible,.choice-dropdown > summary:focus-visible,.choice-dropdown[open] > summary { border-color:rgba(239,239,239,.62); outline:none; }
input[aria-invalid="true"],textarea[aria-invalid="true"] { border-color:var(--danger-text); box-shadow:none; }
/* 必填：標題後面一個黃綠色小點，不寫字 */
.required-mark { display:inline-block; width:6px; height:6px; margin:0 0 0 2px; padding:0; border-radius:50%; background:var(--palette-lime); vertical-align:middle; }
/* 名片照片放在表單最上面：先拍照、再照著填 */
.upload-row.upload-first { margin:4px 0 18px; border-style:dashed; border-color:rgba(239,239,239,.2); }
.upload-row.upload-first .card-preview { max-height:220px; }
.form-section:first-of-type { border-top:0; padding-top:4px; }
/* 少用的欄位收成一列，標題旁寫已填幾項 */
.form-section-more { padding:8px 0 14px; }
.form-more { margin-top:0; }
.form-more > summary { display:flex; width:100%; min-height:44px; color:var(--ink); font-size:15px; font-weight:600; }
.form-more > summary::before { order:3; margin-left:auto; transform:rotate(45deg); }
.form-more[open] > summary::before { transform:rotate(225deg); }
.form-more-count { margin-left:10px; color:var(--muted); font-size:13px; font-weight:400; }
.form-more > .form-grid { margin-top:6px; }
/* 刪除：平常是一顆安靜的垃圾桶，滑過去才變紅；確認視窗裡的刪除也不用整顆實心紅 */
.delete-button { margin-right:auto; background:transparent; color:var(--muted); }
.delete-button:hover { background:var(--danger-soft); color:var(--danger-text); }
.button.danger { background:rgba(255,143,135,.16); color:var(--danger-text); }
.button.danger:hover { background:rgba(255,143,135,.26); filter:none; }
/* 新增公司：已連結的成員 */
.member-chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.member-chips:empty { display:none; }
.member-chip { display:inline-flex; align-items:center; gap:8px; min-height:40px; padding:4px 6px 4px 5px; border-radius:999px; background:var(--surface-raised); font-size:13px; }
.member-chip > span:not(.avatar) { display:grid; line-height:18px; }
.member-chip small { color:var(--muted); font-size:12px; }
.member-chip button { display:grid; place-items:center; width:28px; height:28px; padding:0; border-radius:50%; background:transparent; color:var(--muted); }
.member-chip button:hover { background:rgba(239,239,239,.1); color:var(--ink); }
.member-chip button .icon { width:14px; height:14px; }
@media(max-width:640px){ .delete-button { flex:0 0 44px; } .dialog-actions .delete-button { flex:0 0 44px; } .member-chip button { width:44px; height:44px; } }
#companyDialog .dialog-form { padding:0 28px; }
#companyDialog .dialog-actions { border-top:1px solid var(--line); }
@media(max-width:640px){ #companyDialog { height:100dvh; max-height:100dvh; margin:0; border-radius:0; } #companyDialog .dialog-form { min-height:100%; padding:0 16px; } }
/* hidden 屬性一律生效（.choice-field 的 display:grid 會把它蓋掉，收起來的「聯絡狀態」因此還看得到） */
[hidden] { display:none !important; }

/* 必填：欄位名稱右上角一個小點（像上標），不佔一格位置 */
.label-text { display:inline-flex; align-items:flex-start; gap:3px; }
.required-mark { width:5px; height:5px; margin:2px 0 0; background:var(--palette-lime); }
#talentSpecialtyChoiceField .choice-label::after,#clientCreatorChoiceField .choice-label::after,#departmentChoiceField .choice-label::after,#dateLabel::after { content:""; display:inline-block; width:5px; height:5px; margin-left:3px; border-radius:50%; background:var(--palette-lime); vertical-align:top; transform:translateY(2px); }
#dateLabel { display:block; }

/* 掃描名片：左邊一顆掃描圖示鈕，右邊是狀態（辨識中、帶入了幾個欄位） */
.upload-row.scan-row { grid-template-columns:auto minmax(0,1fr) auto; border:0; padding:0; margin:6px 0 20px; gap:14px; }
.scan-button { display:grid; place-items:center; width:52px; height:52px; padding:0; border:1px solid var(--line); border-radius:16px; background:var(--surface-raised); color:var(--ink); transition:background-color .18s ease,color .18s ease,border-color .18s ease; }
.scan-button .icon { width:24px; height:24px; }
.scan-button:hover { background:var(--palette-lime); border-color:transparent; color:var(--paper); }
.scan-row .upload-copy strong { font-size:14px; font-weight:500; }
.scan-row .upload-copy span[role="status"] { color:var(--muted); font-size:12px; white-space:normal; }
.scan-row .upload-copy span[role="status"]:empty { display:none; }
.scan-row .card-preview { grid-column:1/-1; max-height:200px; border-radius:14px; }
.drawer-empty { margin:0 0 14px; font-size:13px; line-height:20px; }

/* 捲軸：細的、深色的，不要瀏覽器預設那條亮灰色 */
* { scrollbar-width:thin; scrollbar-color:rgba(239,239,239,.22) transparent; }
::-webkit-scrollbar { width:8px; height:8px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { border-radius:999px; background:rgba(239,239,239,.2); }
::-webkit-scrollbar-thumb:hover { background:rgba(239,239,239,.34); }

/* 「至少填一種」的欄位用空心點，和實心的必填點區分 */
.required-mark.one-of { background:transparent; box-shadow:inset 0 0 0 1px var(--palette-lime); }
/* 輸入框底下的建議清單：貼著輸入框，寬度一樣 */
.suggest { position:relative; display:block; }
.suggest-list { position:absolute; z-index:45; top:calc(100% + 6px); left:0; right:0; display:flex; flex-direction:column; gap:2px; max-height:260px; overflow:auto; padding:8px; border:1px solid var(--line); border-radius:var(--radius-panel); background:var(--surface-raised); box-shadow:0 12px 30px rgba(0,0,0,.4); }
.suggest-option { display:flex; align-items:baseline; justify-content:space-between; gap:12px; width:100%; min-height:40px; padding:9px 12px; border-radius:12px; background:transparent; color:var(--ink); text-align:left; font-size:14px; font-weight:400; }
.suggest-option:hover { background:rgba(239,239,239,.08); }
.suggest-option small { flex:0 0 auto; color:var(--muted); font-size:12px; }
.library-button { color:var(--ink); text-decoration:underline; text-underline-offset:3px; }
/* 電腦上「掃描」和「從相簿選」都是開檔案視窗，只留一顆 */
@media(pointer:fine){ .library-button { display:none; } }
@media(max-width:640px){ .suggest-option { min-height:44px; font-size:15px; } }
/* 捲軸一律不顯示（還是可以捲）：深色介面上那條亮線很突兀，而且會從圓角邊框凸出去 */
* { scrollbar-width:none; }
::-webkit-scrollbar { display:none; width:0; height:0; }
.suggest-option { flex:0 0 auto; }

/* 「至少填一種」也用實心點 */
.required-mark.one-of { background:var(--palette-lime); box-shadow:none; }

/* 展開的東西捲進畫面時，下方留出表單底部按鈕列的高度，不會被它蓋住 */
.choice-popover,.date-popover,.suggest-list,.form-more > .form-grid,.table-filter-menu,.page-jump-menu { scroll-margin:16px 0 104px; }

/* 手機：下拉選單貼在欄位正下方（以前固定在畫面底部，離欄位很遠，看起來像飄走） */
@media(max-width:640px){
  .choice-popover { position:absolute; top:calc(100% + 8px); bottom:auto; left:0; right:0; max-height:300px; }
  .date-popover { position:absolute; top:calc(100% + 8px); bottom:auto; left:0; right:0; width:auto; }
}

/* ── 選單 ──
   按鈕：右邊的箭頭放在一個小圓裡，打開時小圓變亮。
   選項：每列右邊一個小圓圈，選了才填滿打勾；文字不變色，靠圓圈看選取狀態。 */
.choice-dropdown > summary { gap:10px; padding:6px 8px 6px 14px; transition:border-color .18s ease,background-color .18s ease; }
.choice-dropdown > summary:hover { border-color:rgba(239,239,239,.3); }
.choice-dropdown[open] > summary { background:var(--surface-soft); }
.dropdown-chevron { position:relative; flex:0 0 28px; width:28px; height:28px; border:0; border-radius:50%; background:rgba(239,239,239,.08); transform:none; transition:background-color .18s ease; }
.dropdown-chevron::before { content:""; position:absolute; left:50%; top:50%; width:7px; height:7px; border-right:1.5px solid var(--ink); border-bottom:1.5px solid var(--ink); transform:translate(-50%,-70%) rotate(45deg); transition:transform .2s cubic-bezier(.16,1,.3,1),border-color .18s ease; }
.choice-dropdown[open] .dropdown-chevron { background:var(--palette-lime); transform:none; }
.choice-dropdown[open] .dropdown-chevron::before { border-color:var(--paper); transform:translate(-50%,-30%) rotate(225deg); }
.choice-summary-chip { min-height:28px; padding:0 10px; border:0; background:rgba(239,239,239,.1); color:var(--ink); }
.choice-popover,.table-filter-menu { gap:2px; padding:8px; border:1px solid var(--line); border-radius:var(--radius-panel); background:var(--surface-raised); backdrop-filter:none; box-shadow:0 16px 36px rgba(0,0,0,.45); }
.choice-option + .choice-option { margin-top:0; }
.choice-option,.table-filter-menu button { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:42px; padding:8px 10px 8px 14px; border-radius:12px; color:var(--ink); font-size:14px; }
.choice-option:hover,.table-filter-menu button:hover { background:rgba(239,239,239,.07); color:var(--ink); }
.choice-option[aria-pressed="true"],.table-filter-menu button[aria-pressed="true"] { background:rgba(239,239,239,.05); color:var(--ink); }
.choice-option i { display:grid; place-items:center; flex:0 0 22px; width:22px; height:22px; border:1.5px solid rgba(239,239,239,.28); border-radius:50%; color:transparent; transition:background-color .15s ease,border-color .15s ease; }
.choice-option i .icon { width:13px; height:13px; stroke-width:2.4; }
.choice-option[aria-pressed="true"] i { display:grid; border-color:transparent; background:var(--palette-lime); color:var(--paper); }
.table-filter-menu button::after,.table-filter-menu button[aria-pressed="true"]::after { content:""; float:none; flex:0 0 22px; width:22px; height:22px; margin:0; box-sizing:border-box; border:1.5px solid rgba(239,239,239,.28); border-radius:50%; background:transparent; -webkit-mask:none; mask:none; }
.table-filter-menu button[aria-pressed="true"]::after { border-color:transparent; background:var(--palette-lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 12.5 4 4 9-9.5'/%3E%3C/svg%3E") center/13px no-repeat; }
.table-filter-menu button[hidden] { display:none; }
.filter-search { margin:0 0 6px; border-radius:12px; }
/* 篩選／排序按鈕：有選東西時整顆變亮底深字，一眼看得出哪個篩選開著 */
.table-filter > summary { transition:background-color .18s ease,color .18s ease,border-color .18s ease; }
.filter-bar .table-filter.has-value > summary,.table-filter.has-value > summary { border-color:transparent; background:var(--palette-white); color:var(--paper); }
.filter-bar .table-filter[open] > summary { border-color:rgba(239,239,239,.4); }
.data-table th .table-filter > summary:hover { background:rgba(239,239,239,.08); color:var(--ink); }
.data-table th .table-filter.has-value > summary { background:var(--palette-white); color:var(--paper); }
@media(max-width:640px){ .choice-option,.table-filter-menu button { min-height:46px; font-size:15px; } }

/* ── 明暗層次（對照參考圖重新量）──
   參考圖的板塊比 #303030 暗很多：畫布純黑 → 板塊 #1E1E1E → 板塊上的按鈕、輸入框 #2C2C2C。
   #303030 留給放在黑色畫布上的東西（右上角的按鈕）。 */
:root { --card:#1e1e1e; --surface-raised:#2c2c2c; --surface-soft:#151515; --line:rgba(239,239,239,.09); }
.home-overview .stat-card:first-child { background:var(--card); }
.date-popover,.chart-tooltip { background:var(--surface-raised); }
.chart-tooltip { background:var(--palette-lime); }
.sidebar .nav-item:hover { background:var(--card); }

/* ── 少用外框線：用「底色深淺」分層，不用線框 ──
   留下來的線只有兩種：清單列與列之間的細分隔線、鍵盤聚焦時的外框。 */
input,select,textarea,.date-trigger,.choice-dropdown > summary { border-color:transparent; }
input:focus,select:focus,textarea:focus,.date-trigger:focus-visible,.choice-dropdown > summary:focus-visible { border-color:rgba(239,239,239,.5); }
.choice-dropdown > summary:hover,.date-trigger:hover,.choice-dropdown[open] > summary { border-color:transparent; }
.choice-dropdown > summary[aria-invalid="true"],.date-trigger[aria-invalid="true"],.choice-dropdown > summary[aria-invalid="true"]:focus-visible,.date-trigger[aria-invalid="true"]:focus-visible { border-color:var(--danger-text); }
.button.secondary,.button.tertiary,.user-badge,.scan-button,.website-button,.upload-button,.page-jump > summary,.pagination-actions button { border-color:transparent; }
.button.secondary:hover,.button.tertiary:hover { border-color:transparent; background:#3a3a3a; color:var(--palette-white); }
.table-card .button.secondary,.dialog .button.secondary,.drawer .button.secondary,.settings-card .button.secondary { background:var(--surface-raised); }
.table-filter > summary,.filter-bar .table-filter > summary { border:0; background:var(--card); color:var(--ink); }
.filter-bar .table-filter[open] > summary { background:var(--surface-raised); }
.data-table th .table-filter > summary { background:transparent; color:var(--muted); }
.talent-filter-chip,.talent-filter-chip:hover,.talent-filter-chip[aria-pressed="true"] { border:0; }
.choice-popover,.table-filter-menu,.suggest-list,.data-menu-panel,.date-popover,.page-jump-menu { border:0; }
.contact-link,.drawer-contact .contact-link,.talent-card-contact .contact-link { border-color:transparent; }
.company-contact { border:0; background:var(--surface-raised); }
.talent-card:hover { box-shadow:none; background:#242424; }
.talent-card-foot { border-top:0; padding-top:4px; }
.form-section { border-top:0; padding-top:10px; }
.dialog-actions { border-top:0; box-shadow:0 -12px 16px -8px var(--card); }
#companyDialog .dialog-actions { border-top:0; }
.drawer { border-left:0; }
.drawer-header { border-bottom:0; padding-bottom:8px; }
.drawer-section { border-top:0; padding:14px 0; }
.detail-section { border-bottom:0; padding:12px 0; }
.user-menu-name { border-bottom:0; }
.home-recent-list li:first-child { border-top:0; }
.settings-tabs { background:var(--card); }
@media(max-width:640px){
  .sidebar { border-top:0; background:rgba(0,0,0,.92); }
  .dialog-header { border-bottom:0; }
  .contact-link { background:var(--surface-raised); }
}

/* 本週新增聯絡人：跟「各部門新增客戶」同一種列——滑過去整列亮起來；姓名開那一位，部門與填寫人是各自的按鈕，點了看那個部門／那個人的名單 */
.recent-block .home-recent-list { gap:2px; }
.recent-block .home-recent-list li { display:grid; grid-template-columns:minmax(0,1fr) 84px 84px; align-items:center; gap:10px; min-height:44px; margin:0 -14px; padding:0 14px; border-top:0; border-radius:12px; }
.recent-block .home-recent-list li:hover { background:rgba(255,255,255,.06); }
.recent-block .home-recent-list li button.recent-name { display:block; width:100%; min-height:44px; margin:0; padding:0; font-size:14px; }
.recent-block .home-recent-list li button.recent-name:hover strong { text-decoration:none; }
.recent-block .home-recent-list li strong { display:block; font-weight:500; }
.recent-block .home-recent-list .recent-cell { display:flex; max-width:none; min-width:0; overflow:visible; font-size:12px; }
.recent-block .home-recent-list .recent-cell button { display:inline-flex; width:auto; max-width:100%; min-height:28px; padding:0 12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.recent-block .home-recent-list .recent-cell .person-chip { background:rgba(237,255,140,.12); color:var(--palette-sage); }
.recent-block .home-recent-list .recent-cell .person-chip:hover { background:rgba(237,255,140,.20); }
@media(max-width:640px){ .recent-block .home-recent-list li { grid-template-columns:minmax(0,1fr) auto auto; gap:8px; margin:0 -8px; padding:0 8px; } .recent-block .home-recent-list .recent-cell button { min-height:36px; } }

/* 人才的作品圖片：跟其他欄位同一種安靜的列，不用虛線框；縮圖五格等大，點了放大 */
.upload-row.portfolio-image-row { margin:0; padding:0; border:0; }
.portfolio-image-row .upload-button:disabled { opacity:.45; cursor:default; }
.portfolio-thumbs { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; grid-column:1/-1; margin:0; padding:0; list-style:none; }
.portfolio-thumbs[hidden] { display:none; }
.portfolio-thumbs li { position:relative; aspect-ratio:1; }
.portfolio-thumb { display:block; width:100%; height:100%; padding:0; overflow:hidden; border-radius:14px; background:var(--surface-raised); cursor:zoom-in; }
.portfolio-thumb img { display:block; width:100%; height:100%; object-fit:cover; transition:transform .25s ease; }
.portfolio-thumb:hover img { transform:scale(1.04); }
.portfolio-thumb:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.portfolio-thumbs li.is-uploading .portfolio-thumb img { opacity:.4; }
.portfolio-thumb-remove { position:absolute; top:6px; right:6px; display:grid; place-items:center; width:26px; height:26px; padding:0; border-radius:999px; background:rgba(0,0,0,.72); color:var(--palette-white); }
.portfolio-thumb-remove::before { content:""; position:absolute; inset:-9px; }
.portfolio-thumb-remove .icon { width:14px; height:14px; }
.portfolio-thumb-remove:hover { color:var(--palette-lime); }
.lightbox { width:100vw; max-width:none; height:100dvh; max-height:none; margin:0; padding:56px 72px; border:0; background:transparent; }
.lightbox[open] { display:grid; place-items:center; }
.lightbox::backdrop { background:rgba(0,0,0,.9); }
.lightbox img { max-width:100%; max-height:calc(100dvh - 112px); border-radius:14px; object-fit:contain; }
.lightbox .icon-button { position:fixed; width:44px; height:44px; display:grid; place-items:center; }
.lightbox-close { top:16px; right:16px; }
.lightbox-step { top:50%; transform:translateY(-50%); font-size:26px; line-height:1; }
.lightbox-step[hidden] { display:none; }
.lightbox-prev { left:16px; }
.lightbox-next { right:16px; }
.lightbox-count { position:fixed; bottom:18px; left:50%; transform:translateX(-50%); color:var(--muted); font-size:13px; }
@media(max-width:640px){ .lightbox { padding:64px 12px; } .lightbox img { max-height:calc(100dvh - 128px); } .lightbox-step { top:auto; bottom:12px; transform:none; } }

/* 2026-10-12 審查修正 */
/* 淺色卡（部門卡、藍灰與黃綠 KPI 卡）裡的焦點框：黃綠框在這些底色上只有 1.3:1 以下，改用畫布黑。 */
:is(.department-block,.home-overview .stat-card:nth-child(3),.home-overview .stat-card:nth-child(4)) :is(button,a,summary):focus-visible { outline-color:var(--paper); }
.detail-creator { display:none; }
.type-tags { display:inline-flex; flex-wrap:wrap; gap:6px; }
/* 啟動時確認登入與載入資料的那幾秒：畫面中央顯示標誌，不要整片全黑讓人以為當機。
   載入快的時候不閃一下：前 0.3 秒不顯示，之後才淡入並緩慢明暗。 */
.boot-mark { position:fixed; inset:0; display:none; place-items:center; color:var(--palette-lime); pointer-events:none; }
.boot-mark .brand-moon { width:44px; height:44px; }
.login-screen.is-checking .boot-mark { display:grid; opacity:0; animation:boot-in .4s cubic-bezier(.16,1,.3,1) .3s forwards, boot-pulse 1.6s ease-in-out .7s infinite alternate; }
@keyframes boot-in { to { opacity:1; } }
@keyframes boot-pulse { from { opacity:1; } to { opacity:.45; } }
@media (prefers-reduced-motion:reduce) { .login-screen.is-checking .boot-mark { animation:boot-in .01s linear .3s forwards; } }
/* 人在設定頁時，帳號選單裡的「選單設定」維持黃綠色（跟滑過去同一個顏色，但不會浮起來） */
.user-menu-panel button[aria-current="page"],.user-menu-panel button[aria-current="page"]:hover { background:var(--palette-lime); color:var(--paper); transform:none; }
/* 作品圖片：兩張以上可以指定封面。左下的圓圈跟下拉選單的單選圓圈同一套長相（空心＝沒選、黃綠打勾＝選了）。 */
.portfolio-cover-pick { position:absolute; left:6px; bottom:6px; display:inline-flex; align-items:center; justify-content:center; gap:2px; min-width:24px; height:24px; padding:0; border-radius:999px; background:rgba(0,0,0,.72); box-shadow:inset 0 0 0 1.5px rgba(239,239,239,.6); color:transparent; font-size:12px; line-height:1; font-weight:500; white-space:nowrap; }
.portfolio-cover-pick > span { display:none; }
.portfolio-cover-pick[aria-pressed="true"] > span { display:inline; }
.portfolio-cover-pick::before { content:""; position:absolute; inset:-10px; }
.portfolio-cover-pick .icon { width:14px; height:14px; stroke-width:2.4; }
.portfolio-cover-pick:hover { box-shadow:inset 0 0 0 1.5px var(--palette-lime); }
.portfolio-cover-pick[aria-pressed="true"] { padding:0 9px 0 6px; background:var(--palette-lime); box-shadow:none; color:var(--paper); }
.portfolio-cover-pick:focus-visible { outline:2px solid var(--palette-lime); outline-offset:2px; }
.portfolio-thumbs li.is-cover .portfolio-thumb { box-shadow:0 0 0 2px var(--palette-lime); }
.portfolio-link-tag { position:absolute; top:6px; right:6px; display:grid; place-items:center; width:26px; height:26px; border-radius:999px; background:rgba(0,0,0,.72); color:var(--palette-white); }
.portfolio-link-tag .icon { width:14px; height:14px; }
@media(max-width:640px){ .portfolio-thumbs { grid-template-columns:repeat(3,minmax(0,1fr)); } }
/* 人才表單的聯絡方式：三格收成一組，黃點放在組標題上，代表「這一組至少填一種」。組內的小標退成次要色，讓組標題當主角。 */
.contact-group { display:grid; gap:8px; min-width:0; }
.contact-group > .label-text { font-weight:500; color:var(--ink); }
.contact-group-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.form-section .contact-group-fields label { color:var(--muted); font-size:13px; font-weight:400; }
@media(max-width:640px){ .contact-group-fields { grid-template-columns:1fr; } }
/* KPI 卡的說明換行時兩行等長，窄螢幕不會只剩一個字掉到第二行 */
.stat-footer { text-wrap:balance; }
.pagination-actions button .icon,.calendar-heading button .icon { width:16px; height:16px; }
.lightbox-step .icon { width:24px; height:24px; }
@media(max-width:640px){
  .person-chip,.client-department-chip,.company-name { position:relative; }
  .person-chip::after,.client-department-chip::after,.company-name::after { content:""; position:absolute; left:0; right:0; top:50%; height:44px; transform:translateY(-50%); }
  .page-jump-menu button { height:44px; }
  /* 名單建立人：桌機在表格欄位裡，手機卡片不放（會亂），所以只在手機的展開內容補上，篩得到就看得到。 */
  .detail-creator { display:block; }
  .company-contact .link-button { position:relative; }
  .company-contact .link-button::after { content:""; position:absolute; left:0; right:0; top:50%; height:44px; transform:translateY(-50%); }
  /* 人才頁的篩選列比照客戶／公司頁貼齊 16px 邊距 */
  .talent-view .filter-bar { margin:0 -16px 12px; }
}
