﻿:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-rgb: 255, 255, 255;
  --panel-muted: #f8fafc;
  --panel-border: rgba(255, 255, 255, 0.8);
  --line: #e7ebf3;
  --text: #1f2937;
  --text-strong: #0f172a;
  --muted: #6b7280;
  --note: #475569;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --brand: #4338ca;
  --brand-strong: #2563eb;
  --brand-soft: #eef2ff;
  --brand-line: #a5b4fc;
  --cyan-soft: #ecfeff;
  --cyan-text: #0e7490;
  --completed-soft: #e2e8f0;
  --task-high-bg: #fff5f5;
  --task-medium-bg: #fffbeb;
  --task-low-bg: #f0fdf4;
  --task-completed-bg: #f8fafc;
  --slot-border: #cbd5e1;
  --slot-hover-border: #818cf8;
  --insert-line: #111827;
  --body-gradient: linear-gradient(180deg, #f8faff 0%, #f3f6fb 100%);
  --day-header-gradient: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.92));
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --hover-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  --schedule-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
  --column-width: 250px;
  --column-gap: 16px;
  --el-bg-color: var(--panel);
  --el-bg-color-overlay: var(--panel);
  --el-fill-color-blank: var(--panel);
  --el-fill-color-light: var(--panel-muted);
  --el-border-color: var(--line);
  --el-border-color-light: var(--line);
  --el-text-color-primary: var(--text);
  --el-text-color-regular: var(--text);
  --el-text-color-secondary: var(--muted);
  --el-disabled-bg-color: var(--panel-muted);
  --el-disabled-text-color: var(--muted);
  --el-mask-color: rgba(255, 255, 255, 0.42);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root[data-theme="dark"] {
    --bg: #0f172a;
    --panel: #172033;
    --panel-rgb: 23, 32, 51;
    --panel-muted: #111827;
    --panel-border: rgba(148, 163, 184, 0.18);
    --line: #334155;
    --text: #e5e7eb;
    --text-strong: #f8fafc;
    --muted: #94a3b8;
    --note: #cbd5e1;
    --danger: #fb7185;
    --warning: #fbbf24;
    --success: #4ade80;
    --brand: #c4b5fd;
    --brand-strong: #93c5fd;
    --brand-soft: rgba(99, 102, 241, 0.22);
    --brand-line: rgba(129, 140, 248, 0.55);
    --cyan-soft: rgba(8, 145, 178, 0.18);
    --cyan-text: #67e8f9;
    --completed-soft: #253047;
    --task-high-bg: rgba(127, 29, 29, 0.42);
    --task-medium-bg: rgba(113, 63, 18, 0.38);
    --task-low-bg: rgba(20, 83, 45, 0.36);
    --task-completed-bg: #1e293b;
    --slot-border: #475569;
    --slot-hover-border: #818cf8;
    --insert-line: #f8fafc;
    --body-gradient: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    --day-header-gradient: linear-gradient(180deg, rgba(23,32,51,0.98), rgba(23,32,51,0.92));
    --shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
    --hover-shadow: 0 12px 22px rgba(0, 0, 0, 0.36);
    --schedule-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    --el-color-primary-light-9: rgba(59, 130, 246, 0.18);
    --el-color-success-light-9: rgba(34, 197, 94, 0.18);
    --el-color-warning-light-9: rgba(245, 158, 11, 0.18);
    --el-color-danger-light-9: rgba(239, 68, 68, 0.18);
    --el-mask-color: rgba(15, 23, 42, 0.36);
    color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--body-gradient);
  color: var(--text);
}

[v-cloak] { display: none; }

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 100vh;
  gap: 20px;
  padding: 20px;
  transition: grid-template-columns 0.2s ease;
}

.site-credit {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  padding: 4px 0 0;
}

.app-shell.sidebar-collapsed > .site-credit {
  grid-column: 1;
}

.site-credit-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 70px;
  padding: 3px 8px;
  color: var(--muted);
}

.site-credit-logo-frame {
  position: relative;
  width: 76px;
  height: 62px;
  overflow: hidden;
  border-radius: 8px;
  flex: 0 0 auto;
}

.site-credit-logo {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 160px;
  max-width: none;
  height: auto;
  display: block;
  transform: translateX(-50%);
}

.site-credit-copy {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.site-credit-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.site-credit-copy strong {
  color: var(--text-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.sidebar-collapsed > .timeline-area {
  grid-column: 1;
  grid-row: 1;
}

.summary-panel {
  position: sticky;
  top: 20px;
  align-self: start;
  background: rgba(var(--panel-rgb), 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.summary-panel-content {
  min-width: 0;
}

.app-shell > .summary-panel.is-collapsed {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 30;
  width: 56px;
  max-height: calc(100vh - 40px);
  padding: 8px;
  overflow: hidden;
}

.app-shell > .summary-panel.is-collapsed .summary-panel-content {
  display: none;
}

.summary-panel:not(.is-collapsed) .summary-header {
  padding-right: 36px;
}

.sidebar-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.sidebar-action-button,
.sidebar-peek-button {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text-strong);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font-weight: 900;
  box-shadow: var(--schedule-shadow);
}

.sidebar-peek-button.is-expanded-control {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  min-height: 30px;
  height: 30px;
  border-radius: 9px;
  padding: 0;
  box-shadow: none;
  background: var(--panel-muted);
}

.sidebar-action-button {
  color: var(--brand);
}

.sidebar-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sidebar-action-button span {
  writing-mode: vertical-rl;
  letter-spacing: 0;
  font-size: 0.8rem;
  line-height: 1.1;
}

.sidebar-action-button:not(:disabled):hover,
.sidebar-peek-button:hover {
  border-color: var(--brand-line);
  color: var(--brand);
}

.sidebar-peek-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.sidebar-peek-text {
  writing-mode: vertical-rl;
  letter-spacing: 0;
  font-size: 0.8rem;
  line-height: 1.1;
}

.sidebar-peek-count {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.summary-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
}

.summary-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.toolbar,
.auth-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.account-menu {
  position: relative;
}

.avatar-button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22);
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  padding: 0;
}

.avatar-button.is-guest {
  background: var(--panel);
  color: var(--brand);
  border-color: var(--line);
}

.avatar-button-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(var(--panel-rgb), 0.98);
  width: min(420px, calc(100vw - 40px));
  margin-bottom: 0;
  box-shadow: var(--shadow);
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row-title {
  color: var(--text-strong);
  font-weight: 900;
}

.settings-row-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.settings-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.auth-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.auth-title-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.account-profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.account-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.2);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}

.account-avatar-hint {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
}

.auth-title {
  font-weight: 800;
}

.auth-status {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.nethub-auth-panel {
  align-items: stretch;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand) 6%, var(--panel));
  text-align: center;
}

.nethub-auth-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 2px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-strong), #7c5cff);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 25%, transparent);
}

.nethub-auth-panel h3,
.nethub-auth-panel p {
  margin: 0;
}

.nethub-auth-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.account-setting-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}

.auth-card .account-setting-actions .el-button {
  width: auto;
  min-width: 0;
  margin-left: 0;
  padding: 4px 0;
  font-weight: 700;
}

.account-center-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 22%, transparent);
  font-weight: 800;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.account-center-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.account-center-button:hover {
  color: #fff;
  filter: brightness(.96);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 30%, transparent);
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.auth-mode-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.auth-mode-button.active {
  color: var(--brand-strong);
  border-color: var(--brand-line);
  background: var(--brand-soft);
}

.auth-card .el-input,
.auth-card .el-button {
  width: 100%;
}

.locked-hint {
  color: var(--danger);
  font-size: 0.88rem;
  line-height: 1.5;
}

.avatar-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.avatar-file-input {
  display: none;
}

.avatar-editor-main {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 190px;
  gap: 22px;
  align-items: start;
}

.avatar-crop-column,
.avatar-preview-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.avatar-cropper {
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--soft);
  border: 1px solid var(--line);
  cursor: grab;
  touch-action: none;
}

.avatar-cropper:active {
  cursor: grabbing;
}

.avatar-cropper.is-empty {
  cursor: default;
}

.avatar-crop-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: none;
  user-select: none;
  pointer-events: none;
  transform-origin: top left;
}

.avatar-crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.avatar-crop-mask::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.48), inset 0 0 0 1px rgba(15, 23, 42, 0.16);
}

.avatar-empty-preview,
.avatar-preview {
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-empty-preview {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 150px;
  height: 150px;
  font-size: 2.6rem;
}

.avatar-empty-preview img,
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-preview {
  width: 128px;
  height: 128px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
  font-size: 2.2rem;
}

.avatar-editor-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.avatar-color-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avatar-color-title {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.avatar-color-picker-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
}

.avatar-color-picker {
  width: 48px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.avatar-color-value {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.avatar-rgb-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.avatar-rgb-fields label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.avatar-rgb-fields input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 4px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.82rem;
}

.avatar-color-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.avatar-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px var(--line), 0 6px 14px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.avatar-color-swatch.active {
  box-shadow: 0 0 0 3px var(--brand-line), 0 8px 18px rgba(15, 23, 42, 0.18);
}

.avatar-editor-actions .el-button {
  width: 100%;
  margin-left: 0;
}

@media (max-width: 720px) {
  .avatar-editor-main {
    grid-template-columns: 1fr;
  }
}

.feedback-dialog {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feedback-history {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.feedback-history-header,
.feedback-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.feedback-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.feedback-history h3 {
  margin: 0;
  font-size: 1rem;
}

.feedback-limit-hint {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-top: 8px;
}

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.feedback-item,
.feedback-reply-source {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-muted);
  padding: 12px;
}

.feedback-content,
.feedback-reply,
.feedback-table-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.feedback-content {
  margin-top: 8px;
}

.feedback-reply {
  margin-top: 10px;
  color: var(--note);
}

.feedback-table-text {
  max-height: 7.5em;
  overflow: auto;
}

.feedback-limit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-muted);
}

.feedback-limit-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.feedback-reply-dialog {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toolbar-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.quick-jump-picker {
  width: 128px;
}

.quick-jump-calendar-popper .el-date-table td.has-quick-jump-task .el-date-table-cell__text::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--el-color-danger);
  transform: translateX(-50%);
}

.quick-jump-calendar-popper .el-date-table td.current.has-quick-jump-task:not(.disabled) .el-date-table-cell__text::after,
.quick-jump-calendar-popper .el-date-table td.start-date.has-quick-jump-task .el-date-table-cell__text::after,
.quick-jump-calendar-popper .el-date-table td.end-date.has-quick-jump-task .el-date-table-cell__text::after {
  background: #fff;
}

.summary-section {
  margin-top: 20px;
}

.summary-section h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  font-size: 1rem;
}

.summary-section .summary-subtitle {
  margin-bottom: 10px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: var(--panel);
  margin-bottom: 12px;
}

.summary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 8px;
}

.summary-card-heading {
  min-width: 0;
}

.summary-card-title {
  font-weight: 700;
  font-size: 0.98rem;
}

.summary-card-description {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.summary-empty,
.empty-column {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  padding: 8px 0;
}

.summary-task,
.task-card {
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.summary-task {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--panel-muted);
}

.summary-task:hover,
.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
  border-color: var(--line);
}

.task-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.task-title {
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.task-card .task-title,
.schedule-card .task-title,
.ddl-card .task-title,
.schedule-drag-preview .task-title,
.summary-task .task-title {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-scroll .task-card .task-title {
  -webkit-line-clamp: 2;
}

.task-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.task-note-preview {
  margin-top: 6px;
  color: var(--note);
  font-size: 0.88rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.schedule-card .task-note-preview,
.ddl-card .task-note-preview {
  -webkit-line-clamp: 1;
}

.timeline-scroll .task-card .task-note-preview {
  -webkit-line-clamp: 1;
}

.summary-task[draggable="true"] {
  cursor: grab;
  touch-action: none;
}

.summary-task[draggable="true"]:active {
  cursor: grabbing;
}

.priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 6px;
  flex-shrink: 0;
}

.priority-high { background: var(--danger); }
.priority-medium { background: var(--warning); }
.priority-low { background: var(--success); }

.timeline-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-header {
  position: sticky;
  top: 20px;
  z-index: 20;
  background: rgba(var(--panel-rgb), 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr) auto auto;
  grid-template-areas:
    "navigation actions feedback account"
    "subtitle subtitle subtitle subtitle";
  align-items: start;
  column-gap: 12px;
  row-gap: 0;
}

.task-note-editor {
  width: 100%;
}

.managebac-task-source-link {
  margin-top: 8px;
  max-width: 100%;
}

.timeline-title {
  grid-area: navigation;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.timeline-title::-webkit-scrollbar {
  display: none;
}

.timeline-header-actions {
  grid-area: actions;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: nowrap;
  padding-top: 3px;
}

.timeline-header > .feedback-quick-action {
  grid-area: feedback;
  align-self: start;
  margin-top: 3px;
}

.timeline-header-preferences {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.timeline-header-preferences > * {
  flex: 0 0 auto;
}

.timeline-header-preferences .language-control {
  margin-left: auto;
}

@media (max-width: 1500px) {
  .timeline-header-preferences .language-control > span {
    display: none;
  }
}

.timeline-header > .account-menu {
  grid-area: account;
  align-self: start;
  margin-top: 3px;
}

.language-control {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.language-control select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  padding: 4px 28px 4px 9px;
  font: inherit;
  cursor: pointer;
}

.language-control select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.theme-toggle-row {
  min-height: 32px;
  flex-wrap: nowrap;
}

.theme-mode-toggle {
  position: relative;
  width: 64px;
  height: 32px;
  flex: 0 0 64px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  box-shadow: inset 0 2px 5px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-mode-toggle:hover {
  border-color: var(--brand-line);
}

.theme-mode-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.theme-mode-toggle.is-dark {
  background: #111827;
  border-color: #334155;
  color: #94a3b8;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.34);
}

.theme-mode-toggle.is-english {
  width: 74px;
  flex-basis: 74px;
}

.theme-mode-toggle-label {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  user-select: none;
}

.theme-mode-toggle.is-dark .theme-mode-toggle-label {
  right: auto;
  left: 9px;
}

.theme-mode-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 1;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 50%;
  background: #ffffff;
  color: #f59e0b;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.24);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.theme-mode-toggle.is-dark .theme-mode-toggle-knob {
  transform: translateX(34px);
  background: #64748b;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.58);
}

.theme-mode-toggle.is-dark.is-english .theme-mode-toggle-knob {
  transform: translateX(44px);
}

.theme-mode-toggle-knob svg {
  width: 17px;
  height: 17px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-mode-toggle-knob .theme-mode-star {
  fill: currentColor;
  stroke: none;
}

@media (prefers-reduced-motion: reduce) {
  .theme-mode-toggle,
  .theme-mode-toggle-knob {
    transition: none;
  }
}

.timeline-title h2 {
  margin: 0;
  font-size: 1.3rem;
}

.timeline-subtitle {
  grid-area: subtitle;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.timeline-scroll-frame {
  min-width: 0;
}

.timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.timeline-scroll::-webkit-scrollbar {
  display: none;
}

.timeline-sticky-scrollbar {
  position: sticky;
  bottom: 0;
  z-index: 18;
  height: 22px;
  margin-top: -10px;
  padding: 4px 0 3px;
  overflow-x: auto;
  overflow-y: hidden;
  background: linear-gradient(
    180deg,
    rgba(var(--panel-rgb), 0),
    rgba(var(--panel-rgb), 0.94) 42%,
    rgba(var(--panel-rgb), 0.98)
  );
  scrollbar-width: auto;
  scrollbar-color: var(--brand-line) rgba(var(--panel-rgb), 0.84);
}

.timeline-sticky-scrollbar::-webkit-scrollbar {
  height: 12px;
}

.timeline-sticky-scrollbar::-webkit-scrollbar-track {
  background: rgba(var(--panel-rgb), 0.84);
  border-radius: 999px;
}

.timeline-sticky-scrollbar::-webkit-scrollbar-thumb {
  background: var(--brand-line);
  border-radius: 999px;
}

.timeline-sticky-scrollbar-spacer {
  height: 1px;
}

.ddl-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.ddl-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ddl-calendar-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

.ddl-calendar-page > .ddl-calendar-nav {
  justify-content: center;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(var(--panel-rgb), 0.94);
  box-shadow: var(--schedule-shadow);
}

.ddl-calendar-title {
  min-width: 120px;
  text-align: center;
  color: var(--text-strong);
  font-weight: 900;
}

.ddl-calendar-panel {
  container-type: inline-size;
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: visible;
  padding-bottom: 10px;
}

.ddl-calendar-grid {
  --ddl-calendar-gap: 8px;
  --ddl-calendar-weekday-height: 42px;
  --ddl-calendar-cell-by-width: calc((100cqw - 6 * var(--ddl-calendar-gap)) / 7);
  --ddl-calendar-cell-size: var(--ddl-calendar-cell-by-width);
  width: calc(7 * var(--ddl-calendar-cell-size) + 6 * var(--ddl-calendar-gap));
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(7, var(--ddl-calendar-cell-size));
  grid-template-rows:
    var(--ddl-calendar-weekday-height)
    repeat(var(--ddl-calendar-week-count), var(--ddl-calendar-cell-size));
  gap: var(--ddl-calendar-gap);
  align-self: flex-start;
}

.ddl-calendar-weekday {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ddl-calendar-day {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(var(--panel-rgb), 0.95);
  box-shadow: var(--schedule-shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
}

.ddl-calendar-jump-button {
  appearance: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  flex: 0 0 26px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
  z-index: 2;
}

.ddl-calendar-jump-button:hover,
.ddl-calendar-jump-button:focus-visible {
  border-color: var(--brand-line);
  color: var(--brand);
  background: var(--brand-soft);
}

.ddl-calendar-day.is-outside-month {
  opacity: 0.46;
  background: var(--panel-muted);
}

.ddl-calendar-day.is-today {
  border-color: var(--brand-line);
}

.ddl-calendar-day.is-selected {
  outline: 2px solid var(--brand-line);
  outline-offset: -2px;
}

.ddl-calendar-day-number {
  align-self: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-strong);
  font-size: 0.86rem;
  font-weight: 900;
  flex: 0 0 auto;
}

.ddl-calendar-day.is-today .ddl-calendar-day-number {
  background: var(--brand-soft);
  color: var(--brand);
}

.ddl-calendar-task-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-line) transparent;
}

.ddl-calendar-task {
  min-width: 0;
  min-height: 28px;
  border: 1px solid transparent;
  border-left: 4px solid transparent;
  border-radius: 8px;
  padding: 5px 7px;
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

.admin-readonly-board .ddl-calendar-task {
  cursor: default;
}

.ddl-calendar-task.priority-high { border-left-color: var(--danger); background: var(--task-high-bg); }
.ddl-calendar-task.priority-medium { border-left-color: var(--warning); background: var(--task-medium-bg); }
.ddl-calendar-task.priority-low { border-left-color: var(--success); background: var(--task-low-bg); }
.ddl-calendar-task.completed {
  opacity: 0.7;
  background: var(--panel-muted);
}

.ddl-calendar-task-time {
  color: var(--text-strong);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
}

.ddl-calendar-task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
}

.timeline-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--column-width);
  gap: var(--column-gap);
  align-items: start;
  min-height: calc(100vh - 150px);
}

.day-column {
  background: rgba(var(--panel-rgb), 0.95);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow);
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.day-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--day-header-gradient);
  padding-bottom: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.day-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.day-add-schedule-button {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--brand);
  cursor: pointer;
  font: 700 1.25rem/1 system-ui, sans-serif;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.day-add-schedule-button:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-1px);
}

.day-add-schedule-button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.day-add-schedule-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.day-label {
  font-weight: 800;
  font-size: 1rem;
  margin: 0 0 6px;
}

.day-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
}

.column-task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}

.task-card {
  padding: 12px;
  background: var(--panel);
  border-left: 5px solid transparent;
}

.task-card.priority-high { border-left-color: var(--danger); background: var(--task-high-bg); }
.task-card.priority-medium { border-left-color: var(--warning); background: var(--task-medium-bg); }
.task-card.priority-low { border-left-color: var(--success); background: var(--task-low-bg); }
.task-card.completed {
  opacity: 0.7;
  background: var(--panel-muted);
}

.task-time {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-strong);
  white-space: nowrap;
}

.task-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.meta-chip {
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.subject-chip {
  background: var(--cyan-soft);
  color: var(--cyan-text);
}

.completed-badge {
  background: var(--completed-soft);
  color: var(--note);
}

.dialog-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

.dialog-footer .left-actions,
.dialog-footer .right-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fixed-time-input {
  display: inline-grid;
  grid-template-columns: 72px 18px 72px;
  align-items: center;
  gap: 6px;
}

.fixed-time-input .el-input__wrapper {
  text-align: center;
}

.fixed-time-input .el-input__inner {
  text-align: center;
}

.fixed-time-colon {
  color: var(--text-strong);
  font-weight: 900;
  text-align: center;
  user-select: none;
}

.subject-select {
  width: 100%;
}

.subject-template-edit-option {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  color: var(--brand);
  font-weight: 800;
}

.subject-template-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.subject-template-hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.subject-template-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: min(48vh, 420px);
  overflow: auto;
  padding-right: 4px;
}

.subject-template-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-muted);
  padding: 6px 8px;
  min-height: 34px;
}

.subject-template-name {
  min-width: 0;
  color: var(--text-strong);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subject-template-row .el-checkbox {
  height: 20px;
}

.subject-template-row .el-tag {
  height: 22px;
  padding: 0 7px;
}

.subject-template-row .el-button {
  min-height: 24px;
  padding: 4px 8px;
}

.subject-template-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}


.page-nav {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}

.feedback-quick-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.feedback-quick-action .el-button {
  min-width: 72px;
  flex: 0 0 auto;
  font-weight: 800;
  white-space: nowrap;
}

.feedback-quick-action .el-button + .el-button {
  margin-left: 0;
}

.page-nav-button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.page-nav-button.active {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand);
}

.daily-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.schedule-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.schedule-title-row .task-title {
  flex: 1;
  min-width: 0;
}

.schedule-habit-label {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}

.habit-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.habit-conflict-banner {
  border: 1px solid rgba(245, 108, 108, 0.35);
  border-radius: 8px;
  background: rgba(245, 108, 108, 0.08);
  color: var(--danger);
  padding: 10px 12px;
  font-size: 0.9rem;
}

.schedule-conflict-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  border: 1px solid rgba(220, 38, 38, 0.48);
  border-radius: 14px;
  background: rgba(220, 38, 38, 0.10);
  color: var(--danger);
  padding: 11px 14px;
  font-size: 0.9rem;
}

.schedule-conflict-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.schedule-conflict-types span {
  padding: 3px 8px;
  border: 1px solid rgba(220, 38, 38, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 800;
}

.habit-end-time {
  margin-left: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.daily-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(var(--panel-rgb), 0.94);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--schedule-shadow);
  padding: 12px 14px;
}

.daily-tools-title {
  font-weight: 800;
  font-size: 0.95rem;
}

.daily-tools-subtitle {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 4px;
}

.daily-tools-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.schedule-day-items {
  position: relative;
  flex: 1;
  min-height: 140px;
  padding: 2px 2px 14px;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.schedule-day-items.is-drag-target {
  background: rgba(99, 102, 241, 0.06);
  box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.24);
  border-radius: 14px;
}

.schedule-card-list {
  position: relative;
}

.schedule-item-block {
  margin-top: 10px;
}

.schedule-item-group {
  position: relative;
}

.schedule-item-group.has-conflict {
  margin-top: 10px;
  padding: 10px 7px 12px;
  overflow: hidden;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 14px;
  background: rgba(220, 38, 38, 0.05);
}

.schedule-item-group.has-conflict::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  background: rgba(220, 38, 38, 0.20);
  pointer-events: none;
}

.schedule-item-group.has-conflict .schedule-item-block:first-child {
  margin-top: 0;
}

.schedule-item-group.has-conflict .schedule-insert-line {
  z-index: 4;
}

.schedule-item-start-time {
  margin: 0 0 3px 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.schedule-item-block .schedule-card {
  margin-top: 0;
}

.schedule-day-empty {
  padding: 20px 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}

.schedule-insert-line {
  position: relative;
  width: calc(100% - 4px);
  height: 4px;
  margin: 10px 2px 2px;
  border-radius: 999px;
  background: var(--insert-line);
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 0 0 2px rgba(var(--panel-rgb), 0.9);
}

.schedule-insert-line::before,
.schedule-insert-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--insert-line);
  transform: translateY(-50%);
}

.schedule-insert-line::before {
  left: -2px;
}

.schedule-insert-line::after {
  right: -2px;
}

.schedule-card {
  position: relative;
  padding: 10px 12px;
  border-radius: 14px;
  border-left: 5px solid transparent;
  background: var(--panel);
  margin-top: 8px;
  cursor: pointer;
  box-shadow: var(--schedule-shadow);
}

.schedule-conflict-label {
  position: absolute;
  top: 7px;
  right: 9px;
  z-index: 4;
  padding: 2px 7px;
  border: 1px solid rgba(185, 28, 28, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--danger);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.4;
  white-space: nowrap;
}

.schedule-card[draggable="true"] {
  cursor: grab;
  touch-action: none;
}

.schedule-card[draggable="true"]:active {
  cursor: grabbing;
}

.schedule-card.is-dragging {
  opacity: 0.48;
  outline: 2px solid var(--insert-line);
}

.summary-task.is-dragging,
.ddl-card.is-dragging {
  opacity: 0.48;
  outline: 2px solid var(--insert-line);
}

body.is-schedule-touch-dragging,
body.is-schedule-touch-dragging * {
  user-select: none;
}

.schedule-drag-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2600;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid transparent;
  background: var(--panel);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22), 0 0 0 2px var(--insert-line);
  opacity: 0.98;
  pointer-events: none;
  touch-action: none;
  will-change: transform;
}

.schedule-drag-preview.priority-high {
  border-left-color: var(--danger);
  background: var(--task-high-bg);
}

.schedule-drag-preview.priority-medium {
  border-left-color: var(--warning);
  background: var(--task-medium-bg);
}

.schedule-drag-preview.priority-low {
  border-left-color: var(--success);
  background: var(--task-low-bg);
}

.schedule-drag-preview.completed {
  filter: grayscale(0.4);
}

.schedule-drag-preview .task-note-preview {
  -webkit-line-clamp: 2;
}

.schedule-card.priority-high { border-left-color: var(--danger); background: var(--task-high-bg); }
.schedule-card.priority-medium { border-left-color: var(--warning); background: var(--task-medium-bg); }
.schedule-card.priority-low { border-left-color: var(--success); background: var(--task-low-bg); }

.schedule-card.has-conflict {
  border: 2px solid rgba(220, 38, 38, 0.82);
  border-left-width: 5px;
  background: var(--panel);
  box-shadow: var(--schedule-shadow);
}

.schedule-card.completed {
  filter: grayscale(0.85);
  opacity: 0.62;
  background: var(--task-completed-bg);
}

.schedule-check {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
}

.slot-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slot-editor-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.slot-week-tabs {
  margin-bottom: -4px;
}

.slot-editor-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slot-editor-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 140px 140px auto;
  gap: 10px;
  align-items: center;
}

.ddl-dock {
  background: rgba(var(--panel-rgb), 0.94);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.ddl-dock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.ddl-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.ddl-card {
  flex: 0 0 220px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 9px 11px;
  cursor: grab;
  touch-action: none;
  border-left: 5px solid transparent;
}

.ddl-card .task-title {
  line-height: 1.25;
}

.ddl-card-meta {
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
}

.ddl-card-meta > span {
  min-width: 0;
}

.ddl-card-subject {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ddl-card.priority-high { border-left-color: var(--danger); }
.ddl-card.priority-medium { border-left-color: var(--warning); }
.ddl-card.priority-low { border-left-color: var(--success); }

.guide-layer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: auto;
}

.guide-layer.is-target-clickable {
  pointer-events: none;
}

.guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
}

.guide-layer.is-target-clickable .guide-backdrop {
  pointer-events: none;
}

.guide-highlight {
  position: fixed;
  z-index: 3001;
  border: 2px solid var(--brand-strong);
  border-radius: 18px;
  box-shadow:
    0 0 0 9999px rgba(15, 23, 42, 0.48),
    0 0 0 6px rgba(37, 99, 235, 0.16),
    0 16px 36px rgba(15, 23, 42, 0.24);
  pointer-events: none;
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease;
}

.guide-popover {
  position: fixed;
  z-index: 3002;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 18px;
  pointer-events: auto;
}

.guide-kicker {
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.guide-popover h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.1rem;
  line-height: 1.35;
}

.guide-popover p {
  margin: 10px 0 14px;
  color: var(--note);
  font-size: 0.92rem;
  line-height: 1.65;
}

.ai-assistant {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 35;
}

.managebac-dialog .el-dialog__body {
  padding-top: 8px;
}

.managebac-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 30px;
  color: var(--text-strong);
  font-weight: 800;
}

.managebac-dialog-title {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.managebac-help-button {
  flex: 0 0 auto;
}

.managebac-sync {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.managebac-method-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.managebac-method-label {
  flex: 0 0 auto;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

.managebac-method-select {
  width: min(260px, 100%);
}

.managebac-status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.managebac-status-label {
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 800;
}

.managebac-status-message {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.managebac-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.managebac-login-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-line);
  border-radius: 8px;
  background: linear-gradient(90deg, var(--brand-soft), var(--panel) 120px);
}

.managebac-login-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
}

.managebac-credential-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.managebac-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
}

.managebac-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.managebac-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.managebac-preview-list {
  display: flex;
  flex-direction: column;
  max-height: min(54vh, 520px);
  overflow: auto;
}

.managebac-preview-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.managebac-preview-row:last-child {
  border-bottom: 0;
}

.managebac-preview-row.is-duplicate {
  opacity: 0.66;
}

.managebac-preview-fields {
  min-width: 0;
}

.managebac-preview-main {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) minmax(180px, 220px);
  gap: 10px;
}

.managebac-subject-select,
.managebac-due-picker {
  width: 100%;
}

.managebac-preview-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.managebac-empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.ai-fab {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background: var(--brand-strong);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
  cursor: pointer;
}

.ai-fab:hover,
.ai-fab.is-open {
  background: var(--brand);
}

.ai-fab:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ai-chat-panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  width: min(420px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.2);
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.ai-chat-heading {
  min-width: 0;
}

.ai-chat-title {
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 800;
}

.ai-chat-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.ai-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ai-help-button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-muted);
  color: var(--brand);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.ai-help-button:hover {
  border-color: var(--brand-line);
  background: var(--brand-soft);
}

.ai-help-content {
  color: var(--text);
}

.ai-help-title {
  margin-bottom: 8px;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 800;
}

.ai-help-section {
  display: grid;
  gap: 3px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.ai-help-section-title {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 800;
}

.ai-help-section p {
  margin: 0;
  color: var(--note);
  font-size: 12px;
  line-height: 1.45;
}

.ai-chat-body {
  flex: 1;
  min-height: 0;
  padding: 14px 16px;
  overflow-y: auto;
  background: var(--panel-muted);
}

.ai-chat-empty {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.ai-empty-example {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.ai-empty-example span {
  color: var(--brand);
  font-weight: 800;
}

.ai-chat-message {
  display: flex;
  margin-bottom: 10px;
}

.ai-chat-message.is-user {
  justify-content: flex-end;
}

.ai-chat-message.is-assistant {
  justify-content: flex-start;
}

.ai-chat-bubble {
  max-width: 86%;
  padding: 9px 11px;
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
  font-size: 14px;
}

.ai-chat-message.is-user .ai-chat-bubble {
  background: var(--brand-strong);
  color: #fff;
}

.ai-chat-message.is-assistant .ai-chat-bubble {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.ai-chat-message.is-approval-result {
  justify-content: center;
  margin: 6px 0 12px;
}

.ai-chat-message.is-approval-result .ai-chat-bubble {
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  font-size: 12px;
  line-height: 1.35;
}

.ai-chat-footer {
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.ai-chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

.ai-chat-shortcut {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ai-approval {
  display: grid;
  gap: 14px;
}

.ai-approval-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-approval-card-list {
  display: grid;
  gap: 8px;
  max-height: min(68vh, 700px);
  overflow-y: auto;
  padding-right: 4px;
}

.ai-approval-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-line);
  border-radius: 8px;
  background: var(--panel);
}

.ai-approval-card.status-executed {
  border-left-color: var(--success);
  background: rgba(34, 197, 94, 0.06);
}

.ai-approval-card.status-canceled {
  border-left-color: var(--warning);
  background: rgba(245, 158, 11, 0.06);
}

.ai-approval-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ai-approval-card-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.ai-approval-card h3 {
  margin: 5px 0 0;
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ai-approval-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.ai-approval-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
}

.ai-approval-form .el-form-item__label {
  margin-bottom: 3px;
  padding: 0;
  font-size: 12px;
  line-height: 1.2;
}

.ai-approval-form .el-form-item {
  margin-bottom: 6px;
}

.ai-approval-form .el-form-item:last-child {
  grid-column: 1 / -1;
}

.ai-field-before {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ai-edited-field .el-input__wrapper,
.ai-edited-field .el-textarea__inner,
.ai-edited-field .el-select__wrapper {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(239, 68, 68, 0.06);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.32) inset;
}

.ai-edited-field .el-input__inner,
.ai-edited-field .el-textarea__inner {
  color: var(--danger);
}

.ai-approval-result-line {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--panel-muted);
  color: var(--note);
  font-size: 11px;
}

.ai-approval-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.ai-approval-card-actions .el-button {
  min-height: 30px;
  padding: 6px 10px;
}

.ai-action-list {
  max-height: 180px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ai-action-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.ai-action-list li:last-child {
  border-bottom: 0;
}

.ai-action-list li.active {
  background: var(--panel-muted);
  color: var(--text);
  font-weight: 700;
}

.ai-current-action {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-muted);
}

.ai-current-action-header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-field-preview {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.ai-field-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.ai-field-label {
  color: var(--muted);
  font-size: 13px;
}

.ai-field-value,
.ai-field-change {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-field-change {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.guide-progress {
  display: grid;
  grid-template-columns: repeat(var(--guide-step-count), minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
}

.guide-progress span {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

.guide-progress span.active,
.guide-progress span.done {
  background: var(--brand-strong);
}

.guide-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.guide-actions > div {
  display: flex;
  gap: 8px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  gap: 18px;
  padding: 20px;
}

.admin-sidebar,
.admin-panel {
  background: rgba(var(--panel-rgb), 0.94);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.admin-sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  min-height: calc(100vh - 40px);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-nav-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 11px 12px;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}

.admin-nav-button.active {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand);
}

.admin-sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-language-control {
  justify-content: space-between;
}

.admin-main,
.admin-timeline {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-panel {
  border-radius: 22px;
  padding: 18px;
}

.admin-panel-header,
.admin-timeline-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-panel h2,
.admin-timeline-toolbar h2 {
  margin: 0;
  font-size: 1.2rem;
}

.admin-panel p,
.admin-timeline-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-selector-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.admin-timeline-toolbar .admin-selector-row {
  margin: 0;
}

.traffic-filter-row {
  margin-top: 14px;
}

.admin-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.admin-user-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.admin-name-editor,
.admin-name-display {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-name-editor .el-input {
  max-width: 180px;
}

.admin-name-display span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-pagination {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.traffic-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.traffic-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(var(--panel-rgb), 0.7);
  padding: 14px;
  min-width: 0;
}

.traffic-metric-label,
.traffic-muted {
  color: var(--muted);
  font-size: 0.86rem;
}

.traffic-metric-value {
  margin-top: 8px;
  color: var(--text);
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
}

.compact-metrics {
  gap: 10px;
  margin: 12px 0;
}

.compact-metrics .traffic-metric {
  padding: 10px 12px;
}

.compact-metrics .traffic-metric-value {
  margin-top: 6px;
  font-size: 1.35rem;
}

.traffic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 14px;
  margin-bottom: 16px;
}

.traffic-chart-panel,
.traffic-top-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-width: 0;
}

.traffic-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 900;
}

.traffic-chart-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.traffic-chart-actions > span,
.traffic-section-title > span:last-child {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.traffic-view-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.traffic-view-switch button {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  padding: 7px 10px;
  min-width: 54px;
}

.traffic-view-switch button:last-child {
  border-right: 0;
}

.traffic-view-switch button.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.traffic-chart {
  position: relative;
  min-height: 220px;
}

.traffic-chart svg {
  display: block;
  width: 100%;
  height: 190px;
  border-radius: 8px;
  background:
    linear-gradient(to top, var(--brand-soft), transparent),
    repeating-linear-gradient(to bottom, transparent, transparent 37px, var(--line) 38px);
}

.compact-analytics-grid {
  gap: 12px;
  margin-bottom: 12px;
}

.compact-analytics-grid .traffic-chart-panel,
.compact-analytics-grid .traffic-top-panel {
  padding: 12px;
}

.compact-analytics-grid .traffic-chart {
  min-height: 172px;
}

.compact-analytics-grid .traffic-chart svg {
  height: 140px;
}

.traffic-chart-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.traffic-chart-dot {
  fill: var(--brand);
  stroke: var(--panel);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.traffic-chart-hit {
  fill: transparent;
  cursor: pointer;
}

.traffic-chart svg g:hover .traffic-chart-dot {
  stroke-width: 1.2;
}

.ai-usage-input-line {
  stroke: var(--brand);
}

.ai-usage-output-line {
  stroke: #f97316;
}

.ai-usage-input-dot {
  fill: var(--brand);
}

.ai-usage-output-dot {
  fill: #f97316;
}

.installer-download-line {
  stroke: #10b981;
}

.installer-download-dot {
  fill: #10b981;
}

.traffic-chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 128px;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  padding: 9px 10px;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  font-size: 0.84rem;
  line-height: 1.45;
}

.traffic-tooltip-time {
  margin-bottom: 4px;
  font-weight: 900;
}

.traffic-chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.traffic-chart-labels span {
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.ai-usage-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.ai-usage-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-usage-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.ai-usage-legend-input {
  background: var(--brand);
}

.ai-usage-legend-output {
  background: #f97316;
}

.ai-limit-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-limit-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ai-limit-form label {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.ai-limit-form .el-input-number {
  width: 100%;
}

.ai-limit-actions,
.ai-user-limit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-user-limit-editor {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ai-user-limit-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 8px;
  min-width: 0;
}

.ai-user-limit-fields .el-input-number {
  width: 100%;
}

.installer-download-limit-fields {
  grid-template-columns: repeat(2, minmax(96px, 1fr));
}

.traffic-ip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.traffic-ip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.traffic-ip-row:last-child {
  border-bottom: 0;
}

.traffic-ip {
  color: var(--text);
  font-weight: 800;
  word-break: break-all;
}

.admin-readonly-board {
  padding: 0;
  min-height: 0;
  grid-template-columns: 300px minmax(0, 1fr);
}

.admin-readonly-board .summary-panel {
  top: 20px;
}

.admin-readonly-board .summary-task,
.admin-readonly-board .task-card,
.admin-readonly-board .schedule-card,
.admin-readonly-board .ddl-card {
  cursor: default;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .timeline-header {
    padding-inline: 16px;
  }

  .timeline-header-actions {
    gap: 8px;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-shell,
  .admin-readonly-board {
    grid-template-columns: 1fr;
  }

  .app-shell:not(.admin-readonly-board) > .summary-panel {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
  }

  .app-shell:not(.admin-readonly-board) > .summary-panel.is-collapsed {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 56px;
    max-height: calc(100vh - 40px);
    padding: 8px;
    overflow: hidden;
  }

  .app-shell:not(.admin-readonly-board) > .summary-panel.is-collapsed .summary-panel-content {
    display: none;
  }

  .summary-panel:not(.is-collapsed) .summary-header {
    padding-right: 36px;
  }

  .sidebar-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
  }

  .sidebar-action-button,
  .sidebar-peek-button {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text-strong);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    font-weight: 900;
    box-shadow: var(--schedule-shadow);
  }

  .sidebar-peek-button.is-expanded-control {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    min-height: 30px;
    height: 30px;
    border-radius: 9px;
    padding: 0;
    box-shadow: none;
    background: var(--panel-muted);
  }

  .sidebar-action-button {
    color: var(--brand);
  }

  .sidebar-action-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
  }

  .sidebar-action-button span {
    writing-mode: vertical-rl;
    letter-spacing: 0;
    font-size: 0.8rem;
    line-height: 1.1;
  }

  .sidebar-action-button:not(:disabled):hover,
  .sidebar-peek-button:hover {
    border-color: var(--brand-line);
    color: var(--brand);
  }

  .sidebar-peek-icon {
    font-size: 1.35rem;
    line-height: 1;
  }

  .sidebar-peek-text {
    writing-mode: vertical-rl;
    letter-spacing: 0;
    font-size: 0.8rem;
    line-height: 1.1;
  }

  .sidebar-peek-count {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
  }

  .admin-sidebar {
    position: static;
    min-height: auto;
  }

  .traffic-metrics,
  .traffic-grid {
    grid-template-columns: 1fr 1fr;
  }

  .managebac-preview-main {
    grid-template-columns: 1fr;
  }

  .admin-readonly-board .timeline-columns {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  :root {
    --column-width: 220px;
    --column-gap: 12px;
  }

  .ai-assistant {
    right: 14px;
    bottom: 14px;
  }

  .ai-chat-panel {
    right: -2px;
    bottom: 62px;
    width: calc(100vw - 28px);
    height: min(560px, calc(100vh - 96px));
  }

  .ai-field-row,
  .ai-field-change {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ai-approval-form {
    grid-template-columns: 1fr;
  }

  .ai-approval-card-header,
  .ai-approval-card-actions,
  .ai-approval-progress {
    align-items: stretch;
    flex-direction: column;
  }

  .app-shell {
    padding: 12px;
    gap: 12px;
  }

  .app-shell:not(.admin-readonly-board) {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed:not(.admin-readonly-board) {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell:not(.admin-readonly-board) > .summary-panel {
    top: 12px;
    max-height: calc(100vh - 24px);
  }

  .app-shell:not(.admin-readonly-board) > .summary-panel.is-collapsed {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 60;
    width: 48px;
    max-height: calc(100vh - 24px);
    padding: 6px;
    overflow: hidden;
  }

  .app-shell:not(.admin-readonly-board) > .summary-panel.is-collapsed .sidebar-quick-actions {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
  }

  .sidebar-action-button,
  .sidebar-peek-button {
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
  }

  .sidebar-action-button span,
  .sidebar-peek-text {
    writing-mode: vertical-rl;
    font-size: 0.8rem;
    line-height: 1.1;
  }

  .sidebar-peek-button.is-expanded-control {
    top: 8px;
    right: 8px;
    width: 28px;
    min-height: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .admin-shell {
    padding: 12px;
    gap: 12px;
  }

  .traffic-metrics,
  .traffic-grid {
    grid-template-columns: 1fr;
  }

  .traffic-chart {
    min-height: 180px;
  }

  .traffic-chart svg {
    height: 150px;
  }

  .traffic-chart-labels {
    gap: 6px;
    font-size: 0.78rem;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .traffic-section-title,
  .traffic-chart-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-user-limit-fields {
    grid-template-columns: 1fr;
  }

  .managebac-status-panel,
  .managebac-preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .managebac-actions {
    justify-content: flex-start;
  }

  .managebac-method-row {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .managebac-method-select {
    width: 100%;
  }

  .managebac-login-fields {
    grid-template-columns: 1fr;
  }

  .managebac-preview-row {
    grid-template-columns: 1fr;
  }

  .summary-panel,
  .timeline-header,
  .day-column {
    border-radius: 18px;
  }

  .timeline-header {
    top: 12px;
  }

  .timeline-header-actions {
    width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .ddl-calendar-nav {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .ddl-calendar-grid {
    --ddl-calendar-gap: 6px;
    --ddl-calendar-weekday-height: 36px;
  }

  .ddl-calendar-weekday {
    min-height: 36px;
    border-radius: 10px;
    font-size: 0.76rem;
  }

  .ddl-calendar-day {
    min-height: 0;
    border-radius: 12px;
    padding: 4px;
    gap: 3px;
  }

  .ddl-calendar-jump-button {
    display: none;
  }

  .ddl-calendar-day-number {
    width: 100%;
    height: 18px;
    font-size: 0.7rem;
  }

  .ddl-calendar-task-list {
    flex-direction: row;
    align-content: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    overflow: hidden;
  }

  .ddl-calendar-task {
    flex: 0 0 6px;
    width: 6px;
    min-height: 6px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
  }

  .ddl-calendar-task-time,
  .ddl-calendar-task-title {
    display: none;
  }

  .auth-card {
    right: 0;
  }

  .daily-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .daily-tools-actions {
    justify-content: flex-start;
  }

  .habit-form-grid {
    grid-template-columns: 1fr;
  }

  .subject-template-row,
  .subject-template-add {
    grid-template-columns: 1fr;
  }

  .guide-popover {
    max-width: calc(100vw - 24px);
    border-radius: 16px;
    padding: 16px;
  }

  .guide-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-actions > div {
    justify-content: flex-end;
  }

  .slot-editor-row {
    grid-template-columns: 1fr;
  }

}

/* Let the timeline continue underneath the left sidebar instead of leaving an empty column. */
.app-shell:not(.admin-readonly-board) {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell:not(.admin-readonly-board) > .summary-panel {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  width: 340px;
  z-index: 25;
}

.app-shell:not(.admin-readonly-board) > .summary-panel.is-collapsed {
  width: 56px;
}

.app-shell:not(.admin-readonly-board) > .timeline-area {
  grid-column: 1;
  grid-row: 1;
  min-height: calc(100dvh - 40px);
}

.app-shell:not(.admin-readonly-board) > .timeline-area.is-calendar-page {
  min-height: calc(100dvh - 40px);
}

.app-shell:not(.admin-readonly-board) .ddl-view,
.app-shell:not(.admin-readonly-board) .daily-board {
  flex: 1 0 auto;
}

.app-shell:not(.admin-readonly-board) .ddl-view > .timeline-scroll-frame,
.app-shell:not(.admin-readonly-board) .daily-board > .timeline-scroll-frame {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}

.app-shell:not(.admin-readonly-board) .ddl-view .timeline-scroll,
.app-shell:not(.admin-readonly-board) .daily-board .timeline-scroll {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}

.app-shell:not(.admin-readonly-board) .ddl-view .timeline-columns,
.app-shell:not(.admin-readonly-board) .daily-board .timeline-columns {
  flex: 1 0 auto;
  min-height: 0;
}

.app-shell:not(.admin-readonly-board):not(.sidebar-collapsed) .timeline-header,
.app-shell:not(.admin-readonly-board):not(.sidebar-collapsed) .daily-tools,
.app-shell:not(.admin-readonly-board):not(.sidebar-collapsed) .schedule-conflict-summary {
  margin-left: 360px;
}

.app-shell.sidebar-collapsed:not(.admin-readonly-board) .timeline-header,
.app-shell.sidebar-collapsed:not(.admin-readonly-board) .daily-tools,
.app-shell.sidebar-collapsed:not(.admin-readonly-board) .schedule-conflict-summary {
  margin-left: 72px;
}

.app-shell:not(.admin-readonly-board) .ddl-calendar-page {
  width: calc(100% - 360px);
  margin-left: 360px;
}

.app-shell.sidebar-collapsed:not(.admin-readonly-board) .ddl-calendar-page {
  margin-inline: auto;
}

@media (max-width: 720px) {
  .timeline-header-actions .language-control {
    margin-left: 0;
  }

  .timeline-header > .account-menu .auth-card {
    right: -24px;
  }

  .app-shell:not(.admin-readonly-board) > .timeline-area {
    min-height: calc(100dvh - 24px);
  }

  .app-shell:not(.admin-readonly-board) > .timeline-area.is-calendar-page {
    min-height: calc(100dvh - 24px);
  }

  .app-shell:not(.admin-readonly-board) > .summary-panel {
    width: 320px;
  }

  .app-shell:not(.admin-readonly-board) > .summary-panel.is-collapsed {
    width: 48px;
  }

  .app-shell:not(.admin-readonly-board):not(.sidebar-collapsed) .timeline-header,
  .app-shell:not(.admin-readonly-board):not(.sidebar-collapsed) .daily-tools,
  .app-shell:not(.admin-readonly-board):not(.sidebar-collapsed) .schedule-conflict-summary {
    margin-left: 0;
  }

  .app-shell.sidebar-collapsed:not(.admin-readonly-board) .timeline-header,
  .app-shell.sidebar-collapsed:not(.admin-readonly-board) .daily-tools,
  .app-shell.sidebar-collapsed:not(.admin-readonly-board) .schedule-conflict-summary {
    margin-left: 58px;
  }

  .app-shell:not(.admin-readonly-board) .ddl-calendar-page {
    width: 100%;
    margin-inline: 0;
  }

  .app-shell:not(.admin-readonly-board) .timeline-header-actions {
    flex-wrap: nowrap;
  }

  .app-shell:not(.admin-readonly-board) .feedback-quick-action {
    justify-content: flex-start;
  }
}
.turnstile-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(23, 32, 51, 0.72);
}
.turnstile-dialog {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(100%, 380px);
  padding: 24px;
  border-radius: 12px;
  background: #fff;
  color: #172033;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}
.turnstile-dialog p { margin: 0; text-align: center; }
.turnstile-cancel { cursor: pointer; }
