:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-muted: #eef4f2;
  --ink: #1d2528;
  --muted: #647176;
  --line: #dbe4e2;
  --teal: #0f9f8f;
  --teal-dark: #08786d;
  --blue: #3178c6;
  --orange: #c97817;
  --red: #c44949;
  --green-soft: #e6f5f1;
  --blue-soft: #e8f1fb;
  --orange-soft: #fbf0df;
  --red-soft: #fae9e9;
  --shadow: 0 18px 50px rgba(31, 45, 47, 0.12);
  --radius: 8px;
  --sidebar-width: 280px;
  --detail-width: 390px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    "Segoe UI",
    "Microsoft YaHei",
    Arial,
    sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

body.auth-locked .app-shell,
body.auth-locked .fab,
body.registration-locked .app-shell,
body.registration-locked .fab,
body.registration-locked .login-screen,
body.startup-blocked .app-shell,
body.startup-blocked .fab,
body.startup-blocked .login-screen,
body.startup-blocked .registration-screen {
  display: none !important;
}

body:not(.auth-locked) .login-screen {
  display: none;
}

body:not(.registration-locked) .registration-screen {
  display: none;
}

.login-screen,
.registration-screen,
.startup-screen {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.registration-card,
.startup-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 26px;
  border: 1px solid rgba(203, 213, 225, 0.74);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand strong {
  display: block;
  color: #102a5c;
  font-size: 20px;
  font-weight: 900;
}

.login-brand small,
.login-copy span {
  color: var(--muted);
  line-height: 1.5;
}

.login-copy {
  display: grid;
  gap: 6px;
}

.login-copy h1 {
  margin: 0;
  color: #102a5c;
  font-size: 28px;
  line-height: 1.15;
}

.login-card label {
  display: grid;
  gap: 8px;
  color: #496795;
  font-size: 13px;
  font-weight: 800;
}

.login-card input {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  outline: 0;
  color: #102a5c;
  font-weight: 700;
}

.login-card input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.link-btn {
  width: fit-content;
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
}

.link-btn:hover {
  color: #1d4ed8;
}

.recovery-panel {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.recovery-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.startup-actions {
  display: grid;
  gap: 10px;
}

.login-error {
  min-height: 20px;
  margin: -4px 0 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  background: #17272a;
  color: #edf5f3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand strong {
  display: block;
  font-size: 20px;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: rgba(237, 245, 243, 0.72);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 9px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #11a897, #347cc8);
}

.brand-mark span {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: #fff;
}

.brand-mark span:nth-child(2) {
  width: 72%;
  justify-self: start;
}

.brand-mark span:nth-child(3) {
  width: 46%;
  justify-self: start;
}

.nav-group,
.quick-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item,
.quick-panel button,
.secondary-btn,
.primary-btn,
.icon-btn,
.fab {
  border: 0;
  border-radius: var(--radius);
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease;
}

.nav-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  background: transparent;
  color: rgba(237, 245, 243, 0.82);
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.nav-item b {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  text-align: center;
}

.quick-panel {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.quick-panel > span {
  color: rgba(237, 245, 243, 0.72);
  font-size: 13px;
}

.quick-panel button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  text-align: left;
}

.quick-panel button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.tray-widget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #0d1b1e;
  color: rgba(237, 245, 243, 0.82);
  font-size: 13px;
}

.tray-widget div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tray-widget strong {
  color: #fff;
  white-space: nowrap;
}

.tray-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1ed2a6;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.25;
}

h3 {
  font-size: 16px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(520px, 52vw);
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.icon-btn:hover {
  background: var(--surface-muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-tile {
  min-height: 112px;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 6px 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-tile p {
  margin: 1px 0 0;
  color: var(--muted);
}

.metric-tile strong {
  font-size: 28px;
  line-height: 1;
}

.metric-icon {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
}

.metric-icon.teal {
  background: var(--green-soft);
  color: var(--teal-dark);
}

.metric-icon.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.metric-icon.red {
  background: var(--red-soft);
  color: var(--red);
}

.metric-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(410px, 1fr) minmax(330px, var(--detail-width));
  gap: 18px;
  align-items: start;
}

.task-panel,
.detail-panel,
.settings-page {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.task-panel {
  min-width: 0;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfb;
  overflow-x: auto;
}

.segmented button {
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.segmented button.active {
  background: var(--ink);
  color: #fff;
}

.select-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

select {
  min-height: 34px;
  padding: 6px 32px 6px 10px;
}

.task-list {
  max-height: calc(100vh - 278px);
  min-height: 420px;
  overflow: auto;
}

.task-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.task-item:hover,
.task-item.active {
  background: #f7fbfa;
}

.task-item.active {
  box-shadow: inset 4px 0 0 var(--teal);
}

.task-main {
  min-width: 0;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.task-title-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta,
.detail-meta,
.activity-list,
.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-meta span,
.detail-meta span,
.task-tags span,
.status-badge,
.priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4f2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.priority-badge.high {
  background: var(--red-soft);
  color: var(--red);
}

.priority-badge.medium {
  background: var(--orange-soft);
  color: var(--orange);
}

.priority-badge.low {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-badge.done {
  background: #e4f4e9;
  color: #21834a;
}

.status-badge.overdue {
  background: var(--red-soft);
  color: var(--red);
}

.status-badge.progress {
  background: var(--blue-soft);
  color: var(--blue);
}

.due-column {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.detail-panel {
  position: sticky;
  top: 26px;
  min-height: 612px;
  padding: 18px;
}

.detail-empty {
  min-height: 560px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-head h2 {
  margin-top: 6px;
}

.detail-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-section h3 {
  margin-bottom: 10px;
}

.detail-section p {
  margin-bottom: 0;
  color: #3d494d;
  line-height: 1.65;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.primary-btn,
.secondary-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  font-weight: 700;
}

.primary-btn {
  background: var(--teal);
  color: #fff;
}

.primary-btn:hover {
  background: var(--teal-dark);
}

.secondary-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-btn:hover {
  background: var(--surface-muted);
}

.danger-btn {
  border-color: rgba(239, 68, 68, 0.28);
  color: #b42318;
}

.danger-btn:hover {
  border-color: rgba(239, 68, 68, 0.62);
  color: #991b1b;
  background: #fff5f5;
}

.activity-list {
  flex-direction: column;
}

.activity-list span {
  color: var(--muted);
  line-height: 1.45;
}

.settings-page {
  padding: 20px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  gap: 14px;
}

.settings-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.settings-block h3 {
  margin-bottom: 0;
}

.desktop-toggle {
  min-height: 42px;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid rgba(15, 159, 143, 0.16);
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.74);
  color: #174256;
  font-weight: 800;
}

.desktop-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.settings-block label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3d494d;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #3d494d;
}

.shortcut-row span {
  min-width: 76px;
  color: var(--muted);
}

kbd {
  min-width: 30px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #f7faf9;
  text-align: center;
  font-size: 12px;
}

.fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 54px;
  height: 54px;
  display: none;
  place-items: center;
  background: var(--teal);
  color: #fff;
  box-shadow: var(--shadow);
}

.task-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: min(86vh, 860px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.task-dialog::backdrop {
  background: rgba(13, 27, 30, 0.42);
}

.task-dialog form,
.recognition-dialog {
  background: #fff;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 22px;
}

.form-grid label,
.recognition-input label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.recognition-input textarea {
  width: 100%;
  padding: 10px 12px;
  outline: 0;
  color: var(--ink);
  font-weight: 400;
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.assignment-field {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.assignment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.assignment-head strong {
  color: var(--teal-dark);
  font-size: 13px;
}

.assignment-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #e5e7eb;
}

.assignment-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-weight: 900;
  cursor: pointer;
}

.assignment-tabs button.active {
  background: #fff;
  color: var(--teal-dark);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.assignment-picker {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.recognition-assignment-field {
  padding: 12px;
  background: #fff;
}

.recognition-assignment-field .assignment-picker {
  max-height: 184px;
}

.assignment-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(49, 120, 198, 0.14);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.96);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.assignment-toolbar div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.assignment-toolbar button {
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(49, 120, 198, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.assignment-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.assignment-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assignment-selected-list.compact {
  max-height: 78px;
  overflow: auto;
}

.assignment-chip {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 5px;
  border: 1px solid rgba(15, 159, 143, 0.22);
  border-radius: 999px;
  background: #e7f8f5;
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 900;
}

.assignment-chip span {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
}

.assignment-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.assignment-chip svg {
  width: 13px;
  height: 13px;
}

.assignment-chip.static {
  cursor: default;
}

.assignment-member-preview {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(15, 159, 143, 0.18);
  border-radius: 8px;
  background: #f0fdfa;
}

.assignment-member-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.assignment-member-preview-head strong {
  color: var(--teal-dark);
}

.assignment-empty-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px dashed rgba(49, 120, 198, 0.22);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.assignment-empty-note svg {
  width: 16px;
  height: 16px;
  color: var(--blue);
}

.assignment-result-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.assignment-result-list {
  display: grid;
  gap: 6px;
}

.assignment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.assignment-row.multi {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.assignment-check {
  width: 22px;
  height: 22px;
  display: inline-grid !important;
  place-items: center;
  border: 1px solid rgba(49, 120, 198, 0.28);
  border-radius: 999px;
  background: #fff;
  color: #3178c6;
}

.assignment-row.multi.active .assignment-check {
  border-color: rgba(15, 159, 143, 0.48);
  background: #0f9f8f;
  color: #fff;
}

.assignment-check svg {
  width: 14px;
  height: 14px;
}

.assignment-row:hover,
.assignment-row.active {
  border-color: rgba(20, 184, 166, 0.35);
  background: #e7f8f5;
}

.assignment-row.muted {
  cursor: default;
  opacity: 0.76;
}

.assignment-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-row small {
  color: var(--muted);
}

.task-scope-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
}

.task-scope-tabs button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(49, 120, 198, 0.18);
  border-radius: 999px;
  background: #fff;
  color: #496795;
  font-size: 13px;
  font-weight: 900;
}

.task-scope-tabs button.active {
  border-color: rgba(15, 159, 143, 0.34);
  background: #e6f5f1;
  color: #08786d;
}

.reminder-field {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.reminder-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 700;
}

.reminder-field label {
  flex-direction: row;
  align-items: center;
  color: #3d494d;
  font-weight: 400;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 22px;
  border-top: 1px solid var(--line);
}

.recognition-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
  padding: 20px 22px 22px;
}

.recognition-input,
.recognition-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 142px;
  padding: 18px;
  border: 1px dashed #9eb5b0;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(15, 159, 143, 0.08), rgba(49, 120, 198, 0.08)),
    #fbfdfd;
  color: var(--muted);
  text-align: center;
}

.drop-zone strong {
  color: var(--ink);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.recognition-result {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfb;
}

.recognition-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.recognition-card strong {
  line-height: 1.4;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #132427;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.icp-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 120;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.icp-footer a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #647176;
  font-size: 12px;
  line-height: 1.3;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(31, 45, 47, 0.1);
  pointer-events: auto;
}

.icp-footer a:hover {
  color: #3178c6;
}

.top-copy {
  min-width: 0;
}

.ai-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #5a6c72;
  font-size: 13px;
}

.dialog-inline {
  margin-top: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #20d8b5;
  box-shadow: 0 0 0 6px rgba(32, 216, 181, 0.12);
}

.ai-command-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(36, 224, 193, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(36, 224, 193, 0.11), rgba(104, 169, 255, 0.09)),
    var(--surface);
}

.ai-command-strip strong {
  display: block;
  margin: 9px 0 4px;
  font-size: 17px;
}

.ai-command-strip p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(36, 224, 193, 0.12);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.pipeline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pipeline span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  white-space: nowrap;
}

.image-preview {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfb;
}

.image-preview-main {
  display: grid;
  gap: 8px;
}

.image-preview-main img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 6px;
  background: #0f1d24;
}

.image-preview span {
  color: var(--muted);
  font-size: 12px;
}

.image-preview-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.image-preview-chip {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px 8px 5px 5px;
  border: 1px solid rgba(49, 120, 198, 0.16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.image-preview-chip.active {
  border-color: rgba(15, 159, 143, 0.42);
  background: #e7f8f5;
}

.image-preview-chip img {
  width: 42px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  background: #0f1d24;
}

.image-preview-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 800;
}

.image-preview-chip svg,
.image-preview-remove svg {
  width: 14px;
  height: 14px;
}

.image-preview-remove {
  width: 34px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(196, 73, 73, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--red);
  cursor: pointer;
}

.drop-zone.dragging {
  border-color: var(--teal);
  background:
    linear-gradient(135deg, rgba(15, 159, 143, 0.16), rgba(49, 120, 198, 0.14)),
    #fbfdfd;
}

.recognition-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recognition-result-head h3 {
  margin-bottom: 0;
}

#modelStatus {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(36, 224, 193, 0.12);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.recognition-empty,
.recognition-loading {
  min-height: 240px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.recognition-loading span {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(36, 224, 193, 0.18);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.model-summary {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(36, 224, 193, 0.18);
  border-radius: var(--radius);
  background: rgba(36, 224, 193, 0.08);
}

.model-summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.model-summary p,
.recognition-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.recognition-card-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.recognition-card-title span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: rgba(36, 224, 193, 0.12);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Premium dark technology skin */
body.tech-skin,
body {
  background:
    linear-gradient(rgba(110, 231, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 231, 255, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #04080d 0%, #07131c 43%, #0b111b 100%);
  background-size: 36px 36px, 36px 36px, auto;
  color: #f4fbff;
}

:root {
  --bg: #04080d;
  --surface: rgba(8, 20, 29, 0.92);
  --surface-muted: rgba(13, 34, 48, 0.94);
  --ink: #f4fbff;
  --muted: #98b4c2;
  --line: rgba(110, 231, 255, 0.2);
  --teal: #24f0d0;
  --teal-dark: #85fff0;
  --blue: #63a8ff;
  --orange: #f4c26a;
  --red: #ff6478;
  --green-soft: rgba(36, 240, 208, 0.13);
  --blue-soft: rgba(99, 168, 255, 0.15);
  --orange-soft: rgba(244, 194, 106, 0.15);
  --red-soft: rgba(255, 100, 120, 0.15);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(8, 20, 29, 0.98), rgba(4, 10, 16, 0.97)),
    #050c12;
  border-right: 1px solid rgba(110, 231, 255, 0.18);
}

.brand-mark {
  background: linear-gradient(135deg, #24f0d0, #63a8ff 58%, #f4c26a);
  box-shadow: 0 0 32px rgba(36, 240, 208, 0.32);
}

.workspace {
  background:
    linear-gradient(180deg, rgba(124, 232, 218, 0.04), transparent 280px),
    transparent;
}

.search-box,
.metric-tile,
.task-panel,
.detail-panel,
.settings-page,
.settings-block,
.task-dialog,
.task-dialog form,
.recognition-dialog,
.icon-btn,
.secondary-btn,
.recognition-card,
.recognition-result,
.image-preview {
  background:
    linear-gradient(180deg, rgba(12, 31, 43, 0.96), rgba(5, 15, 23, 0.95)),
    rgba(5, 15, 23, 0.95);
  border-color: var(--line);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    inset 0 -1px 0 rgba(110, 231, 255, 0.045);
}

.metric-tile,
.task-panel,
.detail-panel,
.ai-command-strip,
.settings-page {
  box-shadow: var(--shadow);
}

.metric-tile,
.task-panel,
.detail-panel,
.ai-command-strip {
  position: relative;
  overflow: hidden;
}

.metric-tile::before,
.task-panel::before,
.detail-panel::before,
.ai-command-strip::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(36, 240, 208, 0.9), rgba(99, 168, 255, 0.68), transparent);
  pointer-events: none;
}

.topbar h1,
.detail-head h2,
.dialog-head h2,
.settings-header h2,
.recognition-card strong,
.task-title-row strong {
  color: #f6fffd;
}

.ai-inline,
.metric-tile p,
.detail-section p,
.settings-block label,
.shortcut-row,
.select-label,
.task-meta span,
.due-column,
.model-summary p,
.recognition-card p,
.image-preview span,
.ai-command-strip p {
  color: var(--muted);
}

.search-box input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.recognition-input textarea,
select,
input,
textarea {
  background: rgba(5, 16, 20, 0.78);
  border-color: rgba(124, 232, 218, 0.18);
  color: var(--ink);
}

.search-box input::placeholder,
textarea::placeholder,
input::placeholder {
  color: rgba(159, 181, 186, 0.74);
}

.segmented,
.panel-toolbar,
.dialog-head,
.dialog-actions,
.detail-head,
.detail-section {
  border-color: var(--line);
}

.segmented {
  background: rgba(5, 16, 20, 0.62);
}

.segmented button {
  color: var(--muted);
}

.segmented button.active {
  background: linear-gradient(135deg, #24e0c1, #68a9ff);
  color: #061015;
}

.task-item {
  background: rgba(10, 23, 28, 0.72);
  border-bottom-color: var(--line);
  color: var(--ink);
}

.task-item:hover,
.task-item.active {
  background: rgba(24, 51, 59, 0.86);
}

.task-meta span,
.detail-meta span,
.task-tags span,
.status-badge,
.priority-badge,
.pipeline span,
kbd {
  background: rgba(124, 232, 218, 0.09);
  border: 1px solid rgba(124, 232, 218, 0.12);
  color: #cfe6e6;
}

.priority-badge.high,
.status-badge.overdue {
  background: rgba(255, 105, 116, 0.14);
  color: #ffb2b8;
}

.priority-badge.medium {
  background: rgba(255, 177, 93, 0.14);
  color: #ffd2a1;
}

.priority-badge.low,
.status-badge.progress {
  background: rgba(104, 169, 255, 0.14);
  color: #bad7ff;
}

.status-badge.done {
  background: rgba(44, 218, 137, 0.14);
  color: #94f1c1;
}

.primary-btn {
  background: linear-gradient(135deg, #24f0d0, #63a8ff 72%, #f4c26a);
  color: #041018;
  box-shadow:
    0 14px 28px rgba(36, 240, 208, 0.2),
    0 0 0 1px rgba(244, 194, 106, 0.18) inset;
}

.primary-btn:hover {
  background: linear-gradient(135deg, #85fff0, #8dc1ff 72%, #ffdc96);
}

.secondary-btn,
.icon-btn {
  border-color: rgba(124, 232, 218, 0.2);
}

.secondary-btn:hover,
.icon-btn:hover {
  background: rgba(28, 57, 66, 0.9);
}

.drop-zone {
  border-color: rgba(110, 231, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(36, 240, 208, 0.14), rgba(99, 168, 255, 0.12)),
    rgba(4, 12, 19, 0.88);
  outline: none;
}

.drop-zone strong {
  color: #f6fffd;
}

.drop-zone.dragging {
  background:
    linear-gradient(135deg, rgba(36, 240, 208, 0.22), rgba(244, 194, 106, 0.16)),
    rgba(4, 12, 19, 0.92);
}

.drop-zone:focus-visible {
  border-color: rgba(244, 194, 106, 0.72);
  box-shadow:
    0 0 0 3px rgba(244, 194, 106, 0.11),
    0 0 32px rgba(36, 240, 208, 0.16);
}

/* High-saturation emphasis pass */
:root {
  --teal: #12ffd6;
  --teal-dark: #8dfff2;
  --blue: #33a3ff;
  --orange: #ffc44d;
  --red: #ff4168;
}

.ai-command-strip {
  border-color: rgba(18, 255, 214, 0.5);
  background:
    radial-gradient(circle at 8% 15%, rgba(18, 255, 214, 0.32), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(51, 163, 255, 0.28), transparent 30%),
    linear-gradient(120deg, rgba(12, 44, 55, 0.96), rgba(9, 20, 34, 0.96));
}

.ai-chip {
  background: linear-gradient(135deg, rgba(18, 255, 214, 0.28), rgba(51, 163, 255, 0.22));
  color: #bafff4;
  box-shadow: 0 0 22px rgba(18, 255, 214, 0.24);
}

.ai-command-strip strong {
  color: #ffffff;
  text-shadow: 0 0 20px rgba(18, 255, 214, 0.28);
}

.pipeline span {
  border-color: rgba(18, 255, 214, 0.28);
  background: rgba(18, 255, 214, 0.13);
  color: #dffcff;
}

.nav-item.active {
  background:
    linear-gradient(90deg, rgba(18, 255, 214, 0.22), rgba(51, 163, 255, 0.14)),
    rgba(255, 255, 255, 0.08);
  box-shadow: inset 3px 0 0 #12ffd6;
}

.metric-tile {
  border-color: rgba(18, 255, 214, 0.25);
}

.metric-tile:nth-child(1) {
  background:
    linear-gradient(135deg, rgba(18, 255, 214, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(12, 31, 43, 0.98), rgba(5, 15, 23, 0.95));
}

.metric-tile:nth-child(2) {
  background:
    linear-gradient(135deg, rgba(255, 196, 77, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(12, 31, 43, 0.98), rgba(5, 15, 23, 0.95));
}

.metric-tile:nth-child(3) {
  background:
    linear-gradient(135deg, rgba(255, 65, 104, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(12, 31, 43, 0.98), rgba(5, 15, 23, 0.95));
}

.metric-tile:nth-child(4) {
  background:
    linear-gradient(135deg, rgba(51, 163, 255, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(12, 31, 43, 0.98), rgba(5, 15, 23, 0.95));
}

.metric-icon.teal {
  background: rgba(18, 255, 214, 0.18);
  color: #7dfff0;
}

.metric-icon.orange {
  background: rgba(255, 196, 77, 0.18);
  color: #ffd984;
}

.metric-icon.red {
  background: rgba(255, 65, 104, 0.18);
  color: #ff9aae;
}

.metric-icon.blue {
  background: rgba(51, 163, 255, 0.18);
  color: #a3d4ff;
}

.task-item.active {
  box-shadow:
    inset 4px 0 0 #12ffd6,
    inset 0 0 0 1px rgba(18, 255, 214, 0.08);
}

.primary-btn,
.fab {
  background: linear-gradient(135deg, #12ffd6 0%, #33a3ff 55%, #ffc44d 100%);
  color: #041018;
  box-shadow:
    0 18px 34px rgba(18, 255, 214, 0.24),
    0 0 0 1px rgba(255, 196, 77, 0.22) inset;
}

.model-config-block {
  grid-column: span 2;
  border-color: rgba(255, 196, 77, 0.32);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 196, 77, 0.16), transparent 34%),
    radial-gradient(circle at 0% 0%, rgba(18, 255, 214, 0.15), transparent 30%),
    linear-gradient(180deg, rgba(12, 31, 43, 0.98), rgba(5, 15, 23, 0.95));
}

.wecom-settings-block {
  order: -2;
  grid-column: span 2;
  border-color: rgba(34, 197, 94, 0.28);
  background:
    radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.13), transparent 30%),
    linear-gradient(180deg, rgba(247, 253, 250, 0.96), rgba(255, 255, 255, 0.95));
}

.cloud-reminder-settings-block {
  order: -1;
  grid-column: span 2;
  border-color: rgba(14, 165, 233, 0.3);
  background:
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(245, 251, 255, 0.97), rgba(255, 255, 255, 0.95));
}

.feedback-settings-block {
  grid-column: span 2;
  border-color: rgba(99, 102, 241, 0.26);
  background:
    radial-gradient(circle at 100% 0%, rgba(99, 102, 241, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(248, 250, 255, 0.98), rgba(255, 255, 255, 0.96));
}


.local-file-settings-block {
  grid-column: span 2;
  border-color: rgba(49, 120, 198, 0.24);
  background:
    radial-gradient(circle at 100% 0%, rgba(49, 120, 198, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(246, 251, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.auth-settings-block {
  grid-column: span 2;
  border-color: rgba(15, 159, 143, 0.26);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 159, 143, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(247, 253, 252, 0.98), rgba(255, 255, 255, 0.96));
}

.announcement-panel {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 16px 0 18px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.86), rgba(255, 255, 255, 0.92)),
    #fff;
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.08);
}

.announcement-panel > span {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #e0edff;
  color: #1d4ed8;
}

.announcement-panel strong {
  display: block;
  color: #102a5c;
  font-size: 16px;
}

.announcement-panel p {
  margin: 6px 0 0;
  color: #28476f;
  line-height: 1.6;
  white-space: pre-wrap;
}

.announcement-panel small {
  display: block;
  margin-top: 8px;
  color: #6b7e99;
  font-size: 12px;
}

.settings-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-block-head h3 {
  margin-bottom: 0;
}

#modelConfigStatus {
  padding: 5px 10px;
  border: 1px solid rgba(255, 196, 77, 0.35);
  border-radius: 999px;
  background: rgba(255, 196, 77, 0.12);
  color: #ffd984;
  font-size: 12px;
  font-weight: 800;
}

#wecomConfigStatus {
  padding: 5px 10px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 999px;
  background: #fff7df;
  color: #b45a00;
  font-size: 12px;
  font-weight: 800;
}

#cloudReminderStatus {
  padding: 5px 10px;
  border: 1px solid rgba(14, 165, 233, 0.28);
  border-radius: 999px;
  background: #eaf8ff;
  color: #0b6c94;
  font-size: 12px;
  font-weight: 800;
}

#modelConfigStatus.ready {
  border-color: rgba(18, 255, 214, 0.42);
  background: rgba(18, 255, 214, 0.14);
  color: #8dfff2;
}

#wecomConfigStatus.ready {
  border-color: rgba(34, 197, 94, 0.28);
  background: #e8fff2;
  color: #147348;
}

#cloudReminderStatus.ready {
  border-color: rgba(14, 165, 233, 0.3);
  background: #e5f7ff;
  color: #075985;
}

#cloudReminderStatus.warning {
  border-color: rgba(245, 158, 11, 0.32);
  background: #fff7df;
  color: #9a4d00;
}

.wecom-status-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.wecom-status-card > span {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #e9fff2;
  color: #178850;
}

.wecom-status-card strong {
  display: block;
  color: #173f2d;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wecom-status-card p {
  margin: 4px 0 0;
  color: #587567;
  font-size: 13px;
  line-height: 1.45;
}

.cloud-reminder-card {
  border-color: rgba(14, 165, 233, 0.22);
}

.cloud-reminder-card > span {
  background: #e5f7ff;
  color: #0b719f;
}

.feedback-card {
  border-color: rgba(99, 102, 241, 0.18);
}

.feedback-card > span {
  background: #eef2ff;
  color: #4f46e5;
}

.feedback-form {
  display: grid;
  gap: 12px;
}

.account-manager {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.account-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-manager-head strong {
  color: #12305c;
  font-size: 14px;
}

.account-manager-head .secondary-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 12px;
}

.account-list {
  display: grid;
  gap: 8px;
}

.account-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.9);
}

.account-row strong {
  display: block;
  color: #102a56;
  font-size: 14px;
}

.account-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.account-row-actions {
  display: flex;
  gap: 8px;
}

.account-row-actions button {
  min-width: 38px;
  min-height: 34px;
  padding: 6px 10px;
}

.account-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.account-create-grid input,
.account-create-grid button {
  min-height: 40px;
}

.account-create-grid button {
  grid-column: span 2;
}

.cloud-reminder-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  color: #174256;
  font-weight: 800;
}

.cloud-reminder-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #0ea5e9;
}

.wecom-settings-block .field-label > span,
.cloud-reminder-settings-block .field-label > span,
.feedback-settings-block .field-label > span,
.auth-settings-block .field-label > span {
  color: #174256;
}

.field-label {
  align-items: stretch !important;
  flex-direction: column;
}

.field-label > span {
  color: #dffcff;
  font-size: 13px;
  font-weight: 800;
}

.field-label input,
.field-label textarea {
  min-height: 40px;
  padding: 10px 12px;
}

.field-label textarea {
  resize: vertical;
  line-height: 1.55;
}

.model-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.model-actions button {
  flex: 1 1 150px;
}

.config-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.wecom-action-message {
  min-height: 20px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.wecom-action-message.ok {
  color: #047857;
}

.wecom-action-message.error {
  color: #b42318;
}

.toast {
  background: #071014;
  border: 1px solid rgba(124, 232, 218, 0.22);
}

.hidden {
  display: none !important;
}

i[data-lucide],
svg.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex: 0 0 auto;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 236px;
  }

  .workspace {
    padding: 20px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    min-height: auto;
  }

  .task-list {
    max-height: none;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .nav-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-panel,
  .tray-widget {
    display: none;
  }

  .topbar,
  .settings-header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    min-width: 0;
  }

  .summary-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fab {
    display: grid;
  }

  .recognition-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 14px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 19px;
  }

  .nav-group,
  .summary-grid,
  .settings-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .panel-toolbar,
  .task-item,
  .detail-head,
  .dialog-head {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-pill {
    justify-content: center;
    width: 100%;
  }

  .task-item {
    display: flex;
  }

  .due-column {
    align-items: flex-start;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }

  .model-config-block,
  .wecom-settings-block,
  .cloud-reminder-settings-block,
  .feedback-settings-block {
    grid-column: 1;
  }
}

/* Bright cartoon skin inspired by the reference image */
:root {
  --bg: #76c8ff;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-muted: #eef7ff;
  --ink: #23406d;
  --muted: #6a86b8;
  --line: rgba(88, 150, 255, 0.28);
  --teal: #29d7ff;
  --teal-dark: #2775ff;
  --blue: #3c82ff;
  --orange: #ffac18;
  --red: #ff5f8f;
  --green-soft: #e5fbff;
  --blue-soft: #eaf3ff;
  --orange-soft: #fff3cc;
  --red-soft: #ffe8f0;
  --shadow: 0 20px 40px rgba(42, 111, 226, 0.18);
  --radius: 18px;
}

body {
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.82), transparent 11%),
    radial-gradient(circle at 82% 10%, rgba(255, 230, 88, 0.62), transparent 10%),
    linear-gradient(180deg, #2495ff 0%, #72c7ff 45%, #d9efff 100%);
  color: var(--ink);
  overflow-x: hidden;
}

.cartoon-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.cloud {
  position: absolute;
  width: 148px;
  height: 52px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  filter: drop-shadow(0 12px 18px rgba(65, 128, 215, 0.12));
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 16px;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  left: 24px;
  width: 62px;
  height: 62px;
}

.cloud::after {
  right: 26px;
  width: 78px;
  height: 78px;
}

.cloud-a {
  left: -42px;
  top: 84px;
}

.cloud-b {
  right: -46px;
  top: 230px;
  transform: scale(1.18);
}

.cloud-c {
  left: 34%;
  bottom: -20px;
  transform: scale(1.28);
}

.star {
  position: absolute;
  width: 26px;
  height: 26px;
  background: #ffd83d;
  clip-path: polygon(50% 0%, 62% 36%, 100% 36%, 69% 58%, 80% 100%, 50% 74%, 20% 100%, 31% 58%, 0 36%, 38% 36%);
  filter: drop-shadow(0 5px 8px rgba(255, 169, 24, 0.25));
}

.star-a {
  top: 70px;
  right: 20%;
}

.star-b {
  top: 330px;
  left: 22px;
  transform: scale(0.74) rotate(18deg);
}

.star-c {
  right: 38px;
  bottom: 98px;
  transform: scale(0.9) rotate(-12deg);
}

.coin {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff6a8, transparent 26%),
    linear-gradient(135deg, #ffe45f, #ffac18 55%, #ff801f);
  border: 4px solid #ffd465;
  box-shadow:
    inset 0 -6px 0 rgba(188, 91, 0, 0.18),
    0 14px 22px rgba(197, 113, 0, 0.18);
}

.coin::after {
  content: "";
  position: absolute;
  inset: 15px 21px;
  border: 4px solid rgba(166, 94, 0, 0.26);
  border-radius: 50%;
}

.coin-a {
  left: 18px;
  bottom: 46px;
}

.coin-b {
  right: 22px;
  top: 92px;
  transform: scale(0.7) rotate(-16deg);
}

.app-shell {
  position: relative;
  z-index: 1;
  gap: 18px;
  padding: 18px;
}

.sidebar {
  top: 18px;
  height: calc(100vh - 36px);
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(230, 244, 255, 0.86)),
    #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.brand {
  border-bottom-color: rgba(68, 137, 255, 0.18);
}

.brand strong {
  color: #2d3ca8;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.75);
}

.brand small,
.quick-panel > span,
.tray-widget {
  color: var(--muted);
}

.brand-mark {
  border-radius: 16px;
  background: linear-gradient(135deg, #7357ff, #25b8ff 58%, #ffb72b);
  box-shadow: 0 10px 20px rgba(73, 111, 255, 0.28);
}

.nav-item {
  color: #335888;
  border: 2px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(135deg, #eef5ff, #ffffff);
  border-color: rgba(75, 139, 255, 0.2);
  color: #2748c8;
  box-shadow: 0 8px 18px rgba(77, 133, 255, 0.12);
}

.nav-item.active {
  box-shadow:
    inset 5px 0 0 #2ab8ff,
    0 8px 18px rgba(77, 133, 255, 0.14);
}

.nav-item b {
  background: linear-gradient(135deg, #7b5cff, #2fb5ff);
  color: #fff;
}

.quick-panel {
  border: 2px solid rgba(74, 139, 255, 0.26);
  background: rgba(255, 255, 255, 0.72);
}

.quick-panel button {
  background: linear-gradient(135deg, #ffffff, #eaf5ff);
  color: #2d4d80;
  border: 2px solid rgba(74, 139, 255, 0.2);
}

.tray-widget {
  background: linear-gradient(135deg, #eff8ff, #ffffff);
  border: 2px solid rgba(74, 139, 255, 0.18);
}

.tray-widget strong {
  color: #2d3ca8;
}

.workspace {
  padding: 10px 8px 26px 0;
  background: transparent;
}

.eyebrow {
  color: #185cff;
}

h1 {
  color: #2637a4;
  font-weight: 900;
  text-shadow:
    0 3px 0 #fff,
    0 8px 18px rgba(63, 95, 214, 0.18);
}

h2,
h3,
.topbar h1,
.detail-head h2,
.dialog-head h2,
.settings-header h2,
.task-title-row strong,
.recognition-card strong {
  color: #273b9c;
}

.ai-inline,
.metric-tile p,
.detail-section p,
.settings-block label,
.shortcut-row,
.select-label,
.task-meta span,
.due-column,
.model-summary p,
.recognition-card p,
.image-preview span,
.ai-command-strip p {
  color: var(--muted);
}

.search-box,
.metric-tile,
.task-panel,
.detail-panel,
.settings-page,
.settings-block,
.task-dialog,
.task-dialog form,
.recognition-dialog,
.icon-btn,
.secondary-btn,
.recognition-card,
.recognition-result,
.image-preview {
  background: var(--surface);
  border: 3px solid rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow:
    var(--shadow),
    inset 0 0 0 2px rgba(90, 151, 255, 0.16);
}

.search-box input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.recognition-input textarea,
select,
input,
textarea {
  background: #ffffff;
  border: 2px solid rgba(102, 157, 255, 0.3);
  color: var(--ink);
}

.search-box input::placeholder,
textarea::placeholder,
input::placeholder {
  color: #8aa3cf;
}

.metric-tile,
.task-panel,
.detail-panel,
.ai-command-strip,
.settings-page {
  box-shadow: var(--shadow);
}

.metric-tile::before,
.task-panel::before,
.detail-panel::before,
.ai-command-strip::before {
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  height: 2px;
}

.metric-tile {
  min-height: 122px;
  border-color: rgba(255, 255, 255, 0.82);
}

.metric-action {
  cursor: pointer;
  user-select: none;
  transform: translateY(0) scale(1);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    filter 0.18s ease;
}

.metric-action:hover,
.metric-action:focus-visible {
  border-color: rgba(255, 214, 61, 0.9);
  filter: saturate(1.08);
  transform: translateY(-5px) scale(1.015);
  box-shadow:
    0 24px 42px rgba(42, 111, 226, 0.22),
    0 0 0 5px rgba(255, 216, 61, 0.16),
    inset 0 0 0 2px rgba(90, 151, 255, 0.16);
  outline: none;
}

.metric-action:active {
  transform: translateY(-1px) scale(0.99);
}

.metric-action.active {
  border-color: #ffd83d;
  box-shadow:
    0 24px 42px rgba(42, 111, 226, 0.2),
    0 0 0 5px rgba(255, 216, 61, 0.2),
    inset 0 -6px 0 rgba(255, 172, 24, 0.14);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 13px;
  border: 2px solid rgba(122, 101, 255, 0.2);
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7d8, #ffffff);
  color: #2748c8;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 14px rgba(80, 106, 255, 0.1);
}

.metric-tile:nth-child(1) {
  background: linear-gradient(135deg, #ffffff, #e6fff8 72%);
}

.metric-tile:nth-child(2) {
  background: linear-gradient(135deg, #ffffff, #fff2cd 72%);
}

.metric-tile:nth-child(3) {
  background: linear-gradient(135deg, #ffffff, #ffeaf3 72%);
}

.metric-tile:nth-child(4) {
  background: linear-gradient(135deg, #ffffff, #e8f5ff 72%);
}

.metric-tile strong {
  color: #2637a4;
}

.metric-icon {
  border-radius: 16px;
  box-shadow: inset 0 -4px 0 rgba(24, 75, 185, 0.08);
}

.metric-icon.teal {
  background: linear-gradient(135deg, #6cf6ff, #2bd6b8);
  color: #065b86;
}

.metric-icon.orange {
  background: linear-gradient(135deg, #ffe95e, #ffac18);
  color: #8b4f00;
}

.metric-icon.red {
  background: linear-gradient(135deg, #ffb1c9, #ff5f8f);
  color: #852544;
}

.metric-icon.blue {
  background: linear-gradient(135deg, #8fd7ff, #3c82ff);
  color: #123f99;
}

.ai-command-strip {
  border-color: rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 226, 80, 0.64), transparent 22%),
    linear-gradient(135deg, #7a65ff 0%, #35b7ff 48%, #7ee4ff 100%);
  color: #fff;
  min-height: 128px;
}

.ai-chip {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: none;
}

.ai-command-strip strong {
  color: #fff;
  font-size: 22px;
  text-shadow: 0 3px 0 rgba(52, 52, 178, 0.22);
}

.ai-command-strip p {
  color: rgba(255, 255, 255, 0.9);
}

.cartoon-helper {
  position: relative;
  width: 96px;
  height: 108px;
  flex: 0 0 auto;
  margin-left: auto;
}

.helper-head {
  position: absolute;
  left: 18px;
  top: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 38%, #3e2a23 0 5px, transparent 6px),
    radial-gradient(circle at 64% 38%, #3e2a23 0 5px, transparent 6px),
    radial-gradient(circle at 50% 62%, #ff8a6c 0 5px, transparent 6px),
    #ffd0a1;
  border: 4px solid #fff;
  box-shadow: 0 10px 18px rgba(68, 77, 190, 0.2);
}

.helper-head::before {
  content: "";
  position: absolute;
  inset: -10px 8px auto;
  height: 24px;
  border-radius: 50% 50% 42% 42%;
  background: #7a3d1f;
}

.helper-body {
  position: absolute;
  left: 13px;
  bottom: 6px;
  width: 70px;
  height: 58px;
  border-radius: 26px 26px 18px 18px;
  background: linear-gradient(135deg, #ffcf35, #ff9827);
  border: 4px solid #fff;
  box-shadow: 0 12px 18px rgba(68, 77, 190, 0.18);
}

.helper-body::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 10px;
  width: 30px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7a65ff, #35b7ff);
  border: 3px solid #fff;
}

.pipeline span {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
}

.panel-toolbar,
.dialog-head,
.dialog-actions,
.detail-head,
.detail-section,
.segmented {
  border-color: rgba(102, 157, 255, 0.22);
}

.segmented {
  background: #f0f7ff;
  border: 2px solid rgba(102, 157, 255, 0.25);
}

.segmented button {
  color: #5d79a8;
  border-radius: 999px;
}

.segmented button.active {
  background: linear-gradient(135deg, #7a65ff, #35b7ff);
  color: #fff;
  box-shadow: 0 8px 14px rgba(80, 106, 255, 0.18);
}

.task-item {
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 2px solid rgba(102, 157, 255, 0.16);
  color: var(--ink);
}

.task-item:hover,
.task-item.active {
  background: #eef8ff;
}

.task-item.active {
  box-shadow:
    inset 6px 0 0 #2dd9ff,
    inset 0 0 0 2px rgba(102, 157, 255, 0.16);
}

.task-meta span,
.detail-meta span,
.task-tags span,
.status-badge,
.priority-badge,
.pipeline span,
kbd {
  background: #eef8ff;
  border: 1px solid rgba(102, 157, 255, 0.22);
  color: #5675a7;
}

.priority-badge.high,
.status-badge.overdue {
  background: #ffe8f0;
  color: #d82c62;
}

.priority-badge.medium {
  background: #fff2cd;
  color: #c46b00;
}

.priority-badge.low,
.status-badge.progress {
  background: #e8f5ff;
  color: #236ee9;
}

.status-badge.done {
  background: #e4fff5;
  color: #0f9f72;
}

.primary-btn,
.fab {
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 42%),
    linear-gradient(135deg, #ffdc38, #ff9b18);
  color: #fff;
  text-shadow: 0 2px 0 rgba(160, 78, 0, 0.18);
  box-shadow:
    0 12px 20px rgba(255, 143, 24, 0.28),
    inset 0 -5px 0 rgba(173, 79, 0, 0.18);
}

.secondary-btn,
.icon-btn {
  background: #fff;
  border: 2px solid rgba(102, 157, 255, 0.28);
  color: #2754b8;
}

.secondary-btn:hover,
.icon-btn:hover {
  background: #eef8ff;
}

.settings-page {
  background: rgba(255, 255, 255, 0.82);
}

.settings-block {
  background: rgba(255, 255, 255, 0.92);
}

.model-config-block {
  border-color: rgba(255, 189, 39, 0.55);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 221, 72, 0.55), transparent 28%),
    linear-gradient(135deg, #ffffff, #fff7d8 58%, #e9f7ff);
}

.wecom-settings-block {
  border-color: rgba(34, 197, 94, 0.34);
  background:
    radial-gradient(circle at 100% 0%, rgba(198, 246, 213, 0.75), transparent 28%),
    linear-gradient(135deg, #ffffff, #f0fff7 58%, #eef7ff);
}

.cloud-reminder-settings-block {
  border-color: rgba(14, 165, 233, 0.34);
  background:
    radial-gradient(circle at 100% 0%, rgba(186, 230, 253, 0.75), transparent 28%),
    linear-gradient(135deg, #ffffff, #f0fbff 58%, #eef7ff);
}

.feedback-settings-block {
  border-color: rgba(99, 102, 241, 0.26);
  background:
    radial-gradient(circle at 100% 0%, rgba(224, 231, 255, 0.72), transparent 28%),
    linear-gradient(135deg, #ffffff, #f8f9ff 58%, #eef7ff);
}

.auth-settings-block {
  border-color: rgba(15, 159, 143, 0.3);
  background:
    radial-gradient(circle at 100% 0%, rgba(204, 251, 241, 0.7), transparent 28%),
    linear-gradient(135deg, #ffffff, #f3fffc 58%, #eef7ff);
}

#modelConfigStatus {
  border-color: rgba(255, 159, 24, 0.34);
  background: #fff0c2;
  color: #c16900;
}

#modelConfigStatus.ready {
  border-color: rgba(38, 183, 139, 0.34);
  background: #e3fff3;
  color: #16845f;
}

.field-label > span {
  color: #3054a9;
}

.config-note {
  color: #6a86b8;
}

.drop-zone {
  border: 3px dashed #7a65ff;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.9), transparent 18%),
    linear-gradient(135deg, #e9f7ff, #fff8dd);
  color: #385da8;
}

.drop-zone strong {
  color: #273b9c;
}

.drop-zone.dragging,
.drop-zone:focus-visible {
  border-color: #ffac18;
  box-shadow: 0 0 0 5px rgba(255, 172, 24, 0.15);
}

.recognition-empty,
.recognition-loading {
  background: #f2f8ff;
  border-color: rgba(122, 101, 255, 0.3);
  color: #6a86b8;
}

.recognition-loading span {
  border-color: rgba(74, 139, 255, 0.18);
  border-top-color: #ffac18;
}

.model-summary {
  background: linear-gradient(135deg, #f2fbff, #fff7d8);
  border-color: rgba(255, 172, 24, 0.24);
}

.model-summary span,
#modelStatus {
  color: #236ee9;
}

#modelStatus {
  background: #e9f3ff;
  border: 1px solid rgba(74, 139, 255, 0.18);
}

.toast {
  background: linear-gradient(135deg, #7a65ff, #35b7ff);
  border: 3px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .app-shell {
    padding: 0;
    gap: 0;
  }

  .sidebar {
    border-radius: 0 0 26px 26px;
    border-width: 0 0 3px;
    height: auto;
    top: 0;
  }

  .workspace {
    padding: 14px 10px 24px;
  }

  .cartoon-helper {
    display: none;
  }
}

/* Card-style task list */
.task-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
  padding: 16px;
  align-content: start;
  background:
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.88), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(242, 249, 255, 0.84));
}

.task-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 3px solid rgba(150, 191, 255, 0.36);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(236, 247, 255, 0.94)),
    #fff;
  box-shadow:
    0 14px 24px rgba(60, 130, 255, 0.12),
    inset 0 -5px 0 rgba(96, 154, 255, 0.06);
  text-align: left;
  overflow: hidden;
}

.task-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 199, 45, 0.86);
  background:
    linear-gradient(180deg, #ffffff, #eef8ff),
    #fff;
  box-shadow:
    0 20px 34px rgba(60, 130, 255, 0.18),
    0 0 0 5px rgba(255, 216, 61, 0.13),
    inset 0 -5px 0 rgba(96, 154, 255, 0.06);
}

.task-card.active {
  border-color: #ffd83d;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 216, 61, 0.26), transparent 34%),
    linear-gradient(180deg, #ffffff, #eaf7ff);
  box-shadow:
    0 22px 36px rgba(60, 130, 255, 0.2),
    0 0 0 6px rgba(255, 216, 61, 0.18),
    inset 0 -6px 0 rgba(255, 172, 24, 0.12);
}

.task-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.source-orb {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), transparent 48%),
    linear-gradient(135deg, #7a65ff, #35b7ff);
  color: #fff;
  box-shadow:
    0 10px 18px rgba(74, 139, 255, 0.22),
    inset 0 -4px 0 rgba(31, 72, 163, 0.14);
}

.task-card .task-title-row {
  margin-bottom: 5px;
}

.task-card .task-title-row strong {
  display: -webkit-box;
  overflow: hidden;
  color: #2637a4;
  font-size: 17px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-card-subline {
  display: -webkit-box;
  overflow: hidden;
  color: #6a86b8;
  font-size: 13px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-card .task-meta {
  gap: 7px;
}

.task-card .task-meta span,
.task-card .status-badge,
.task-card .priority-badge {
  min-height: 28px;
  border-radius: 999px;
}

.task-card .due-column {
  align-items: stretch;
  gap: 6px;
  padding-top: 10px;
  border-top: 2px dashed rgba(102, 157, 255, 0.22);
}

.task-card .due-column span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #236ee9;
  font-weight: 800;
}

.task-card .due-column span:last-child {
  color: #8a6a00;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .task-list {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  .task-list {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .task-card {
    min-height: 172px;
  }
}

/* Inline detail inside task cards */
.content-grid {
  grid-template-columns: minmax(0, 1fr);
}

.detail-panel {
  display: none;
}

.task-panel {
  max-width: 100%;
}

.task-list {
  grid-template-columns: repeat(3, minmax(230px, 1fr));
}

.task-card.expanded {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(340px, 1.4fr);
  min-height: 0;
  align-items: start;
  gap: 18px;
}

.task-card.expanded .task-card-head,
.task-card.expanded .task-card-badges,
.task-card.expanded .task-meta,
.task-card.expanded .due-column {
  grid-column: 1;
}

.task-inline-detail {
  grid-column: 2;
  grid-row: 1 / span 4;
  display: grid;
  gap: 0;
  padding: 16px;
  border: 3px solid rgba(150, 191, 255, 0.34);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 8%, rgba(255, 216, 61, 0.22), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 249, 255, 0.92));
  box-shadow: inset 0 0 0 2px rgba(90, 151, 255, 0.1);
}

.inline-detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(102, 157, 255, 0.18);
}

.inline-detail-title span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #273b9c;
  font-size: 16px;
  font-weight: 900;
}

.task-inline-detail .detail-section {
  padding: 14px 0;
  border-bottom: 2px solid rgba(102, 157, 255, 0.16);
}

.task-inline-detail .detail-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.task-inline-detail .detail-section h3 {
  color: #273b9c;
}

.task-inline-detail .detail-section p {
  color: #5775ab;
}

.task-inline-detail .detail-actions {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
}

.task-inline-detail button {
  position: relative;
  z-index: 2;
}

@media (max-width: 1280px) {
  .task-list {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
  }
}

@media (max-width: 980px) {
  .task-card.expanded {
    grid-template-columns: 1fr;
  }

  .task-inline-detail,
  .task-card.expanded .task-card-head,
  .task-card.expanded .task-card-badges,
  .task-card.expanded .task-meta,
  .task-card.expanded .due-column {
    grid-column: 1;
  }

  .task-inline-detail {
    grid-row: auto;
  }

  .task-inline-detail .detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .task-list {
    grid-template-columns: 1fr;
  }

  .task-inline-detail .detail-actions {
    grid-template-columns: 1fr;
  }
}

/* Practical redesigned workspace: larger task cards + fixed detail card */
.content-grid {
  grid-template-columns: minmax(620px, 1fr) minmax(360px, 430px);
  gap: 22px;
  align-items: start;
}

.detail-panel {
  display: block;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  min-height: 640px;
  overflow: auto;
  padding: 22px;
  border-radius: 26px;
}

.task-panel {
  max-width: none;
}

.task-list {
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 16px 20px;
  padding: 20px;
  min-height: 560px;
  max-height: calc(100vh - 310px);
  overflow: auto;
}

.task-card {
  min-height: 250px;
  padding: 22px;
  border-radius: 26px;
}

.task-card:hover {
  transform: translateY(-6px);
}

.task-card.active {
  transform: translateY(-3px);
}

.task-card-head {
  gap: 15px;
}

.source-orb {
  width: 56px;
  height: 56px;
  border-radius: 20px;
}

.source-orb svg {
  width: 24px;
  height: 24px;
}

.task-card .task-title-row strong {
  font-size: 20px;
  line-height: 1.32;
}

.task-card-subline {
  font-size: 14px;
  line-height: 1.6;
  -webkit-line-clamp: 3;
}

.task-card-badges {
  gap: 10px;
}

.task-card .task-meta {
  gap: 9px;
}

.task-card .task-meta span,
.task-card .status-badge,
.task-card .priority-badge {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 13px;
}

.task-card .due-column {
  margin-top: 4px;
  padding-top: 14px;
}

.task-card .due-column span:first-child {
  font-size: 15px;
}

.task-inline-detail {
  display: none;
}

@media (max-width: 1240px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    max-height: none;
    min-height: auto;
  }

  .task-list {
    max-height: none;
  }
}

@media (max-width: 900px) {
  .task-list {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 640px) {
  .task-list {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .task-card {
    min-height: 230px;
    padding: 18px;
  }
}

/* Final refinement: clean AI/SaaS workbench */
:root {
  --bg: #f7fbff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-muted: #f4f8ff;
  --ink: #172554;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.24);
  --teal: #38bdf8;
  --teal-dark: #2563eb;
  --blue: #2563eb;
  --orange: #f59e0b;
  --red: #f43f5e;
  --green-soft: #e6fffb;
  --blue-soft: #eaf2ff;
  --orange-soft: #fff7dd;
  --red-soft: #fff0f4;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --sidebar-width: 240px;
  --detail-width: 420px;
}

body {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.35), transparent 32%),
    linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
  color: var(--ink);
}

.cartoon-backdrop {
  opacity: 0.32;
}

.star,
.coin,
.cartoon-helper {
  display: none;
}

.cloud {
  opacity: 0.42;
  filter: blur(0.2px) drop-shadow(0 12px 18px rgba(59, 130, 246, 0.08));
}

.cloud-a,
.cloud-b {
  display: none;
}

.cloud-c {
  left: 42%;
  bottom: -32px;
  transform: scale(1.65);
}

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 24px;
  padding: 20px 24px 28px;
}

.sidebar {
  top: 20px;
  width: var(--sidebar-width);
  height: calc(100vh - 40px);
  padding: 24px 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  color: #33527c;
}

.brand {
  gap: 14px;
  padding-bottom: 18px;
  border-bottom-color: rgba(148, 163, 184, 0.2);
}

.brand strong {
  color: #1d4ed8;
  text-shadow: none;
}

.brand small {
  color: #64748b;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: linear-gradient(135deg, #4f46e5, #38bdf8);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
}

.nav-group {
  gap: 9px;
}

.nav-item {
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  color: #33527c;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(232, 242, 255, 0.7);
  color: #1d4ed8;
}

.nav-item.active {
  background: linear-gradient(135deg, #e8f2ff, #f4f8ff);
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.nav-item b {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 9px;
  background: #dbeafe;
  color: #2563eb;
}

.quick-panel,
.tray-widget {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: none;
}

.quick-panel button {
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
  color: #33527c;
}

.workspace {
  padding: 4px 0 0;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow {
  color: #2563eb;
}

h1 {
  color: #172554;
  font-size: 28px;
  text-shadow: none;
}

h2,
h3,
.topbar h1,
.detail-head h2,
.dialog-head h2,
.settings-header h2,
.task-title-row strong,
.recognition-card strong {
  color: #172554;
}

.ai-inline {
  color: #64748b;
}

.pulse-dot {
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.search-box {
  min-height: 46px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

.icon-btn {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.88);
  color: #1d4ed8;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-tile {
  min-height: 112px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.metric-tile::before {
  display: none;
}

.metric-action:hover,
.metric-action:focus-visible {
  border-color: rgba(59, 130, 246, 0.35);
  filter: none;
  transform: translateY(-3px);
  box-shadow:
    0 22px 44px rgba(15, 23, 42, 0.08),
    0 0 0 4px rgba(59, 130, 246, 0.1);
}

.metric-action.active {
  border-color: rgba(250, 204, 21, 0.8);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.06),
    0 0 0 4px rgba(250, 204, 21, 0.16);
}

.metric-tile p {
  color: #64748b;
}

.metric-tile strong {
  color: #1e3a8a;
  font-size: 30px;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  box-shadow: none;
}

.metric-icon.teal {
  background: #dff8ff;
  color: #0284c7;
}

.metric-icon.orange {
  background: #fff3d1;
  color: #d97706;
}

.metric-icon.red {
  background: #ffe4ee;
  color: #e11d48;
}

.metric-icon.blue {
  background: #e7f0ff;
  color: #2563eb;
}

.ai-command-strip {
  min-height: 126px;
  margin-bottom: 20px;
  padding: 22px 24px;
  border: 0;
  border-radius: 24px;
  background:
    linear-gradient(120deg, #4f46e5 0%, #38bdf8 45%, #a7f3d0 100%);
  box-shadow: 0 24px 60px rgba(37, 99, 235, 0.22);
  overflow: hidden;
  position: relative;
}

.ai-command-strip::before {
  display: none;
}

.ai-command-strip::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.ai-chip {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.ai-command-strip strong {
  color: #fff;
  font-size: 21px;
  text-shadow: none;
}

.ai-command-strip p {
  color: rgba(255, 255, 255, 0.88);
}

.pipeline {
  position: relative;
  z-index: 1;
}

.pipeline span {
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #2563eb;
  font-weight: 600;
}

.content-grid {
  grid-template-columns: minmax(600px, 1fr) minmax(360px, 420px);
  gap: 22px;
  align-items: start;
}

.task-panel,
.detail-panel,
.settings-page {
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.task-panel::before,
.detail-panel::before {
  display: none;
}

.panel-toolbar {
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.65);
}

.segmented {
  border: 1px solid rgba(203, 213, 225, 0.75);
  background: #f8fbff;
}

.segmented button.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.filter-pill {
  border: 1px solid rgba(203, 213, 225, 0.75);
  background: #fff;
  color: #2563eb;
  box-shadow: none;
}

.task-list {
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 18px;
  min-height: 560px;
  max-height: calc(100vh - 324px);
  overflow: auto;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.task-card {
  min-height: 178px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon title due"
    "icon badges due"
    "icon meta meta";
  align-items: start;
  gap: 12px 16px;
  padding: 22px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 45px rgba(30, 64, 175, 0.08);
}

.task-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.32);
  box-shadow: 0 24px 50px rgba(30, 64, 175, 0.11);
}

.task-card.active {
  transform: none;
  border-color: #facc15;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.08),
    0 0 0 4px rgba(250, 204, 21, 0.18);
}

.task-card-head {
  display: contents;
}

.source-orb {
  grid-area: icon;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #2563eb;
  box-shadow: none;
}

.task-main {
  grid-area: title;
}

.task-card .task-title-row strong {
  color: #172554;
  font-size: 18px;
  line-height: 1.35;
}

.task-card-subline {
  margin-top: 6px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
}

.task-card-badges {
  grid-area: badges;
  gap: 8px;
}

.task-card .task-meta {
  grid-area: meta;
  gap: 8px;
}

.task-card .due-column {
  grid-area: due;
  min-width: 132px;
  align-items: flex-end;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  text-align: right;
}

.task-card .due-column span:first-child {
  color: #2563eb;
  font-size: 14px;
}

.task-card .due-column span:last-child {
  color: #64748b;
}

.task-card .task-meta span,
.task-card .status-badge,
.task-card .priority-badge,
.detail-meta span,
.task-tags span {
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: #f8fbff;
  color: #33527c;
}

.priority-badge.high,
.status-badge.overdue {
  background: #fff0f4;
  color: #e11d48;
}

.priority-badge.medium {
  background: #fff7dd;
  color: #b45309;
}

.priority-badge.low,
.status-badge.progress {
  background: #eff6ff;
  color: #2563eb;
}

.status-badge.done {
  background: #ecfdf5;
  color: #059669;
}

.detail-panel {
  display: block;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  min-height: 620px;
  overflow: auto;
  padding: 24px;
}

.detail-head {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.65);
}

.detail-head h2 {
  font-size: 22px;
  line-height: 1.35;
}

.detail-section {
  padding: 18px 0;
  border-bottom: 1px solid rgba(203, 213, 225, 0.65);
}

.detail-section h3 {
  margin-bottom: 12px;
  color: #172554;
}

.detail-section p {
  color: #475569;
  line-height: 1.7;
}

.detail-actions {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.primary-btn {
  min-height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.28);
  text-shadow: none;
}

.secondary-btn {
  min-height: 42px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 14px;
  background: #fff;
  color: #2563eb;
  font-weight: 600;
}

.detail-section:nth-of-type(5) p {
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 16px;
  background: #f8fafc;
}

.task-inline-detail {
  display: none !important;
}

@media (max-width: 1180px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    max-height: none;
    min-height: auto;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    border-radius: 0 0 24px 24px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .task-card {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "icon title"
      "badges badges"
      "meta meta"
      "due due";
  }

  .source-orb {
    width: 48px;
    height: 48px;
  }

  .task-card .due-column {
    align-items: flex-start;
    text-align: left;
  }
}

/* Final SaaS dashboard pass: card grid task board */
.app-shell {
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 26px;
  max-width: 1920px;
}

.content-grid {
  grid-template-columns: minmax(720px, 1fr) minmax(340px, 410px);
  align-items: start;
  gap: 24px;
}

.task-board {
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(203, 213, 225, 0.64);
  box-shadow: 0 22px 58px rgba(30, 64, 175, 0.08);
  overflow: hidden;
}

.task-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 18px;
  padding: 20px;
  min-height: 386px;
  max-height: calc(100vh - 470px);
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.task-card {
  position: relative;
  min-height: 352px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(203, 213, 225, 0.74);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 254, 255, 0.94));
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.055);
  transform: none;
}

.task-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 24px 54px rgba(37, 99, 235, 0.12);
}

.task-card.active {
  border-color: rgba(59, 130, 246, 0.92);
  background: #fff;
  box-shadow:
    0 24px 58px rgba(37, 99, 235, 0.13),
    0 0 0 3px rgba(59, 130, 246, 0.12);
}

.task-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.source-orb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #eaf6ff 0%, #d8ecff 100%);
  color: #1677ff;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.2);
}

.source-orb svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.3;
}

.task-main {
  min-width: 0;
  flex: 1;
}

.task-card .task-title-row {
  min-width: 0;
}

.task-card .task-title-row strong {
  display: block;
  color: #102a5c;
  font-size: 19px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-card-subline {
  display: -webkit-box;
  margin-top: 7px;
  color: #496795;
  font-size: 14px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card-menu {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  color: #244b88;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(203, 213, 225, 0.74);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045);
}

.task-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 10px;
}

.task-card .priority-badge {
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 700;
}

.task-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 15px 0 16px;
  margin-top: 0;
  border-top: 1px solid rgba(203, 213, 225, 0.68);
  border-bottom: 1px solid rgba(203, 213, 225, 0.68);
}

.task-info-grid span {
  display: grid;
  grid-template-columns: 18px minmax(58px, 0.7fr) minmax(72px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: #375989;
}

.task-info-grid svg {
  width: 16px;
  height: 16px;
  color: #2b5ea8;
  stroke-width: 2.2;
}

.task-info-grid b {
  font-size: 13px;
  font-weight: 650;
  color: #496795;
}

.task-info-grid em {
  justify-self: end;
  max-width: 100%;
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: #f7fbff;
  color: #244b88;
  font-size: 13px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-card .due-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  margin-top: auto;
  padding-top: 18px;
  border-top: 0;
  text-align: left;
}

.task-card .due-column span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1268f3;
  font-size: 16px;
  font-weight: 800;
}

.task-card .due-column span:first-child svg {
  width: 20px;
  height: 20px;
}

.task-card .due-column span:last-child {
  color: #496795;
  font-size: 14px;
  font-weight: 600;
}

.detail-panel {
  position: sticky;
  top: 24px;
  min-height: 620px;
  max-height: calc(100vh - 48px);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.68);
  box-shadow: 0 24px 62px rgba(15, 23, 42, 0.08);
  overflow: auto;
}

.detail-section {
  padding: 17px 0;
}

.detail-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.primary-btn,
.secondary-btn {
  width: 100%;
}

@media (max-width: 1480px) {
  .content-grid {
    grid-template-columns: minmax(650px, 1fr) minmax(330px, 380px);
  }

  .task-list {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
  }

  .task-card {
    padding: 20px;
  }
}

@media (max-width: 1280px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    min-height: auto;
    max-height: none;
  }

  .task-list {
    max-height: none;
  }
}

@media (max-width: 1040px) {
  .task-list {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .task-list {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .task-card {
    min-height: 320px;
  }

  .source-orb {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
  }

  .task-info-grid span {
    grid-template-columns: 18px 56px minmax(0, 1fr);
  }
}

/* Reference layout polish */
.metric-action.active {
  border-color: rgba(59, 130, 246, 0.82);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 20px 48px rgba(37, 99, 235, 0.1),
    0 0 0 3px rgba(59, 130, 246, 0.11);
}

.metric-action.active::before {
  opacity: 0;
}

.task-card {
  min-height: 330px;
  padding: 20px;
}

.task-card-badges {
  margin: 15px 0 8px;
}

.task-info-grid {
  gap: 8px;
  padding: 12px 0 13px;
}

.task-info-grid span {
  min-height: 26px;
}

.task-info-grid em {
  min-height: 25px;
}

.task-card .due-column {
  padding-top: 14px;
}

.task-card .due-column span:first-child {
  font-size: 15px;
}

@media (max-height: 920px) and (min-width: 1281px) {
  .summary-grid {
    gap: 18px;
  }

  .metric-tile {
    min-height: 106px;
  }

  .ai-command-strip {
    min-height: 132px;
    padding: 24px 30px;
  }

  .content-grid {
    gap: 22px;
  }

  .task-list {
    min-height: 360px;
    max-height: calc(100vh - 430px);
  }

  .task-card {
    min-height: 320px;
  }
}

/* Dispatch analytics: Jiandaoyun-style task issue details */
.dispatch-section,
.dispatch-table-panel {
  margin-top: 22px;
  border: 1px solid rgba(203, 213, 225, 0.66);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 58px rgba(30, 64, 175, 0.075);
  overflow: hidden;
}

.dispatch-head,
.dispatch-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.66);
}

.dispatch-head h2,
.dispatch-table-head h2 {
  margin: 4px 0 0;
  color: #102a5c;
  font-size: 22px;
  line-height: 1.2;
}

.dispatch-head > span {
  color: #5f77a1;
  font-size: 14px;
}

.dispatch-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px;
}

.dispatch-stat {
  position: relative;
  min-height: 112px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 4px 16px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  color: #16345f;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.dispatch-stat::before {
  content: "";
  position: absolute;
  inset: auto -42px -72px auto;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.dispatch-stat:hover,
.dispatch-stat:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.15);
  outline: 0;
}

.dispatch-stat.active {
  box-shadow:
    0 18px 34px rgba(37, 99, 235, 0.16),
    0 0 0 3px rgba(37, 99, 235, 0.16);
}

.dispatch-stat span {
  grid-row: span 2;
  position: relative;
  width: 58px;
  height: 58px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #dffaff;
  background:
    radial-gradient(circle at center, #082d51 0 35%, #0ea5e9 36% 52%, rgba(14, 165, 233, 0.2) 53% 100%);
  box-shadow:
    0 0 0 6px rgba(45, 212, 191, 0.18),
    0 0 28px rgba(6, 182, 212, 0.35);
  z-index: 1;
}

.dispatch-stat span svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.2;
}

.dispatch-stat p,
.dispatch-stat strong {
  position: relative;
  z-index: 1;
}

.dispatch-stat p {
  margin: 4px 0 0;
  color: rgba(15, 42, 92, 0.82);
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatch-stat strong {
  color: #22c7e9;
  font-size: 29px;
  line-height: 1;
  font-weight: 800;
}

.dispatch-green {
  background: linear-gradient(135deg, #a7e7bd, #d5f8e2);
}

.dispatch-rose {
  background: linear-gradient(135deg, #f6a4ac, #ffd4dc);
}

.dispatch-amber {
  background: linear-gradient(135deg, #ffc27d, #ffe2b9);
}

.dispatch-slate {
  background: linear-gradient(135deg, #8d98a3, #d6dde5);
}

.dispatch-orange {
  background: linear-gradient(135deg, #ff7a18, #ffc86d);
}

.dispatch-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dispatch-table-wrap {
  overflow: auto;
  max-height: 420px;
}

.dispatch-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
  color: #203b66;
}

.dispatch-table th,
.dispatch-table td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.88);
  text-align: left;
  vertical-align: middle;
}

.dispatch-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 251, 255, 0.96);
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.dispatch-table td {
  background: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

.dispatch-table tbody tr:hover td {
  background: #f4f9ff;
}

.dispatch-table a {
  color: #1268f3;
  font-weight: 700;
  text-decoration: none;
}

.dispatch-table td:nth-child(4) {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeout-pill {
  min-width: 42px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
}

.timeout-pill.yes {
  color: #be123c;
  background: #ffe4e9;
}

.timeout-pill.no {
  color: #047857;
  background: #dff8ed;
}

.dispatch-empty {
  height: 120px;
  color: #64748b;
  text-align: center !important;
}

.dispatch-table-foot {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 22px;
  color: #496795;
  background: rgba(248, 251, 255, 0.88);
}

.dispatch-table-foot span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dispatch-table-foot b {
  color: #1268f3;
}

@media (max-width: 1280px) {
  .dispatch-stats-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 680px) {
  .dispatch-head,
  .dispatch-table-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dispatch-stats-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .dispatch-stat {
    min-height: 96px;
  }
}

/* Interaction polish */
html {
  scroll-behavior: smooth;
}

button,
[role="button"],
.task-card,
.dispatch-table a {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

svg {
  pointer-events: none;
}

.icon-btn,
.task-card-menu,
.pipeline span,
.pipeline button,
.metric-action,
.dispatch-stat,
.task-card,
.primary-btn,
.secondary-btn {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.icon-btn:hover,
.task-card-menu:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.14);
}

.icon-btn:active,
.task-card-menu:active,
.pipeline span:active,
.pipeline button:active,
.metric-action:active,
.dispatch-stat:active,
.primary-btn:active,
.secondary-btn:active {
  transform: translateY(0) scale(0.98);
}

.task-card-menu {
  appearance: none;
  padding: 0;
  cursor: pointer;
}

.pipeline span,
.pipeline button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #1167f2;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.pipeline span:hover,
.pipeline span:focus-visible,
.pipeline button:hover,
.pipeline button:focus-visible {
  transform: translateY(-2px);
  background: #fff;
  outline: 0;
  box-shadow:
    0 14px 30px rgba(37, 99, 235, 0.18),
    0 0 0 3px rgba(255, 255, 255, 0.28);
}

.dispatch-section {
  margin-top: 18px;
}

.dispatch-head,
.dispatch-table-head {
  padding: 16px 22px;
}

.dispatch-stats-grid {
  gap: 12px;
  padding: 14px;
}

.dispatch-stat {
  min-height: 92px;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 3px 14px;
  padding: 14px 16px;
  border-radius: 18px;
}

.dispatch-stat span {
  width: 48px;
  height: 48px;
  box-shadow:
    0 0 0 5px rgba(45, 212, 191, 0.18),
    0 0 22px rgba(6, 182, 212, 0.31);
}

.dispatch-stat span svg {
  width: 22px;
  height: 22px;
}

.dispatch-stat p {
  font-size: 14px;
}

.dispatch-stat strong {
  font-size: 25px;
}

.dispatch-table-panel {
  margin-top: 18px;
}

.dispatch-table-wrap {
  max-height: 360px;
}

.dispatch-table th,
.dispatch-table td {
  padding: 13px 18px;
}

.content-grid {
  margin-top: 18px;
}

.task-card {
  scroll-margin: 18px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Smoother page-level scrolling and editable recognition result */
body {
  overflow-y: auto;
  overscroll-behavior-y: none;
}

.workspace,
.task-list,
.detail-panel,
.dispatch-table-wrap,
.recognition-result {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, 0.38) rgba(226, 232, 240, 0.64);
}

.workspace::-webkit-scrollbar,
.task-list::-webkit-scrollbar,
.detail-panel::-webkit-scrollbar,
.dispatch-table-wrap::-webkit-scrollbar,
.recognition-result::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.workspace::-webkit-scrollbar-thumb,
.task-list::-webkit-scrollbar-thumb,
.detail-panel::-webkit-scrollbar-thumb,
.dispatch-table-wrap::-webkit-scrollbar-thumb,
.recognition-result::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.32);
}

.task-list {
  max-height: none !important;
  overflow: visible !important;
  min-height: 0 !important;
  align-content: start;
}

.detail-panel {
  max-height: none !important;
  overflow: visible !important;
}

.dispatch-table {
  min-width: 1120px;
}

.editable-recognition-card {
  padding: 18px;
}

.editable-recognition-card .recognition-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.editable-recognition-card .recognition-card-title > em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.recognized-save-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  cursor: pointer;
}

.recognized-save-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.recognized-save-toggle span {
  width: 30px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.recognized-save-toggle strong {
  color: var(--ink);
  font-size: 13px;
}

.recognition-select-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.recognition-select-actions strong {
  color: var(--ink);
  font-size: 12px;
}

.recognition-select-actions button {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(49, 120, 198, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.recognized-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.recognized-edit-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.recognized-edit-grid label.wide {
  grid-column: 1 / -1;
}

.recognized-edit-grid label.time-field {
  grid-column: 1 / -1;
}

.recognized-reminder-field {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.92);
}

.recognized-reminder-field legend {
  padding: 0 6px;
  color: #496795;
  font-size: 13px;
  font-weight: 800;
}

.recognized-reminder-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recognized-reminder-options label {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 12px;
  background: #fff;
  color: #102a5c;
  cursor: pointer;
  font-weight: 800;
}

.recognized-reminder-options input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: #2563eb;
}

.recognized-reminder-options span {
  color: #102a5c;
  font-size: 13px;
}

.recognized-reminder-field p {
  margin: 0;
  color: #6b7e99;
  font-size: 12px;
  line-height: 1.45;
}

.recognized-edit-grid span {
  color: #496795;
  font-size: 13px;
  font-weight: 700;
}

.recognized-edit-grid input,
.recognized-edit-grid select,
.recognized-edit-grid textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 12px;
  background: #fff;
  color: #102a5c;
  outline: 0;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.recognized-edit-grid textarea {
  resize: vertical;
  line-height: 1.55;
}

.recognized-edit-grid .recognized-reminder-options input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
}

.recognized-edit-grid .recognized-reminder-options span {
  color: #102a5c;
  font-weight: 800;
}

.date-time-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.date-time-control input {
  min-width: 0;
}

.time-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #eef6ff);
  color: #2563eb;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.time-picker-btn:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
}

.top-export-btn {
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  white-space: nowrap;
}

.user-chip {
  border: 0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.user-chip strong {
  white-space: nowrap;
}

.top-actions {
  display: grid;
  grid-template-columns: minmax(320px, 520px) auto auto auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.search-box {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(220px, 1fr) 30px;
  align-items: center;
  gap: 10px;
  width: min(520px, 36vw);
  min-width: 320px;
  height: 46px;
  padding: 0 10px 0 16px;
  border: 1px solid #cfe0ff;
  border-radius: 14px;
  background: #fff;
  box-shadow:
    0 12px 28px rgba(37, 99, 235, 0.08),
    inset 0 0 0 1px rgba(37, 99, 235, 0.04);
}

.search-box:focus-within {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow:
    0 14px 34px rgba(37, 99, 235, 0.13),
    0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-box input {
  display: block;
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #102a5c;
  font-size: 14px;
  font-weight: 700;
}

.search-clear-btn {
  width: 28px;
  height: 28px;
  display: none;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: #eef5ff;
  color: #2563eb;
  cursor: pointer;
}

.search-box.has-query .search-clear-btn {
  display: grid;
}

.search-clear-btn svg {
  width: 15px;
  height: 15px;
}

.profile-dialog {
  width: min(520px, calc(100vw - 32px));
}

.profile-editor {
  display: grid;
  gap: 14px;
}

.profile-editor label {
  display: grid;
  gap: 8px;
  color: #496795;
  font-size: 13px;
  font-weight: 800;
}

.profile-editor input {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 14px;
  outline: 0;
  color: #102a5c;
  font-weight: 700;
}

.profile-editor input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(42px, 1fr));
  gap: 8px;
}

.avatar-picker button {
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  background: #f8fbff;
  color: #102a5c;
  font-size: 24px;
  cursor: pointer;
}

.avatar-picker button:hover,
.avatar-picker button.active {
  border-color: rgba(37, 99, 235, 0.55);
  background: #eef6ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.profile-preview {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 20px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
}

.profile-avatar-preview {
  width: 58px;
  height: 58px;
  font-size: 34px;
}

.profile-preview strong {
  color: #102a5c;
  font-size: 20px;
  font-weight: 900;
}

.profile-preview em {
  color: #66789d;
  font-style: normal;
  font-weight: 700;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-title-row p {
  margin-top: 4px;
  color: #66789d;
  font-size: 13px;
}

.storage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 8px 10px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 999px;
  background: #f5f9ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.attachment-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.attachment-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 36px 36px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.95);
}

.attachment-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eaf3ff;
  color: #2563eb;
}

.attachment-item strong {
  display: block;
  color: #102a5c;
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-item em {
  display: block;
  margin-top: 3px;
  color: #66789d;
  font-size: 12px;
  font-style: normal;
}

.attachment-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed rgba(37, 99, 235, 0.24);
  border-radius: 14px;
  color: #55709a;
  background: #f8fbff;
  font-weight: 700;
}

.attachment-path-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
}

.attachment-path-card > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eaf3ff;
  color: #2563eb;
}

.attachment-path-card strong {
  display: block;
  color: #102a5c;
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-path-card p {
  margin: 4px 0 0;
  color: #66789d;
  font-size: 13px;
  line-height: 1.5;
}

.attachment-backup-actions {
  margin-bottom: 10px;
}


.local-file-card {
  margin-top: 4px;
}

.local-file-actions button {
  flex-basis: 132px;
}

.attachment-prompt-dialog {
  width: min(520px, calc(100vw - 32px));
}

.attachment-prompt-body {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 16px 0 6px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
}

.attachment-prompt-body > span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #eaf3ff;
  color: #2563eb;
}

.attachment-prompt-body p {
  margin: 0;
  color: #496795;
  font-weight: 700;
  line-height: 1.65;
}

.attachment-preview-dialog {
  width: min(980px, calc(100vw - 24px));
  height: min(840px, calc(100dvh - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.attachment-preview-dialog[open] {
  display: grid;
}

.attachment-preview-dialog .dialog-head {
  min-height: 132px;
}

.attachment-preview-scroll {
  min-height: 0;
  overflow: auto;
  background: #f8fbff;
  border-top: 1px solid rgba(203, 213, 225, 0.72);
  border-bottom: 1px solid rgba(203, 213, 225, 0.72);
  overscroll-behavior: contain;
}

.attachment-preview-body {
  min-width: max-content;
  min-height: 100%;
  padding: 18px 22px;
}

.attachment-preview-frame,
.attachment-preview-image {
  width: min(100%, 100vw);
  min-width: min(820px, calc(100vw - 70px));
  height: 100%;
  min-height: 520px;
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 14px;
  background: #fff;
}

.attachment-preview-image {
  display: block;
  object-fit: contain;
  padding: 10px;
}

.attachment-preview-text {
  min-width: min(760px, calc(100vw - 70px));
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #102a5c;
  font: 14px/1.75 "Microsoft YaHei", sans-serif;
}

.attachment-preview-table {
  min-width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: #102a5c;
  font-size: 13px;
}

.attachment-preview-table th,
.attachment-preview-table td {
  min-width: 120px;
  max-width: 360px;
  padding: 8px 10px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
  word-break: break-word;
}

.attachment-preview-table th {
  background: #eaf3ff;
  color: #234b7d;
  font-weight: 900;
}

.attachment-preview-empty {
  display: grid;
  place-items: center;
  min-width: min(760px, calc(100vw - 70px));
  min-height: 360px;
  padding: 28px;
  color: #55709a;
  text-align: center;
  font-weight: 800;
}

.attachment-preview-empty strong {
  display: block;
  margin-bottom: 8px;
  color: #102a5c;
  font-size: 18px;
}

.attachment-preview-empty span {
  display: block;
  max-width: 520px;
  color: #64748b;
  font-weight: 700;
  line-height: 1.7;
}

.attachment-preview-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr);
  gap: 12px;
  background: #fff;
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
}

@media (max-width: 920px) {
  .top-actions {
    grid-template-columns: minmax(0, 1fr) auto auto;
    width: 100%;
  }

  .search-box {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
}

.recognized-edit-grid input:focus,
.recognized-edit-grid select:focus,
.recognized-edit-grid textarea:focus {
  border-color: rgba(37, 99, 235, 0.56);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.editable-recognition-card .task-tags {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .assignment-toolbar,
  .editable-recognition-card .recognition-card-title {
    align-items: stretch;
    flex-direction: column;
  }

  .assignment-toolbar div {
    justify-content: flex-start;
  }

  .image-preview-list {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .recognized-edit-grid {
    grid-template-columns: 1fr;
  }

  .recognized-reminder-options {
    grid-template-columns: 1fr;
  }
}

/* Model provider selector */
.model-provider-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 12px;
}

.model-provider-switch button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.96);
  color: #33527c;
  font-weight: 800;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.model-provider-switch button:hover,
.model-provider-switch button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.1);
  outline: 0;
}

.model-provider-switch button.active {
  border-color: rgba(37, 99, 235, 0.62);
  background: linear-gradient(135deg, #e8f2ff, #f6fbff);
  color: #1268f3;
  box-shadow:
    0 14px 30px rgba(37, 99, 235, 0.12),
    inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.model-provider-switch svg {
  width: 18px;
  height: 18px;
}

.model-provider-note {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 14px;
  background: #f7fbff;
  color: #496795;
  line-height: 1.55;
}

.model-provider-note strong {
  color: #102a5c;
}

.model-provider-note.ready {
  border-color: rgba(16, 185, 129, 0.26);
  background: #f0fdf8;
}

.error-summary {
  border-color: rgba(239, 68, 68, 0.22);
  background: linear-gradient(135deg, #fff7ed, #fff1f2);
}

.error-summary span {
  color: #b91c1c;
}

.dispatch-table-panel {
  display: none !important;
}

/* 1:1 SaaS dashboard restyle */
:root {
  --bg: #f6f9ff;
  --surface: #ffffff;
  --ink: #0f1f3d;
  --muted: #7888a5;
  --line: #e7edf7;
  --blue: #2563eb;
  --blue-soft: #edf5ff;
  --orange: #f59e0b;
  --red: #ef4444;
  --green: #10b981;
  --purple: #6366f1;
  --shadow: 0 18px 44px rgba(31, 56, 101, 0.08);
  --radius: 18px;
  --sidebar-width: 220px;
}

.cartoon-backdrop,
.fab {
  display: none !important;
}

html,
body {
  background: var(--bg);
}

body {
  color: var(--ink);
  font-size: 14px;
}

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background:
    radial-gradient(circle at 56% 0%, rgba(96, 165, 250, 0.14), transparent 34%),
    linear-gradient(180deg, #fbfdff 0%, #f5f8ff 100%);
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  padding: 26px 22px 22px;
  gap: 24px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 10px 0 40px rgba(37, 99, 235, 0.06);
}

.brand {
  gap: 12px;
  padding: 0 0 26px;
  border-bottom: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  padding: 11px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1f7aff 0%, #6d5dfc 100%);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.brand strong {
  color: #0c1d3a;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand small {
  margin-top: 4px;
  color: #7a8aa8;
  font-size: 13px;
}

.nav-group {
  gap: 10px;
}

.nav-item {
  min-height: 44px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 0 14px;
  border-radius: 10px;
  background: transparent;
  color: #4b5f82;
  font-weight: 700;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(90deg, #eaf2ff 0%, #f7fbff 100%);
  color: #1268f3;
}

.nav-item b {
  min-width: 24px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #1268f3;
  font-size: 12px;
}

.nav-item[data-view="upcoming"] b,
.nav-item[data-view="overdue"] b {
  background: #ffe9ea;
  color: #ef4444;
}

.quick-panel {
  margin-top: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.quick-panel button {
  width: 100%;
  min-height: 44px;
  justify-content: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #1268f3, #2563eb);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.tray-widget {
  display: grid;
  gap: 14px;
  padding: 18px 16px;
  border: 1px solid #edf2fb;
  border-radius: 10px;
  background: #f8fbff;
  color: #70809d;
  box-shadow: none;
}

.tray-widget div,
.tray-widget strong {
  color: #71819f;
  font-weight: 700;
}

.tray-widget strong {
  justify-content: space-between;
}

.workspace {
  min-height: 100vh;
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  grid-template-areas:
    "top top"
    "ai ai"
    "summary summary"
    "overdue urgent"
    "tasks stats";
  gap: 20px;
  align-items: start;
  padding: 18px 34px 28px;
  overflow: auto;
}

.topbar {
  grid-area: top;
  margin: 0;
  align-items: flex-start;
}

.top-copy h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  color: #0b1a35;
  font-size: clamp(24px, 2vw, 30px);
  line-height: 1.15;
  font-weight: 900;
  white-space: nowrap;
}

.title-ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5666ff, #7c6dff);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.22);
}

.title-ai-pill svg {
  width: 14px;
  height: 14px;
}

.ai-inline {
  color: #7a8aa8;
  font-size: 15px;
  font-weight: 600;
}

.ai-inline .pulse-dot {
  display: none;
}

.top-actions {
  gap: 14px;
  align-items: center;
}

.search-box {
  width: 360px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #dfe8f6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.05);
}

.search-box input {
  color: #334766;
  font-weight: 600;
}

.search-box input::placeholder {
  color: #9aa9c2;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: 1px solid #edf2fb;
  background: #fff;
  color: #2563eb;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.06);
}

.user-chip {
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1d2d4d;
  font-weight: 800;
}

.avatar-face {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff2e7;
  box-shadow: inset 0 0 0 1px #ffd6bd;
  font-size: 22px;
}

.summary-grid {
  grid-area: summary;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin: 0;
  min-width: 0;
}

.metric-tile {
  position: relative;
  min-height: 126px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  grid-template-areas:
    "label icon"
    "value icon"
    "hint icon";
  align-content: center;
  gap: 5px 12px;
  padding: 18px 20px;
  border: 1px solid #e6edf8;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.metric-tile::before {
  display: none;
}

.metric-tile p {
  grid-area: label;
  margin: 0;
  color: #2563eb;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.metric-tile:nth-child(2) p {
  color: #f97316;
}

.metric-tile:nth-child(3) p {
  color: #ef4444;
}

.metric-tile:nth-child(4) p {
  color: #059669;
}

.metric-tile strong {
  grid-area: value;
  color: #2563eb;
  font-size: 38px;
  line-height: 1;
  font-weight: 900;
}

.metric-tile:nth-child(2) strong {
  color: #f97316;
}

.metric-tile:nth-child(3) strong {
  color: #ef4444;
}

.metric-tile:nth-child(4) strong {
  color: #059669;
}

.metric-tile em {
  grid-area: hint;
  color: #8b9ab5;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.metric-icon {
  position: static;
  grid-area: icon;
  align-self: center;
  justify-self: end;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  opacity: 0.9;
}

.metric-icon.teal {
  color: #2563eb;
  background: #eaf2ff;
}

.metric-icon.orange {
  color: #f59e0b;
  background: #fff4df;
}

.metric-icon.red {
  color: #ef4444;
  background: #fff0f0;
}

.metric-icon.green {
  color: #10b981;
  background: #eafaf3;
}

.urgent-panel,
.ai-command-strip,
.stats-panel,
.overdue-board,
.task-panel {
  border: 1px solid #e6edf8;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.urgent-panel {
  grid-area: urgent;
  padding: 20px;
}

.urgent-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.urgent-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #dc2626;
  font-size: 17px;
  font-weight: 900;
}

.urgent-head button,
.link-btn {
  border: 0;
  background: transparent;
  color: #ef4444;
  font-weight: 800;
}

.urgent-list {
  display: grid;
  gap: 12px;
}

.urgent-empty {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #fbcaca;
  border-radius: 10px;
  background: #fffafa;
  color: #667795;
  font-weight: 700;
}

.urgent-empty strong {
  color: #132347;
}

.urgent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  padding: 14px 14px 12px;
  border-left: 3px solid #f59e0b;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(31, 56, 101, 0.06);
}

.urgent-item strong {
  display: block;
  color: #132347;
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.urgent-item span,
.urgent-item time {
  color: #667795;
  font-size: 13px;
  font-weight: 700;
}

.urgent-item em {
  justify-self: end;
  align-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffeaea;
  color: #ef4444;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.urgent-item time {
  grid-column: 2;
}

.ai-command-strip {
  grid-area: ai;
  min-height: 126px;
  height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 22px;
  border: 0;
  background:
    radial-gradient(circle at 86% 38%, rgba(139, 92, 246, 0.36), transparent 34%),
    linear-gradient(135deg, #2563eb 0%, #4338ca 52%, #7c3aed 100%);
  color: #fff;
  overflow: hidden;
}

.ai-command-strip::before {
  display: none;
}

.ai-command-strip::after {
  display: none !important;
}

.ai-chip {
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.ai-command-strip strong {
  margin: 8px 0 6px;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.ai-command-strip p {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

.pipeline {
  justify-content: flex-start;
  gap: 10px;
}

.pipeline span,
.ai-action-btn {
  height: 40px;
  min-width: 156px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #2563eb;
  font-weight: 900;
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
}

.ai-action-btn.secondary {
  min-width: 126px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.stats-panel {
  grid-area: stats;
  min-height: 230px;
  padding: 18px 22px;
}

.stats-panel h2 {
  margin: 0 0 6px;
  color: #0f1f3d;
  font-size: 20px;
}

.stats-panel > p {
  margin: 0 0 18px;
  color: #7a8aa8;
}

.stats-body {
  display: grid;
  grid-template-columns: 145px 1fr;
  align-items: center;
  gap: 20px;
}

.donut-chart {
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#60a5fa 0 53%, #6ee7b7 53% 90%, #fb923c 90% 99%, #a78bfa 99% 100%);
}

.donut-chart span {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #0f1f3d;
}

.donut-chart strong {
  font-size: 27px;
  line-height: 1;
  font-weight: 900;
}

.donut-chart em {
  margin-top: -24px;
  color: #667795;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.stats-legend {
  display: grid;
  gap: 13px;
}

.stats-legend span {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 9px;
  color: #5f7192;
  font-weight: 700;
}

.stats-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-green {
  background: #6ee7b7;
}

.legend-blue {
  background: #60a5fa;
}

.legend-orange {
  background: #fb923c;
}

.legend-purple {
  background: #a78bfa;
}

.stats-legend b {
  color: #334766;
}

.overdue-board {
  grid-area: overdue;
  min-height: 300px;
  height: auto;
  padding: 24px;
  border-color: #fee2e2;
  background: linear-gradient(135deg, rgba(255, 244, 244, 0.98), rgba(255, 255, 255, 0.96));
}

.overdue-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.overdue-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  color: #dc2626;
  font-size: 20px;
  font-weight: 900;
}

.overdue-head p {
  margin: 0;
  color: #ef4444;
  font-weight: 700;
}

.overdue-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.overdue-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #fecaca;
  border-left: 3px solid #ef4444;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.08);
}

.overdue-card div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.overdue-card strong {
  min-width: 0;
  color: #122344;
  font-size: 16px;
  line-height: 1.35;
  word-break: normal;
  overflow-wrap: anywhere;
}

.overdue-card div span {
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ffe4e6;
  color: #ef4444;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.overdue-card p,
.overdue-card small {
  margin: 0;
  color: #5f7192;
  font-weight: 700;
}

.overdue-card small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.overdue-card button {
  height: 38px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #ef4444;
  font-weight: 900;
}

.content-grid {
  grid-area: tasks;
  display: block;
  margin: 0;
  min-height: 0;
}

.task-panel {
  max-width: none;
  height: 390px;
  overflow: hidden;
}

.panel-toolbar {
  align-items: flex-start;
  padding: 20px 22px 0;
  border-bottom: 0;
}

.panel-toolbar h2 {
  margin: 0 0 14px;
  color: #0f1f3d;
  font-size: 18px;
  font-weight: 900;
}

.segmented {
  height: 34px;
  gap: 24px;
  padding: 0;
  border: 0;
  background: transparent;
}

.segmented button {
  position: relative;
  min-width: 0;
  padding: 0 0 10px;
  border-radius: 0;
  background: transparent;
  color: #70809d;
  font-weight: 800;
}

.segmented button.active {
  background: transparent;
  color: #2563eb;
  box-shadow: none;
}

.segmented button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: #2563eb;
}

.select-label {
  min-width: 126px;
  height: 36px;
  border: 1px solid #dbe6f6;
  border-radius: 8px;
  background: #fff;
}

.select-label span {
  display: none;
}

.select-label select {
  color: #435777;
  font-weight: 800;
}

.task-list {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 0;
  min-height: auto !important;
  padding: 8px 18px 18px;
  max-height: 298px !important;
  overflow: auto !important;
}

.task-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px 12px;
  border: 0;
  border-bottom: 1px solid #eef3fb;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.task-card:hover,
.task-card.active {
  transform: none;
  border-color: #eef3fb;
  background: #fbfdff;
  box-shadow: none;
}

.source-orb {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #eaf2ff;
  color: #2563eb;
  box-shadow: none;
}

.task-list .task-card:nth-child(2) .source-orb {
  background: #fff2df;
  color: #f97316;
}

.task-list .task-card:nth-child(3) .source-orb {
  background: #eafaf3;
  color: #10b981;
}

.task-list .task-card:nth-child(4) .source-orb {
  background: #f3e8ff;
  color: #7c3aed;
}

.source-orb svg {
  width: 22px;
  height: 22px;
}

.task-card .task-title-row strong {
  color: #132347;
  font-size: 15px;
  font-weight: 900;
}

.task-card-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
  color: #70809d;
  font-size: 13px;
}

.task-card-subline span {
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #4b74ac;
  font-weight: 700;
}

.task-card-subline span:nth-child(2) {
  background: #fff4df;
  color: #f97316;
}

.task-card-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.attachment-chip {
  max-width: 180px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: #f8fbff;
  color: #215fb3;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.attachment-chip:hover {
  border-color: rgba(37, 99, 235, 0.38);
  background: #eaf3ff;
}

.attachment-chip svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.attachment-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip.more {
  cursor: default;
  background: #eef6ff;
  color: #55709a;
}

.dispatch-progress-card {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(49, 120, 198, 0.16);
  border-radius: 8px;
  background: #f8fbff;
}

.dispatch-progress-card.detail {
  margin-top: 0;
}

.dispatch-progress-head,
.dispatch-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #496795;
  font-size: 12px;
  font-weight: 900;
}

.dispatch-progress-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dispatch-progress-head svg {
  width: 14px;
  height: 14px;
}

.dispatch-progress-head strong {
  color: #102a5c;
}

.dispatch-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.dispatch-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f9f8f, #3178c6);
}

.dispatch-progress-meta {
  justify-content: flex-start;
}

.dispatch-progress-meta .danger {
  color: #c44949;
}

.dispatch-avatar-strip {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dispatch-avatar-strip span,
.dispatch-avatar-strip em {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.dispatch-avatar-strip em {
  width: auto;
  min-width: 24px;
  padding: 0 7px;
  background: #eef2ff;
  color: #496795;
}

.dispatch-recipient-groups {
  display: grid;
  gap: 12px;
}

.dispatch-recipient-group {
  display: grid;
  gap: 8px;
}

.dispatch-recipient-group h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  color: #102a5c;
  font-size: 14px;
}

.dispatch-recipient-list {
  display: grid;
  gap: 6px;
}

.dispatch-recipient-row {
  display: grid;
  grid-template-columns: 36px minmax(90px, 1fr) minmax(120px, auto) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  background: #fff;
}

.dispatch-recipient-row.is-overdue {
  border-color: rgba(196, 73, 73, 0.28);
  background: #fffafa;
}

.dispatch-recipient-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e6f5f1;
  color: #08786d;
  font-weight: 900;
}

.dispatch-recipient-person,
.dispatch-recipient-state {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.dispatch-recipient-person strong {
  min-width: 0;
  overflow: hidden;
  color: #102a5c;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-recipient-person small,
.dispatch-recipient-state small {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-recipient-row em {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4f2;
  color: #496795;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.dispatch-recipient-row em.done {
  background: #e6f5f1;
  color: #08786d;
}

.dispatch-recipient-row em.overdue {
  background: #fae9e9;
  color: #c44949;
}

.dispatch-remind-btn {
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.dispatch-remind-btn svg {
  width: 14px;
  height: 14px;
}

.dispatch-remind-btn:disabled {
  cursor: default;
  opacity: 0.58;
}

@media (max-width: 640px) {
  .dispatch-recipient-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .dispatch-recipient-state {
    grid-column: 1 / -1;
  }

  .dispatch-remind-btn {
    grid-column: 2 / -1;
    justify-self: stretch;
  }
}

.task-card .due-column {
  align-items: flex-end;
  gap: 4px;
  min-width: 112px;
  padding: 0;
  margin: 0;
  border: 0;
}

.task-card .due-column strong {
  color: #ef4444;
  font-size: 13px;
  font-weight: 900;
}

.task-card .due-column span {
  color: #5f7192;
  font-size: 13px;
  font-weight: 700;
}

.detail-panel {
  display: block !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 80;
  width: min(520px, calc(100vw - 36px));
  min-height: 0 !important;
  max-height: min(760px, calc(100vh - 48px)) !important;
  padding: 22px;
  border: 1px solid #dfe8f6;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 38px 90px rgba(15, 23, 42, 0.24),
    0 0 0 9999px rgba(15, 23, 42, 0.18);
  overflow: auto !important;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(0.98);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.detail-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.hidden-recognition-text {
  display: none !important;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px;
  gap: 10px;
  align-items: start;
}

.settings-page {
  grid-column: 1 / -1;
  border-radius: 14px;
  border-color: #e6edf8;
  background: #fff;
}

@media (max-width: 1480px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  }

  .summary-grid {
    gap: 14px;
  }

  .metric-tile {
    padding: 20px;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "summary"
      "urgent"
      "overdue"
      "tasks"
      "ai"
      "stats";
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 18px;
  }

  .summary-grid,
  .overdue-cards,
  .stats-body {
    grid-template-columns: 1fr;
  }

  .topbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .model-provider-switch {
    grid-template-columns: 1fr;
  }
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.calendar-page,
.analytics-page {
  grid-column: 1 / -1;
  min-width: 0;
}

.calendar-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.calendar-overview article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.78)),
    #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.calendar-overview article > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eff6ff;
  color: #2563eb;
}

.calendar-overview strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.calendar-overview p,
.calendar-overview em {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.calendar-overview em {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.calendar-board,
.calendar-agenda,
.analytics-block,
.analytics-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.calendar-board {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.82)),
    #fff;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
  color: #46618d;
  font-size: 13px;
  font-weight: 800;
}

.calendar-weekdays span {
  padding: 9px 10px;
  text-align: center;
}

.calendar-cell {
  min-height: 96px;
  padding: 9px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.7);
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.calendar-cell:hover {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.calendar-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-cell.muted {
  background: rgba(248, 250, 252, 0.7);
  color: rgba(100, 116, 139, 0.6);
}

.calendar-cell.today {
  background:
    linear-gradient(180deg, rgba(219, 234, 254, 0.72), rgba(255, 255, 255, 0.86)),
    #eff6ff;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.26);
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.calendar-day-head time {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 900;
}

.calendar-cell.today .calendar-day-head time {
  background: #2563eb;
  color: #fff;
}

.calendar-day-head b {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  font-size: 12px;
}

.calendar-cell-tasks {
  display: grid;
  gap: 6px;
}

.calendar-task {
  min-height: 26px;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 10px;
  background: rgba(239, 246, 255, 0.86);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.calendar-task i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.calendar-task span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-task em {
  display: none;
}

.calendar-task.done {
  background: #ecfdf5;
  color: #047857;
}

.calendar-task.overdue {
  background: #fff1f2;
  color: #e11d48;
}

.calendar-task.progress {
  background: #fef3c7;
  color: #b45309;
}

.calendar-cell-tasks span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-agenda {
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.82)),
    #fff;
}

#calendarAgenda {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.calendar-agenda h3,
.analytics-block h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 18px;
}

.agenda-item {
  width: 100%;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 4px 12px;
  margin-bottom: 0;
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.agenda-item:hover {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.agenda-item span,
.agenda-item em,
.agenda-empty,
.analysis-empty {
  color: var(--muted);
}

.agenda-item strong {
  min-width: 0;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-item em {
  grid-column: 2;
  font-style: normal;
  font-size: 13px;
}

.agenda-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  gap: 8px;
  text-align: center;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.analytics-card {
  padding: 18px;
}

.analytics-card span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
}

.analytics-card p,
.analytics-card em {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.analytics-card strong {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  font-size: 30px;
}

.analytics-card em {
  font-style: normal;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
}

.analytics-block {
  padding: 18px;
}

.analysis-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 2fr) 48px;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.analysis-row:first-child {
  border-top: 0;
}

.analysis-row div:first-child {
  display: grid;
  gap: 3px;
}

.analysis-row strong {
  color: var(--ink);
}

.analysis-row span,
.analysis-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.analysis-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.analysis-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #14b8a6);
}

@media (max-width: 1180px) {
  .calendar-layout,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .calendar-overview,
  .analytics-summary {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions {
    flex-wrap: wrap;
  }

  .calendar-overview {
    grid-template-columns: 1fr;
  }

  .calendar-cell {
    min-height: 104px;
    padding: 8px;
  }

  .calendar-task {
    grid-template-columns: 7px minmax(0, 1fr);
  }

  .calendar-task em {
    display: none;
  }
}

.top-actions {
  grid-template-columns: minmax(320px, 520px) auto auto auto auto;
}

.top-upload-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 13px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  white-space: nowrap;
  text-shadow: none;
  box-shadow:
    0 14px 26px rgba(37, 99, 235, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.top-upload-btn:hover {
  background: linear-gradient(135deg, #0284c7, #1d4ed8);
  transform: translateY(-1px);
}

.top-upload-btn svg {
  width: 18px;
  height: 18px;
}

.tray-widget {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.tray-widget:hover {
  border-color: #cfe0ff;
  background: #eef6ff;
}

.help-dialog {
  width: min(760px, calc(100vw - 32px));
}

.help-dialog-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 22px;
}

.help-dialog-body article {
  display: grid;
  gap: 10px;
  min-height: 190px;
  padding: 18px;
  border: 1px solid #e3ecfb;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f7fbff);
}

.help-dialog-body article > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #eaf2ff;
  color: #2563eb;
}

.help-dialog-body strong {
  color: #102a5c;
  font-size: 16px;
}

.help-dialog-body p {
  margin: 0;
  color: #667795;
  line-height: 1.65;
}

body.global-drop-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1900;
  pointer-events: none;
  background: rgba(37, 99, 235, 0.12);
  backdrop-filter: blur(2px);
}

body.global-drop-active::after {
  content: "松开上传任务截图";
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1901;
  width: min(420px, calc(100vw - 48px));
  min-height: 150px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px dashed #2563eb;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  color: #1d4ed8;
  font-size: 22px;
  font-weight: 900;
  pointer-events: none;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
}

@media (max-width: 920px) {
  .top-actions {
    grid-template-columns: minmax(0, 1fr) repeat(4, auto);
  }

  .top-upload-btn span {
    display: none;
  }

  .top-upload-btn {
    width: 44px;
    padding: 0;
  }
}

@media (max-width: 760px) {
  .help-dialog-body {
    grid-template-columns: 1fr;
  }
}

/* Final mobile layout guard: keep the web app usable on narrow phones. */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
  }

  .login-screen,
  .registration-screen,
  .startup-screen {
    min-height: 100dvh;
    padding: 16px;
    align-items: flex-start;
  }

  .login-card,
  .registration-card,
  .startup-card {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    margin: 0;
    padding: 22px 18px;
    border-radius: 16px;
    overflow: hidden;
  }

  .login-card button,
  .registration-card button,
  .startup-card button,
  .login-card input,
  .registration-card input,
  .startup-card input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .login-copy h1 {
    font-size: 24px;
    line-height: 1.18;
    white-space: normal;
  }

  .app-shell {
    width: 100%;
    min-height: 100dvh;
    display: block;
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  }

  .sidebar .brand {
    padding: 0;
    margin-bottom: 10px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 19px;
  }

  .nav-group {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 6px;
    scrollbar-width: none;
  }

  .nav-group::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 38px;
    grid-template-columns: 18px auto;
    padding: 0 12px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .nav-item b {
    display: none;
  }

  .quick-panel,
  .tray-widget {
    display: none;
  }

  .workspace {
    width: 100%;
    min-width: 0;
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "top"
      "summary"
      "urgent"
      "overdue"
      "tasks"
      "ai"
      "stats";
    gap: 14px;
    padding: 14px;
    overflow: visible;
  }

  .topbar,
  .settings-header,
  .page-head,
  .panel-toolbar,
  .dispatch-table-head,
  .overdue-head,
  .urgent-head,
  .dialog-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .top-copy h1,
  .settings-header h2,
  .page-head h2,
  .dialog-head h2 {
    font-size: 22px;
    line-height: 1.2;
    white-space: normal;
  }

  .ai-inline {
    font-size: 13px;
    line-height: 1.45;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(4, 44px);
    gap: 8px;
    align-items: center;
  }

  .search-box {
    width: 100%;
    min-width: 0;
    height: 44px;
    grid-column: 1 / -1;
  }

  .top-export-btn,
  .top-upload-btn,
  .icon-btn,
  .user-chip {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
  }

  .top-export-btn span,
  .top-upload-btn span,
  .user-chip strong,
  .user-chip > svg {
    display: none;
  }

  .summary-grid,
  .settings-grid,
  .analytics-summary,
  .analytics-grid,
  .calendar-overview,
  .overdue-cards,
  .stats-body,
  .help-dialog-body,
  .form-grid,
  .profile-editor {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .metric-tile {
    min-height: 104px;
    padding: 16px;
  }

  .metric-tile p {
    white-space: normal;
  }

  .metric-tile strong {
    font-size: 32px;
  }

  .ai-command-strip {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    padding: 18px;
    border-radius: 14px;
  }

  .pipeline,
  .model-actions,
  .page-actions,
  .dispatch-toolbar,
  .recovery-actions,
  .dialog-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
  }

  .model-actions button,
  .page-actions button,
  .dispatch-toolbar button,
  .recovery-actions button,
  .dialog-actions button,
  .ai-action-btn {
    width: 100%;
    min-width: 0;
  }

  .task-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .task-list {
    max-height: none !important;
    padding: 8px 12px 14px;
    overflow: visible !important;
  }

  .task-card {
    grid-template-columns: 40px minmax(0, 1fr) !important;
    gap: 12px;
    align-items: start;
    min-height: 0;
    padding: 14px 6px;
  }

  .task-card .due-column {
    grid-column: 2;
    align-items: flex-start;
    min-width: 0;
    margin-top: 8px;
  }

  .task-card .task-title-row strong,
  .urgent-item strong,
  .agenda-item strong {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  .task-card-subline,
  .task-card-attachments {
    gap: 6px;
  }

  .attachment-chip {
    max-width: 100%;
  }

  .settings-page,
  .calendar-page,
  .analytics-page,
  .dispatch-table-panel {
    grid-column: auto;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .settings-header,
  .settings-block,
  .calendar-board,
  .calendar-agenda,
  .analytics-block,
  .analytics-card,
  .dispatch-table-panel {
    border-radius: 14px;
  }

  .settings-block {
    padding: 16px;
  }

  .field-label input,
  .field-label textarea,
  .field-label select,
  .login-card input,
  .registration-card input,
  .task-dialog input,
  .task-dialog textarea,
  .task-dialog select {
    min-width: 0;
    width: 100%;
  }

  .calendar-board,
  .dispatch-table-wrap {
    overflow-x: auto;
  }

  .calendar-board {
    width: 100%;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 640px;
  }

  .dispatch-table {
    min-width: 760px;
  }

  .detail-panel {
    inset: 10px !important;
    left: 10px !important;
    top: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    max-height: none !important;
    padding: 18px;
    border-radius: 16px;
    transform: translateY(8px) scale(0.99);
  }

  .detail-panel.open {
    transform: translateY(0) scale(1);
  }

  .detail-head {
    grid-template-columns: minmax(0, 1fr) 40px 40px;
  }

  .task-dialog,
  .profile-dialog,
  .help-dialog,
  .attachment-prompt-dialog,
  .attachment-preview-dialog {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    margin: auto;
    border-radius: 16px;
  }

  .task-dialog form,
  .recognition-dialog {
    max-height: calc(100dvh - 20px);
    overflow: auto;
  }

  .dialog-head,
  .dialog-actions,
  .help-dialog-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .attachment-preview-dialog {
    height: calc(100dvh - 20px);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .attachment-preview-dialog .dialog-head,
  .attachment-preview-body,
  .attachment-preview-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .attachment-preview-frame,
  .attachment-preview-image,
  .attachment-preview-text,
  .attachment-preview-empty {
    min-width: calc(100vw - 52px);
  }

  .attachment-preview-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .workspace {
    padding: 10px;
    gap: 12px;
  }

  .sidebar {
    padding: 10px;
  }

  .top-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .top-export-btn,
  .top-upload-btn,
  .icon-btn,
  .user-chip {
    width: 100%;
    min-width: 0;
  }

  .metric-tile {
    grid-template-columns: minmax(0, 1fr) 46px;
  }

  .metric-icon {
    width: 46px;
    height: 46px;
  }
}

/* Mobile polish: remove desktop minimums that can push phone layouts sideways. */
@media (max-width: 760px) {
  html,
  body,
  .app-shell,
  .sidebar,
  .workspace {
    min-width: 0;
    max-width: 100%;
  }

  .login-screen,
  .registration-screen,
  .startup-screen {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    padding: 16px;
    overflow-x: hidden;
  }

  .login-card,
  .registration-card,
  .startup-card {
    width: 100%;
    max-width: 420px;
    min-width: 0;
    box-sizing: border-box;
  }

  .login-card > *,
  .registration-card > *,
  .startup-card > *,
  .login-brand,
  .login-brand > div,
  .login-copy,
  .login-copy > *,
  .login-card label,
  .registration-card label {
    min-width: 0;
    max-width: 100%;
  }

  .login-brand small,
  .login-copy span,
  .login-error,
  .link-btn {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .link-btn {
    width: 100%;
    justify-self: stretch;
  }

  .workspace > *,
  .topbar > *,
  .top-copy,
  .top-actions,
  .summary-grid,
  .urgent-panel,
  .overdue-board,
  .stats-panel,
  .ai-command-strip,
  .content-grid,
  .task-panel,
  .task-list,
  .settings-page,
  .settings-block,
  .calendar-page,
  .calendar-board,
  .calendar-agenda,
  .analytics-page,
  .analytics-block,
  .analytics-card {
    min-width: 0;
    max-width: 100%;
  }

  .search-box {
    grid-template-columns: 18px minmax(0, 1fr) 30px;
    padding: 0 12px;
  }

  .search-box input,
  .select-label,
  .select-label select {
    min-width: 0;
    width: 100%;
  }

  .panel-toolbar .segmented,
  .segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .segmented button {
    min-width: 0;
    padding: 0 10px;
    white-space: normal;
  }

  .task-card,
  .task-card-main,
  .task-title-row,
  .task-card-subline,
  .task-card-attachments,
  .task-card .due-column {
    min-width: 0;
    max-width: 100%;
  }

  .task-card-subline,
  .task-card-attachments {
    flex-wrap: wrap;
  }

  .task-card .due-column {
    width: 100%;
    justify-self: start;
  }
}

@media (max-width: 420px) {
  .login-screen,
  .registration-screen,
  .startup-screen {
    padding: 12px;
  }

  .login-card,
  .registration-card,
  .startup-card {
    padding: 20px 16px;
  }

  .top-copy h1 {
    font-size: 20px;
  }

  .top-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .top-actions > .hidden {
    display: none !important;
  }
}

/* Keep the phone navigation compact instead of a tall desktop menu. */
@media (max-width: 760px) {
  .sidebar {
    gap: 8px;
  }

  .sidebar .brand {
    min-height: 0;
  }

  .nav-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
    height: 40px;
  }
}

/* Phone settings page must be a true single column. */
@media (max-width: 760px) {
  .settings-page {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .settings-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .settings-grid > .settings-block,
  .model-config-block,
  .wecom-settings-block,
  .cloud-reminder-settings-block,
  .feedback-settings-block,
  .attachment-settings-block,
  .local-file-settings-block,
  .auth-settings-block {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .settings-block > *,
  .settings-block-head,
  .wecom-status-card,
  .attachment-path-card,
  .feedback-form,
  .field-label,
  .model-actions,
  .account-manager,
  .shortcut-row,
  .config-note {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .settings-block-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .wecom-status-card,
  .attachment-path-card {
    grid-template-columns: 40px minmax(0, 1fr) !important;
  }

  .wecom-status-card strong,
  .attachment-path-card strong,
  .wecom-status-card p,
  .attachment-path-card p {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
  }

  .desktop-toggle,
  .settings-block label:not(.field-label),
  .shortcut-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
  }
}

/* Stable task dispatch dialogs: keep actions visible while long assignee lists scroll. */
.task-dialog {
  overflow: hidden;
}

.task-dialog form {
  max-height: min(86vh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.task-dialog .form-grid {
  overflow: auto;
  overscroll-behavior: contain;
}

.task-dialog .dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: var(--surface);
}

#assignmentField {
  min-height: 292px;
  grid-template-rows: auto auto auto minmax(150px, 1fr);
  align-self: start;
}

#assignmentPicker {
  min-height: 150px;
  max-height: clamp(168px, 24vh, 260px);
}

.recognition-assignment-field {
  min-height: 252px;
  grid-template-rows: auto auto auto minmax(128px, 1fr);
}

.recognition-assignment-field .assignment-picker {
  min-height: 128px;
}

.recognition-dialog[open] {
  max-height: min(86vh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.recognition-dialog:not([open]) {
  display: none;
}

.recognition-layout {
  min-height: 0;
  overflow: hidden;
}

.recognition-input,
.recognition-result {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

#saveRecognizedBtn {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: auto;
}

@media (max-width: 760px) {
  .task-dialog form,
  .recognition-dialog[open] {
    max-height: calc(100dvh - 20px);
  }

  .task-dialog .form-grid,
  .recognition-layout,
  .recognition-input,
  .recognition-result {
    overflow: auto;
  }
}

/* Keep the desktop sidebar actions reachable on shorter screens. */
@media (min-width: 761px) {
  .sidebar {
    max-height: 100vh;
    overflow: hidden;
  }

  .sidebar .brand,
  .quick-panel,
  .tray-widget {
    flex: 0 0 auto;
  }

  .nav-group {
    flex: 1 1 auto;
    min-height: 0;
    gap: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-width: thin;
  }

  .nav-item {
    min-height: 40px;
  }

  .quick-panel {
    margin-top: 0;
  }
}
