/* HYDRA Tools — Project Hub (layout only; tokens from tools.css / tools-hit.css) */

#hydraToolsShell .ph-tool {
  width: 100%;
  max-width: 1320px;
}

#hydraToolsShell .ph-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 12px 14px 0;
  align-items: center;
}

#hydraToolsShell .ph-toolbar__sync {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 0;
}

#hydraToolsShell .ph-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(249, 115, 22, 0.22);
  border-radius: 10px;
  background: #fff;
  color: #c2410c;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

#hydraToolsShell .ph-refresh-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#hydraToolsShell .ph-refresh-btn__icon {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

#hydraToolsShell .ph-refresh-btn.is-spinning .ph-refresh-btn__icon {
  animation: ph-refresh-spin 0.75s linear infinite;
}

@keyframes ph-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

#hydraToolsShell .ph-refresh-meta {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  min-width: 0;
}

#hydraToolsShell .ph-refresh-meta--error {
  color: #b91c1c;
}

#hydraToolsShell .ph-detail__sync {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 0;
}

#hydraToolsShell .ph-refresh-btn--detail {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

#hydraToolsShell .ph-refresh-btn--detail .ph-refresh-btn__icon {
  font-size: 14px;
}

#hydraToolsShell .ph-refresh-meta--detail {
  display: block;
  max-width: 100%;
  font-size: 10px;
  line-height: 1.2;
}

#hydraToolsShell .ph-toolbar[hidden] {
  display: none !important;
}

#hydraToolsShell .ph-main {
  padding: 12px 14px 20px;
  min-width: 0;
}

#hydraToolsShell .ph-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

#hydraToolsShell .ph-list-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
}

#hydraToolsShell button.ph-list-item {
  appearance: none;
  cursor: pointer;
}

#hydraToolsShell .ph-list-item--row {
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}

#hydraToolsShell .ph-list-item__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
}

#hydraToolsShell .ph-list-item__title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

#hydraToolsShell .ph-list-item__title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#hydraToolsShell .ph-entity-code {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #475569;
  background: #f1f5f9;
  border-radius: 5px;
  padding: 1px 5px;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

#hydraToolsShell .ph-list-item__meta {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hydraToolsShell .ph-cal-cell--deadline {
  border-color: rgba(29, 78, 216, 0.28);
}

#hydraToolsShell .ph-cal-cell--deadline:not(.ph-cal-cell--has) {
  background: linear-gradient(180deg, #fff 0%, #eff6ff 100%);
}

#hydraToolsShell .ph-cal-cell--deadline.ph-cal-cell--has {
  border-color: rgba(234, 88, 12, 0.35);
}

#hydraToolsShell .ph-cal-cell__dl {
  font-size: 7px;
  font-weight: 900;
  color: #1d4ed8;
  line-height: 1;
  letter-spacing: 0.02em;
}

#hydraToolsShell .ph-cal-cell__dl-dot {
  position: absolute;
  bottom: 3px;
  left: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1d4ed8;
}

#hydraToolsShell .ph-due {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.2;
}

#hydraToolsShell .ph-due--overdue {
  background: #fef2f2;
  color: #b91c1c;
}

#hydraToolsShell .ph-due--today {
  background: #fff7ed;
  color: #c2410c;
}

#hydraToolsShell .ph-due--soon {
  background: #fefce8;
  color: #a16207;
}

#hydraToolsShell .ph-due--later {
  background: #f1f5f9;
  color: #475569;
}

#hydraToolsShell .ph-overview-deadlines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

#hydraToolsShell .ph-due-block__title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#hydraToolsShell .ph-due-block--today .ph-due-block__title {
  color: #c2410c;
}

#hydraToolsShell .ph-due-block__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

#hydraToolsShell .ph-due-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#hydraToolsShell .ph-due-row__date {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

#hydraToolsShell .ph-due-row__title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#hydraToolsShell .ph-timeline-sheet-kind--deadline strong {
  color: #1d4ed8;
}

#hydraToolsShell .ph-list-item__sub {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hydraToolsShell .ph-list-item--task .ph-list-item__chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}

#hydraToolsShell .ph-list-item--task .ph-list-item__secondary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

@media (max-width: 768px) {
  #hydraToolsShell .ph-list-item--task.ph-list-item--row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  #hydraToolsShell .ph-list-item--task .ph-list-item__main {
    flex: 1 1 auto;
    width: 100%;
  }

  #hydraToolsShell .ph-list-item--task .ph-list-item__title {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.3;
  }

  #hydraToolsShell .ph-list-item--task .ph-list-item__title-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
  }

  #hydraToolsShell .ph-list-item--task .ph-list-item__secondary {
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
  }

  #hydraToolsShell .ph-list-item--task .ph-list-item__secondary .ph-list-item__meta {
    flex: 0 0 auto;
  }

  #hydraToolsShell .ph-list-item--task .ph-list-item__secondary .ph-list-item__sub {
    flex: 1 1 auto;
    min-width: 0;
  }

  #hydraToolsShell .ph-list-item--task .ph-list-item__chips {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 1px;
  }

  #hydraToolsShell .ph-list-item--task .ph-list-item__chips::-webkit-scrollbar {
    display: none;
  }

  #hydraToolsShell .ph-list-item--task .ph-badge--btn,
  #hydraToolsShell .ph-list-item--task .ph-pri--btn,
  #hydraToolsShell .ph-list-item--task .ph-pin-btn,
  #hydraToolsShell .ph-list-item--task .ph-row-menu-btn {
    min-height: 34px;
    flex-shrink: 0;
  }

  #hydraToolsShell .ph-list-item--task .ph-row-menu-btn {
    width: 34px;
    height: 34px;
    margin-left: auto;
  }

  #hydraToolsShell .ph-list-item--task .ph-due,
  #hydraToolsShell .ph-list-item--task .ph-ref-badges {
    flex-shrink: 0;
  }
}

/* Shared Project Hub editor modals (task / note / prompt). Note is reference. */
#hydraToolsShell .ph-editor-modal,
#hydraToolsShell .ph-note-editor-modal {
  width: min(760px, calc(100vw - 32px));
  max-width: min(760px, calc(100vw - 32px));
  height: min(92dvh, 860px);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px);
}

#hydraToolsShell .ph-editor-body,
#hydraToolsShell .ph-note-editor-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  gap: 0;
}

#hydraToolsShell .ph-editor__title-field,
#hydraToolsShell .ph-note-editor__title-field,
#hydraToolsShell .ph-editor__meta,
#hydraToolsShell .ph-editor-body > .ph-attach,
#hydraToolsShell .ph-note-editor-body > .ph-attach,
#hydraToolsShell .ph-editor-body > .ph-modal-danger,
#hydraToolsShell .ph-note-editor-body > .ph-modal-danger,
#hydraToolsShell .ph-editor-body > .pw-field--checkbox,
#hydraToolsShell .ph-note-autosave,
#hydraToolsShell .ph-editor-body > .ph-cursor-panel {
  flex: 0 0 auto;
}

#hydraToolsShell .ph-editor__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 10px;
}

#hydraToolsShell .ph-editor__meta .pw-field {
  margin-bottom: 0;
}

#hydraToolsShell .ph-editor__meta-due {
  grid-column: 1 / -1;
}

#hydraToolsShell .ph-editor__grow-field,
#hydraToolsShell .ph-note-editor__content-field {
  display: flex;
  flex-direction: column;
  flex: 1 1 320px;
  min-height: clamp(220px, 35dvh, 480px);
  margin-bottom: 6px;
}

#hydraToolsShell .pw-modal--form.ph-editor-modal .pw-field textarea.ph-editor__grow-textarea,
#hydraToolsShell .pw-modal--form.ph-note-editor-modal .pw-field textarea.ph-note-editor__textarea,
#hydraToolsShell .pw-modal--form.ph-editor-modal .pw-field textarea.ph-note-editor__textarea {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  resize: none;
}

/* Task short note: taller than old input, not full-bleed like note/prompt. */
#hydraToolsShell .ph-editor__short-field {
  display: flex;
  flex-direction: column;
  flex: 1 1 140px;
  min-height: 140px;
  max-height: min(280px, 42dvh);
  margin-bottom: 8px;
}

#hydraToolsShell .pw-modal--form.ph-editor-modal .pw-field textarea.ph-editor__short-textarea {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 140px;
  max-height: none;
  resize: vertical;
}

#hydraToolsShell .ph-note-autosave {
  display: flex;
  align-items: center;
  min-height: 22px;
  gap: 8px;
  margin: 0 0 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.3;
}

#hydraToolsShell .ph-note-autosave__text[data-state="saving"] {
  color: #2563eb;
}

#hydraToolsShell .ph-note-autosave__text[data-state="saved"] {
  color: #15803d;
}

#hydraToolsShell .ph-note-autosave__text[data-state="error"] {
  color: #b91c1c;
  font-weight: 700;
}

#hydraToolsShell .ph-note-autosave__retry {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(185, 28, 28, 0.22);
  border-radius: 8px;
  background: #fff;
  color: #b91c1c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#hydraToolsShell .ph-editor-body > .pw-field--checkbox,
#hydraToolsShell .ph-editor-body > .ph-modal-danger,
#hydraToolsShell .ph-note-editor-body > .ph-modal-danger {
  margin-top: 12px;
}

#hydraToolsShell .ph-editor-body > .ph-attach,
#hydraToolsShell .ph-note-editor-body > .ph-attach {
  margin-top: 8px;
}

#hydraToolsShell .ph-modal-danger {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(15, 23, 42, 0.1);
}

#hydraToolsShell .ph-modal-danger .pw-btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 700px) {
  #hydraToolsShell .ph-editor-modal,
  #hydraToolsShell .ph-note-editor-modal {
    width: 100%;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
  }

  #hydraToolsShell .ph-editor-body,
  #hydraToolsShell .ph-note-editor-body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  #hydraToolsShell .ph-editor__grow-field,
  #hydraToolsShell .ph-note-editor__content-field {
    flex-basis: 40dvh;
    min-height: calc(35dvh + 24px);
  }

  #hydraToolsShell .pw-modal--form.ph-editor-modal .pw-field textarea.ph-editor__grow-textarea,
  #hydraToolsShell .pw-modal--form.ph-note-editor-modal .pw-field textarea.ph-note-editor__textarea,
  #hydraToolsShell .pw-modal--form.ph-editor-modal .pw-field textarea.ph-note-editor__textarea {
    height: 100%;
    min-height: 100%;
    max-height: none;
    padding: 10px 12px;
    font-size: 16px;
    line-height: 1.45;
  }

  #hydraToolsShell .ph-editor__short-field {
    flex-basis: 120px;
    min-height: 120px;
    max-height: min(220px, 36dvh);
  }

  #hydraToolsShell .pw-modal--form.ph-editor-modal .pw-field textarea.ph-editor__short-textarea {
    min-height: 120px;
    padding: 10px 12px;
    font-size: 16px;
    line-height: 1.45;
  }

  #hydraToolsShell .ph-editor__meta {
    gap: 8px 10px;
  }

  #hydraToolsShell .ph-editor-body > .ph-attach,
  #hydraToolsShell .ph-note-editor-body > .ph-attach {
    margin-top: 6px;
  }

  #hydraToolsShell .ph-editor-body > .ph-modal-danger,
  #hydraToolsShell .ph-note-editor-body > .ph-modal-danger {
    margin-top: 10px;
    padding-top: 8px;
  }
}

#hydraToolsShell .ph-row-actions {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
}

#hydraToolsShell .ph-row-actions .pw-btn--ghost {
  min-height: 32px;
  padding: 0 8px;
  font-size: 11px;
}

#hydraToolsShell .ph-row-actions__danger {
  color: #b91c1c;
}

#hydraToolsShell .ph-detail__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
  min-width: 0;
}

#hydraToolsShell .ph-detail__head-top {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

#hydraToolsShell .ph-detail__title-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#hydraToolsShell .ph-detail__head-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

#hydraToolsShell .ph-back-btn {
  grid-column: auto;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(249, 115, 22, 0.22);
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  color: #c2410c;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

#hydraToolsShell .ph-detail__title {
  margin: 0;
  min-width: 0;
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hydraToolsShell .ph-detail__new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  min-width: 0;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#hydraToolsShell .ph-detail__context-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  min-width: 0;
  min-height: 30px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #64748b;
}

#hydraToolsShell .ph-detail__new-btn .ph-badge__chev {
  font-size: 9px;
  opacity: 0.85;
  line-height: 1;
}

#hydraToolsShell .ph-detail__context-full {
  display: inline;
}

#hydraToolsShell .ph-detail__context-short {
  display: none;
}

#hydraToolsShell .ph-detail__nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 6px;
  min-width: 0;
}

#hydraToolsShell .ph-detail__nav .ph-tab-scroll {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#hydraToolsShell .ph-detail__nav .ht-snap-tab {
  flex: 0 0 auto;
  flex-shrink: 0;
  white-space: nowrap;
}

#hydraToolsShell .ph-task-filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  padding: 0 1px;
  width: 100%;
}

#hydraToolsShell .ph-filter-seg-scroll {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#hydraToolsShell .ph-filter-seg-scroll::-webkit-scrollbar {
  display: none;
}

#hydraToolsShell .ph-filter-seg {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#hydraToolsShell .ph-filter-seg.is-active {
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.35);
  color: #c2410c;
  box-shadow: 0 1px 4px rgba(249, 115, 22, 0.1);
}

#hydraToolsShell .ph-filter-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  max-width: max-content;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(234, 88, 12, 0.28);
  background: #fff7ed;
  color: #c2410c;
  font-size: 11px;
  font-weight: 800;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#hydraToolsShell .ph-filter-chip__label {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

#hydraToolsShell .ph-filter-chip .ph-badge__chev {
  flex: 0 0 auto;
  font-size: 9px;
  opacity: 0.7;
  line-height: 1;
}

#hydraToolsShell .ph-tab-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 12px;
  padding-bottom: 2px;
}

#hydraToolsShell .ph-tab-scroll::-webkit-scrollbar {
  display: none;
}

#hydraToolsShell .ph-panel {
  min-width: 0;
}

#hydraToolsShell .ph-panel__toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 10px;
}

#hydraToolsShell .ph-panel__actions {
  margin-top: 12px;
}

#hydraToolsShell .ph-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

#hydraToolsShell .ph-badge--idea {
  background: #f1f5f9;
  color: #475569;
}

#hydraToolsShell .ph-badge--doing {
  background: #fff7ed;
  color: #c2410c;
}

#hydraToolsShell .ph-badge--testing {
  background: #fef3c7;
  color: #b45309;
}

#hydraToolsShell .ph-badge--done {
  background: #dcfce7;
  color: #15803d;
}

#hydraToolsShell .ph-badge--error {
  background: #fef2f2;
  color: #b91c1c;
}

#hydraToolsShell .ph-cursor-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.2);
}

#hydraToolsShell .ph-cursor-panel {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(29, 78, 216, 0.18);
  border-radius: 10px;
  background: #f8fafc;
}

#hydraToolsShell .ph-cursor-panel__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #1d4ed8;
}

#hydraToolsShell .ph-cursor-panel__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

#hydraToolsShell .ph-cursor-panel__row {
  margin: 0 0 8px;
  font-size: 12px;
}

#hydraToolsShell .ph-cursor-panel__block {
  margin-bottom: 10px;
  min-width: 0;
}

#hydraToolsShell .ph-cursor-panel__pre {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow: auto;
}

#hydraToolsShell .ph-cursor-panel__pre--prompt {
  max-height: 200px;
}

#hydraToolsShell .ph-cursor-panel__files {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.4;
}

#hydraToolsShell .ph-cursor-panel__log {
  margin: 0;
  padding-left: 18px;
  font-size: 11px;
  line-height: 1.4;
  max-height: 140px;
  overflow: auto;
}

#hydraToolsShell .ph-cursor-panel__log-meta {
  color: #64748b;
  font-weight: 600;
}

#hydraToolsShell .ph-cursor-panel__code {
  font-size: 11px;
  word-break: break-all;
}

#hydraToolsShell .ph-cursor-panel__empty {
  margin: 0;
  font-size: 12px;
}

#hydraToolsShell .ph-row-menu-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

#hydraToolsShell .ph-empty {
  margin: 8px 0;
  font-size: 14px;
}

#hydraToolsShell .ph-list-item--project {
  gap: 3px;
}

#hydraToolsShell .ph-capture-host {
  position: relative;
  z-index: 9035;
}

#hydraToolsShell .ph-capture-sheet {
  max-height: 88vh;
  overflow-y: auto;
}

#hydraToolsShell .ph-capture-sheet__sub {
  margin: -6px 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

#hydraToolsShell .ph-capture-form .pw-field {
  margin-bottom: 10px;
}

#hydraToolsShell .ph-capture-form .pw-field textarea.pw-field__input {
  min-height: 72px;
  height: auto;
  padding: 8px 12px;
}

#hydraToolsShell .ph-capture-form__actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

@media (max-width: 390px) {
  #hydraToolsShell .ph-capture-sheet {
    padding-left: 12px;
    padding-right: 12px;
  }

  #hydraToolsShell .ph-capture-form__actions .pw-btn {
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }
}

#hydraToolsShell .ph-project-card {
  position: relative;
  padding: 0;
  gap: 0;
}

#hydraToolsShell .ph-project-card__main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 12px 38px 12px 14px;
  border: none;
  border-radius: inherit;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#hydraToolsShell .ph-project-card__main:active {
  opacity: 0.92;
}

#hydraToolsShell .ph-project-card__tl {
  position: absolute;
  top: 10px;
  right: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

#hydraToolsShell .ph-project-card__tl:hover,
#hydraToolsShell .ph-project-card__tl:active {
  border-color: rgba(234, 88, 12, 0.28);
  color: #c2410c;
  background: #fffaf5;
}

#hydraToolsShell .ph-project-card__tl-label {
  letter-spacing: 0.02em;
}

#hydraToolsShell .ph-project-card__tl-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ea580c;
  pointer-events: none;
}

#hydraToolsShell .ph-projects {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

#hydraToolsShell .ph-list-item__pct {
  font-size: 11px;
  font-weight: 800;
  color: #c2410c;
  line-height: 1.2;
}

#hydraToolsShell .ph-activity {
  margin-top: 14px;
  margin-bottom: 0;
  min-width: 0;
}

#hydraToolsShell .ph-activity--compact .ph-activity__title {
  margin: 0 0 6px;
  font-size: 11px;
}

#hydraToolsShell .ph-activity__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#hydraToolsShell .ph-activity__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#hydraToolsShell .ph-activity-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 5px 0;
  border: none;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

#hydraToolsShell .ph-activity-row:last-child {
  border-bottom: none;
}

#hydraToolsShell .ph-activity-row__main {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hydraToolsShell .ph-activity-row__time {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

#hydraToolsShell .ph-activity-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  appearance: none;
}

#hydraToolsShell .ph-activity-item__title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hydraToolsShell .ph-activity-item__meta {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

#hydraToolsShell .ph-list-item--archived {
  opacity: 0.72;
  background: #f8fafc;
}

#hydraToolsShell .ph-prog {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

#hydraToolsShell .ph-prog__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fb923c 0%, #ea580c 100%);
}

#hydraToolsShell .ph-list-item--pinned {
  border-color: rgba(234, 88, 12, 0.22);
  background: linear-gradient(180deg, #fff 0%, #fffaf5 100%);
}

#hydraToolsShell .ph-list-item--favorite {
  border-color: rgba(234, 88, 12, 0.18);
}

#hydraToolsShell .ph-pri {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.2;
}

#hydraToolsShell .ph-pri--high {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid rgba(234, 88, 12, 0.25);
}

#hydraToolsShell .ph-pri--medium {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

#hydraToolsShell .ph-pri--low {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

#hydraToolsShell .ph-pin-btn,
#hydraToolsShell .ph-fav-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
}

#hydraToolsShell .ph-pin-btn.is-active,
#hydraToolsShell .ph-fav-btn.is-active {
  border-color: rgba(234, 88, 12, 0.35);
  background: #fff7ed;
  color: #c2410c;
}

#hydraToolsShell .ph-list-item--row .ph-pin-btn,
#hydraToolsShell .ph-list-item--row .ph-fav-btn {
  min-height: 28px;
  padding: 0 6px;
}

body > #phHubMenu.ph-hub-menu,
#phHubMenu.ph-hub-menu {
  position: fixed;
  z-index: 9030;
  display: flex;
  flex-direction: column;
  width: 152px;
  min-width: 140px;
  max-width: 160px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
  gap: 2px;
  -webkit-overflow-scrolling: touch;
}

#phHubMenu.ph-hub-menu[hidden] {
  display: none !important;
}

#phHubMenu .pw-row-menu__item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

#phHubMenu .pw-row-menu__item:hover,
#phHubMenu .pw-row-menu__item:active {
  background: #f8fafc;
}

#phHubMenu .pw-row-menu__item.is-active {
  background: #fff7ed;
  color: #c2410c;
  font-weight: 800;
}

#hydraToolsShell .ph-context-modal__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

#hydraToolsShell .ph-context-modal__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

#hydraToolsShell .ph-context-preview {
  width: 100%;
  min-width: 0;
  min-height: 200px;
  max-height: min(52dvh, 440px);
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: none;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

#hydraToolsShell .ph-context-modal__actions {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
}

#hydraToolsShell .hub-modal-host {
  position: relative;
  z-index: 9000;
}

/* —— Timeline V1.4 —— */
#hydraToolsShell .ph-panel--timeline {
  min-width: 0;
}

#hydraToolsShell .ph-timeline-modes {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 8px;
  min-width: 0;
}

#hydraToolsShell .ph-timeline-modes::-webkit-scrollbar {
  display: none;
}

#hydraToolsShell .ph-timeline-modes .ht-snap-tab {
  flex: 0 0 auto;
  flex-shrink: 0;
  white-space: nowrap;
}

#hydraToolsShell .ph-timeline-body {
  min-width: 0;
}

#hydraToolsShell .ph-timeline-day {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

#hydraToolsShell .ph-timeline-day:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

#hydraToolsShell .ph-timeline-day__date {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

#hydraToolsShell .ph-timeline-kind {
  margin-bottom: 6px;
}

#hydraToolsShell .ph-timeline-kind__label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

#hydraToolsShell .ph-timeline-kind__list {
  margin: 0;
  padding: 0 0 0 14px;
  list-style: disc;
}

#hydraToolsShell .ph-timeline-item {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
}

#hydraToolsShell .ph-timeline-month__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}

#hydraToolsShell .ph-timeline-month__label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

#hydraToolsShell .ph-cal-nav {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

#hydraToolsShell .ph-cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
}

#hydraToolsShell .ph-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

#hydraToolsShell .ph-cal-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 40px;
  padding: 2px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

#hydraToolsShell .ph-cal-cell--pad {
  border: none;
  background: transparent;
  min-height: 0;
  padding: 0;
}

#hydraToolsShell .ph-timeline-item--link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #c2410c;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  -webkit-tap-highlight-color: transparent;
}

#hydraToolsShell .ph-timeline-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
}

#hydraToolsShell .ph-timeline-empty__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}

#hydraToolsShell .ph-timeline-empty__btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

#hydraToolsShell .ph-cal-cell--has {
  border-color: rgba(234, 88, 12, 0.35);
  background: linear-gradient(180deg, #fff 0%, #fff7ed 100%);
  position: relative;
}

#hydraToolsShell .ph-cal-cell__day {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

#hydraToolsShell .ph-cal-cell__badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #ea580c;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
}

#hydraToolsShell .ph-cal-cell__dot {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: #ea580c;
}

#hydraToolsShell .ph-cal-cell__cnt {
  display: none;
}

#hydraToolsShell .ph-timeline-ms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

#hydraToolsShell .ph-timeline-ms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(234, 88, 12, 0.18);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #fffaf5 100%);
  min-width: 0;
}

#hydraToolsShell .ph-timeline-ms__badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

#hydraToolsShell .ph-timeline-ms__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#hydraToolsShell .ph-timeline-ms__title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

#hydraToolsShell .ph-timeline-ms__meta {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

#hydraToolsShell .ph-field--check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
}

#hydraToolsShell .ph-field--check input {
  width: auto;
  flex: 0 0 auto;
}

#hydraToolsShell .pw-modal--form .pw-field--checkbox {
  flex-direction: row;
  align-items: center;
  margin-bottom: 10px;
}

#hydraToolsShell .pw-modal--form .pw-field--checkbox input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  max-height: 16px;
  padding: 0;
  border-radius: 4px;
}

#hydraToolsShell .pw-modal--form .pw-field--checkbox span {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

#hydraToolsShell .ph-timeline-sheet-kind {
  margin-bottom: 10px;
}

#hydraToolsShell .ph-timeline-sheet-kind ul {
  margin: 4px 0 0;
  padding-left: 16px;
}

/* —— Badge pickers (Storage pattern) —— */
#hydraToolsShell .ph-badge--btn,
#hydraToolsShell .ph-pri--btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid transparent;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}

#hydraToolsShell .ph-badge--btn:hover,
#hydraToolsShell .ph-pri--btn:hover {
  filter: brightness(0.97);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

#hydraToolsShell .ph-badge--btn:active,
#hydraToolsShell .ph-badge--btn.is-open,
#hydraToolsShell .ph-pri--btn:active,
#hydraToolsShell .ph-pri--btn.is-open {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

#hydraToolsShell .ph-badge__label {
  min-width: 0;
}

#hydraToolsShell .ph-badge__chev {
  flex: 0 0 auto;
  font-size: 9px;
  opacity: 0.65;
  line-height: 1;
}

body > #phTaskPicker.ph-task-picker,
#phTaskPicker.ph-task-picker {
  position: fixed;
  z-index: 9025;
  display: flex;
  flex-direction: column;
  min-width: 132px;
  max-width: min(220px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
  gap: 2px;
  -webkit-overflow-scrolling: touch;
}

#phTaskPicker.ph-task-picker[hidden] {
  display: none !important;
}

#phTaskPicker .st-status-picker__item,
#phTaskPicker.ph-task-picker .pw-row-menu__item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

#phTaskPicker .st-status-picker__item:hover,
#phTaskPicker .st-status-picker__item:active,
#phTaskPicker.ph-task-picker .pw-row-menu__item:hover,
#phTaskPicker.ph-task-picker .pw-row-menu__item:active {
  background: #f8fafc;
  color: #0f172a;
}

#phTaskPicker .st-status-picker__item.is-active,
#phTaskPicker.ph-task-picker .pw-row-menu__item.is-active {
  background: #fff7ed;
  color: #c2410c;
  font-weight: 800;
}

/* Hub detail head: undo tools-mobile.css width:100% on .pw-btn (≤700px) */
@media (max-width: 700px) {
  #hydraToolsShell .ph-tool,
  #hydraToolsShell .ph-detail {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  #hydraToolsShell .ph-detail__head-actions {
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  #hydraToolsShell .ph-detail__head-actions .pw-btn {
    width: auto;
    max-width: 100%;
  }

  #hydraToolsShell .ph-detail__new-btn {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #hydraToolsShell .ph-detail__context-btn {
    flex: 0 0 auto;
    flex-shrink: 0;
    overflow: visible;
    text-overflow: clip;
  }
}

@media (max-width: 390px) {
  #hydraToolsShell .ph-main {
    padding-top: 8px;
  }

  #hydraToolsShell .ph-detail__head {
    gap: 5px;
    margin-bottom: 5px;
  }

  #hydraToolsShell .ph-detail__head-top {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 5px;
  }

  #hydraToolsShell .ph-refresh-meta--detail {
    display: block;
    font-size: 9px;
  }

  #hydraToolsShell .ph-refresh-btn--detail {
    width: 26px;
    height: 26px;
  }

  #hydraToolsShell .ph-back-btn {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  #hydraToolsShell .ph-detail__title {
    font-size: 16px;
  }

  #hydraToolsShell .ph-detail__head-actions {
    gap: 5px;
  }

  #hydraToolsShell .ph-detail__new-btn {
    min-height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }

  #hydraToolsShell .ph-detail__context-btn {
    min-height: 28px;
    padding: 0 7px;
    font-size: 10px;
  }

  #hydraToolsShell .ph-detail__context-full {
    display: none;
  }

  #hydraToolsShell .ph-detail__context-short {
    display: inline;
  }

  #hydraToolsShell .ph-detail__nav {
    gap: 3px;
    margin-bottom: 5px;
  }

  #hydraToolsShell .ph-task-filter-row {
    margin-bottom: 1px;
  }

  #hydraToolsShell .ph-filter-seg {
    min-height: 26px;
    padding: 0 8px;
    font-size: 10px;
  }

  #phHubMenu .pw-row-menu__item {
    height: 34px;
    min-height: 34px;
    font-size: 13px;
    padding: 0 10px;
  }

  #hydraToolsShell .ph-project-card__main {
    padding: 10px 34px 10px 12px;
  }

  #hydraToolsShell .ph-project-card__tl {
    top: 8px;
    right: 6px;
    min-width: 26px;
    height: 24px;
    padding: 0 6px;
    font-size: 9px;
  }

  #hydraToolsShell .ph-list-item--row {
    gap: 6px;
  }

  #hydraToolsShell .ph-due {
    padding: 2px 5px;
    font-size: 9px;
  }

  #hydraToolsShell .ph-badge--btn {
    padding: 5px 7px;
    font-size: 10px;
  }

  #hydraToolsShell .ph-pri--btn {
    padding: 3px 6px;
    font-size: 9px;
  }

  #phTaskPicker.ph-task-picker {
    min-width: 124px;
  }

  #phTaskPicker .st-status-picker__item,
  #phTaskPicker.ph-task-picker .pw-row-menu__item {
    height: 34px;
    min-height: 34px;
    font-size: 13px;
    padding: 0 10px;
  }
}

@media (max-width: 430px) and (min-width: 391px) {
  #hydraToolsShell .ph-list-item--row {
    gap: 6px;
  }

  #hydraToolsShell .ph-badge--btn {
    padding: 5px 7px;
    font-size: 10px;
  }

  #hydraToolsShell .ph-pri--btn {
    padding: 3px 6px;
    font-size: 9px;
  }
}

/* --- Ảnh & tài liệu (References UX) --- */
#hydraToolsShell .ph-attach {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #f8fafc;
}

#hydraToolsShell .ph-attach--prominent {
  margin-top: 4px;
  border-color: rgba(37, 99, 235, 0.22);
  background: #f1f5f9;
}

#hydraToolsShell .ph-attach--footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(15, 23, 42, 0.1);
  border-radius: 0;
  border-left: none;
  border-right: none;
  background: transparent;
}

#hydraToolsShell .ph-attach__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

#hydraToolsShell .ph-attach__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

#hydraToolsShell .ph-attach__count {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

#hydraToolsShell .ph-attach__hint {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #475569;
}

#hydraToolsShell .ph-attach__body {
  margin-top: 0;
}

#hydraToolsShell .ph-attach__empty {
  margin: 0 0 8px;
  font-size: 13px;
}

#hydraToolsShell .ph-attach__actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  overflow: visible;
}

#hydraToolsShell .ph-attach-chip {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  margin: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#hydraToolsShell .ph-attach-chip:hover {
  background: #fff7ed;
  border-color: rgba(249, 115, 22, 0.35);
}

#hydraToolsShell .ph-attach-chip.is-pending {
  opacity: 0.55;
}

#hydraToolsShell .ph-attach__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#hydraToolsShell .ph-attach__actions {
  position: relative;
}

#hydraToolsShell .ph-refs__group,
#hydraToolsShell .ph-attach__content .ph-refs__group {
  margin-bottom: 10px;
}

#hydraToolsShell .ph-refs__group-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

#hydraToolsShell .ph-refs__images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#hydraToolsShell .ph-refs__thumb-wrap {
  position: relative;
  flex: 0 0 auto;
}

#hydraToolsShell .ph-refs__thumb {
  display: block;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}

#hydraToolsShell .ph-refs__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#hydraToolsShell .ph-refs__thumb-del,
#hydraToolsShell .ph-refs__item-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

#hydraToolsShell .ph-refs__item-del {
  position: static;
  flex: 0 0 auto;
  align-self: center;
}

#hydraToolsShell .ph-refs__links,
#hydraToolsShell .ph-refs__files {
  list-style: none;
  margin: 0;
  padding: 0;
}

#hydraToolsShell .ph-refs__link-row,
#hydraToolsShell .ph-refs__file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 6px;
}

#hydraToolsShell .ph-refs__link-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

#hydraToolsShell .ph-refs__link-kind {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

#hydraToolsShell .ph-refs__link-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#hydraToolsShell .ph-refs__file-dl {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#hydraToolsShell .ph-attach__link-form {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
}

#hydraToolsShell .pw-field--compact {
  margin-bottom: 8px;
}

#hydraToolsShell .ph-attach__link-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

#hydraToolsShell .ph-ref-badges {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  flex: 0 0 auto;
  align-items: center;
}

#hydraToolsShell .ph-ref-badges--note {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

#hydraToolsShell .ph-ref-badge {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
}

#hydraToolsShell .ph-ref-badge--img {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
}

#hydraToolsShell .ph-ref-badge--doc {
  color: #475569;
  background: rgba(100, 116, 139, 0.12);
}

#hydraToolsShell .ph-ref-badges--note .ph-ref-badge {
  font-size: 12px;
  padding: 3px 8px;
}

@media (max-width: 430px) {
  #hydraToolsShell .ph-refs__thumb {
    width: 48px;
    height: 48px;
  }

  #hydraToolsShell .ph-attach {
    padding: 10px;
  }

  #hydraToolsShell .ph-attach-chip {
    height: 32px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  #hydraToolsShell .ph-ref-badge {
    font-size: 10px;
  }

  #hydraToolsShell .ph-ref-badges--note .ph-ref-badge {
    font-size: 11px;
  }
}

/* Sprint / Epic view + Cursor metadata collapse */
#hydraToolsShell .ph-panel--tasks {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

#hydraToolsShell .ph-task-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

#hydraToolsShell .ph-task-section__title {
  margin: 0;
  padding: 0 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

#hydraToolsShell .ph-sprint-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

#hydraToolsShell .ph-sprint-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(29, 78, 216, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

#hydraToolsShell .ph-sprint-card:focus-visible {
  outline: 2px solid rgba(29, 78, 216, 0.45);
  outline-offset: 2px;
}

#hydraToolsShell .ph-sprint-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

#hydraToolsShell .ph-sprint-card__title-wrap {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

#hydraToolsShell .ph-sprint-card__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#hydraToolsShell .ph-sprint-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

#hydraToolsShell .ph-sprint-badge--sprint {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.2);
}

#hydraToolsShell .ph-sprint-badge--milestone {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid rgba(180, 83, 9, 0.2);
}

#hydraToolsShell .ph-sprint-card__title {
  margin: 0;
  width: 100%;
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  color: #0f172a;
}

#hydraToolsShell .ph-sprint-card__chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

#hydraToolsShell .ph-sprint-card__note {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#hydraToolsShell .ph-sprint-card__progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

#hydraToolsShell .ph-sprint-card__progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

#hydraToolsShell .ph-sprint-card__progress-count {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

#hydraToolsShell .ph-sprint-card__progress-pct {
  font-size: 12px;
  font-weight: 800;
  color: #1d4ed8;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

#hydraToolsShell .ph-sprint-card__bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

#hydraToolsShell .ph-sprint-card__bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
  min-width: 0;
  max-width: 100%;
}

#hydraToolsShell .ph-list-item--cursor {
  border-color: rgba(29, 78, 216, 0.1);
}

#hydraToolsShell .ph-cursor-panel--collapsible {
  margin-top: 10px;
  padding: 0;
  border: 1px solid rgba(29, 78, 216, 0.18);
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

#hydraToolsShell .ph-cursor-panel__summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  color: #1d4ed8;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

#hydraToolsShell .ph-cursor-panel__summary::-webkit-details-marker {
  display: none;
}

#hydraToolsShell .ph-cursor-panel__summary::after {
  content: "▾";
  margin-left: auto;
  font-size: 12px;
  color: #64748b;
  transition: transform 0.15s ease;
}

#hydraToolsShell .ph-cursor-panel--collapsible[open] .ph-cursor-panel__summary::after {
  transform: rotate(180deg);
}

#hydraToolsShell .ph-cursor-panel__body {
  padding: 0 12px 12px;
  border-top: 1px solid rgba(29, 78, 216, 0.1);
  max-height: min(52vh, 360px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  #hydraToolsShell .ph-sprint-card {
    padding: 10px 12px;
  }

  #hydraToolsShell .ph-sprint-card__head {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  #hydraToolsShell .ph-sprint-card__chips {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #hydraToolsShell .ph-sprint-card__chips::-webkit-scrollbar {
    display: none;
  }

  #hydraToolsShell .ph-list-item--task .ph-row-menu-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }

  #hydraToolsShell .ph-cursor-panel__body {
    max-height: min(42vh, 280px);
  }
}
