.accordion-content {
        display: block !important;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transform: translateY(-4px);
        transition:
          max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
          opacity 0.18s ease,
          transform 0.18s ease,
          margin 0.18s ease;
        will-change: max-height, opacity, transform;
      }

.accordion-content.is-open {
        opacity: 1;
        transform: translateY(0);
      }

.history-scroll::-webkit-scrollbar {
        width: 10px;
      }

.history-scroll::-webkit-scrollbar-thumb {
        background: rgba(47, 86, 179, 0.2);
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: padding-box;
      }

.history-scroll::-webkit-scrollbar-track {
        background: transparent;
      }

.obra-detail-grid {
        align-items: start !important;
      }

.obra-detail-panel {
        height: auto;
        min-height: 0;
      }

.obra-detail-panel.history-panel {
        min-height: 0;
      }

.obra-detail-right {
        display: grid;
        gap: 14px;
        min-width: 0;
        align-self: start;
      }

.obra-classificacao-panel {
        min-height: 0;
      }

.obra-fases-block {
        margin-top: 2px !important;
      }

.obra-history-scroll {
        max-height: 420px;
        overflow: auto;
      }

.history-item.history-target-highlight {
        border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
        background: color-mix(in srgb, var(--accent) 11%, var(--surface));
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
        transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
      }

html[data-theme="dark"] .history-item.history-target-highlight {
        background: color-mix(in srgb, var(--accent) 18%, var(--surface-2));
      }

.history-thread {
        display: block;
      }

.history-thread + .history-thread {
        margin-top: 10px;
      }

.history-thread-replies {
        position: relative;
        display: grid;
        gap: 8px;
        margin: 8px 0 2px 34px;
        padding-left: 16px;
        border-left: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
      }

.history-thread-replies > .history-thread {
        position: relative;
      }

.history-thread-replies > .history-thread > .history-item-reply::before {
        content: "";
        position: absolute;
        left: -17px;
        top: 22px;
        width: 16px;
        border-top: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
      }

.history-item-reply .history-actions {
        margin-top: 5px;
      }

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

.history-author-date {
        display: flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: 4px;
        margin-bottom: 4px;
        line-height: 1.25;
        color: var(--text);
      }

.history-author-date strong {
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.01em;
      }

.history-item .history-author-date span {
        font-size: 11px;
        color: var(--muted);
        font-family: var(--font);
        font-weight: 600;
      }

.history-item-reply .history-author-date strong {
        font-size: 11.5px;
      }

.history-item-reply .history-author-date span {
        font-size: 10.5px;
      }

.history-actions {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-top: 7px;
      }

.history-meta {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
        flex: 0 0 auto;
        margin-left: 12px;
      }

.history-inline-reply-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        padding-top: 1px;
      }

.history-inline-reply-confirm,
      .history-inline-reply-cancel {
        width: 28px;
        height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        border: 1px solid var(--border);
        background: var(--surface);
        cursor: pointer;
        transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
      }

.history-inline-reply-confirm.is-saving,
      .history-inline-reply-confirm:disabled {
        opacity: 0.55;
        cursor: wait;
        transform: none;
      }

.history-inline-reply-cancel {
        color: var(--muted);
        font-size: 18px;
        line-height: 1;
      }

.history-inline-reply-cancel:hover {
        border-color: color-mix(in srgb, var(--danger) 34%, var(--border));
        color: var(--danger);
        transform: translateY(-1px);
      }

.history-thread-replies .history-inline-reply-slot {
        margin-left: 0;
      }

.history-replying-label {
        color: var(--accent);
        font-size: 11px;
        font-weight: 850;
      }

.history-replying-clear {
        width: 24px;
        height: 24px;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: var(--surface);
        color: var(--muted);
        cursor: pointer;
        font-size: 17px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
      }

.history-replying-clear:hover {
        color: var(--danger);
        border-color: color-mix(in srgb, var(--danger) 32%, var(--border));
      }

.history-reply-quote-label {
        color: var(--accent);
        font-size: 11px;
        font-weight: 850;
        margin-bottom: 2px;
      }

.history-reply-body {
        line-height: 1.45;
      }

.page {
        display: none;
        opacity: 0;
        transform: translateY(10px);
      }

.page.active {
        display: block;
        opacity: 1;
        transform: translateY(0);
      }

.page.page-enter {
        animation: pageFadeIn 0.22s ease both;
      }

.kpi .lab {
        font-size: 12px;
        color: var(--muted);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.2px;
        margin-top: 6px;
      }

.panel {
        border: 1px solid var(--border);
        background: var(--surface);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-2);
        padding: 18px;
      }

.panel-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
      }

.panel-head .h2 {
        margin-top: 2px;
      }

.panel-head .sub {
        margin-top: 4px;
      }

.rank {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 8px;
      }

.rank-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        border-radius: 14px;
        border: 1px solid var(--border);
        background: var(--surface-2);
      }

.rank-item b {
        font-size: 13px;
      }

.rank-item span {
        font-size: 12px;
        color: var(--muted);
        font-family: var(--mono);
      }

.obras-multi-filter {
        position: relative;
        min-width: 0;
      }

.obras-multi-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        min-height: 42px;
        text-align: left;
        cursor: pointer;
      }

.obras-multi-filter-summary {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

.obras-multi-filter-chevron {
        flex: 0 0 auto;
        color: var(--muted);
        font-size: 12px;
        transition: transform .16s ease;
      }

.obras-multi-filter.is-open .obras-multi-filter-chevron {
        transform: rotate(180deg);
      }

.obras-multi-filter-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        z-index: 80;
        display: none;
        width: min(320px, 86vw);
        max-height: 280px;
        overflow: auto;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: var(--surface);
        box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
      }

.obras-multi-filter.is-open .obras-multi-filter-menu {
        display: block;
      }
