/**
 * Portfolio demo theme — aligns Logmaster Graph with Manual Events visual language.
 * All rules scoped under #me-graph-output to avoid leaking into the timetable above.
 */

#me-graph-output {
    font-family: "Open Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #0f172a;
}

#me-graph-output .graphical-summary {
    width: 100%;
    max-width: 100%;
}

/* ── Compact day bar header ── */
#me-graph-output .me-graph-day-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 20px;
    margin: 0 0 14px;
    padding: 14px 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#me-graph-output .me-graph-day-field {
    flex: 1 1 120px;
    min-width: 0;
}

#me-graph-output .me-graph-day-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 3px;
}

#me-graph-output .me-graph-day-value {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#me-graph-output .me-graph-day-value_upper {
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Legacy header fallback (if old markup renders) */
#me-graph-output .table-top-header:not(.me-graph-day-bar) .grid {
    margin: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

#me-graph-output .table-top-header:not(.me-graph-day-bar) h6 {
    padding: 6px 10px !important;
    background: #f8fafc !important;
    color: #94a3b8 !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#me-graph-output .table-top-header:not(.me-graph-day-bar) span {
    padding: 8px 10px !important;
    color: #0f172a;
    font-size: 12px !important;
    font-weight: 600;
}

/* ── Timetable shell ── */
#me-graph-output .timetable-container {
    border: none;
    border-radius: 14px;
    background: #fff;
}

#me-graph-output .timetable-headers {
    color: #64748b;
}

#me-graph-output .timetable-header_hour,
#me-graph-output .timetable-header_minute,
#me-graph-output .activity-label {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

#me-graph-output .timetable-header_hour h1,
#me-graph-output .timetable-header_minute h1 {
    font-size: 11px !important;
    font-weight: 600;
    color: #64748b;
}

#me-graph-output .timetable-header_hour {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

#me-graph-output .activity-label.label-work-row h1::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 9999px;
    background: #34c38f;
    vertical-align: middle;
}

#me-graph-output .activity-label:not(.label-work-row):not(.two-up-row) h1::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 9999px;
    background: #f46a6a;
    vertical-align: middle;
}

#me-graph-output .activity-label.two-up-row h1::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 9999px;
    background: #94a3b8;
    vertical-align: middle;
}

/* ── time-col grid cells only (graph step lines unchanged) ── */
#me-graph-output .g-border-gray,
#me-graph-output .time-block,
#me-graph-output .time-col,
#me-graph-output .totals-row > div {
    border-color: #e8edf2 !important;
}

#me-graph-output .border-2 {
    border-width: 1px !important;
}

#me-graph-output .time-col {
    border-color: #e8edf2 !important;
    transition: background-color 0.15s ease;
}

#me-graph-output .ruler-style .time-col::after,
#me-graph-output .ruler-style .time-15::before,
#me-graph-output .time-col.rest::before {
    background-color: #e8edf2 !important;
}

#me-graph-output .time-col::after {
    opacity: 0.35;
}

#me-graph-output .time-15::after,
#me-graph-output .time-30::after,
#me-graph-output .time-45::after {
    opacity: 0.45;
}

/* Off-hours shading on time-col cells */
#me-graph-output .work-row .time-col.work:nth-child(n):nth-child(-n+32),
#me-graph-output .work-row .time-col.work:nth-child(n+89):nth-child(-n+96) {
    background-color: rgba(52, 195, 143, 0.08) !important;
}

#me-graph-output .rest-row .time-col.rest:nth-child(n):nth-child(-n+32),
#me-graph-output .rest-row .time-col.rest:nth-child(n+89):nth-child(-n+96),
#me-graph-output .two-up-row .time-col.two-up:nth-child(n):nth-child(-n+32),
#me-graph-output .two-up-row .time-col.two-up:nth-child(n+89):nth-child(-n+96) {
    background-color: rgba(244, 106, 106, 0.08) !important;
}

#me-graph-output .bg-dark-opacity {
    background-color: transparent !important;
}

/* ── Odometer & location rows ── */
#me-graph-output .odometer-blocks,
#me-graph-output .location-blocks {
    background: rgba(248, 250, 252, 0.65);
}

#me-graph-output .odometer-blocks .time-block,
#me-graph-output .location-blocks .time-block {
    background: rgba(255, 255, 255, 0.7);
}

#me-graph-output .annotation-blocks .time-block:last-child {
    border-top-right-radius: 10px;
}

#me-graph-output .vertical.time-block-vertical {
    color: #334155;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

#me-graph-output .location-blocks {
    margin-bottom: 2px;
}

/* ── Time ruler ── */
#me-graph-output .ruler-block {
    margin-top: 4px;
}

#me-graph-output .ruler-row {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
}

#me-graph-output .ruler-block .ruler-style .time-15::before,
#me-graph-output .ruler-block .ruler-style .time-15:first-child::before,
#me-graph-output .ruler-block .ruler-style .time-60::after {
    opacity: 0.85;
    right: 0.5px;
}

#me-graph-output .ruler-block .ruler-block_minute {
    height: 26px;
}

/* ── Totals footer — pill badges ── */
#me-graph-output .timetable-wrapper > .relative.h-9 {
    height: auto !important;
    min-height: 2.25rem;
}

#me-graph-output .totals-row {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: -7rem !important;
    right: 0 !important;
    width: calc(100% + 7rem);
    background: #f8fafc;
    border-top: 1px solid #e2e8f0 !important;
}

#me-graph-output .totals-row > div {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px !important;
    background: transparent !important;
    border-top: none !important;
    border-color: #e8edf2 !important;
}

#me-graph-output .totals-row > div:first-child {
    border-width: 0 0 2px 2px !important;
    border-style: solid !important;
    border-color: #e8edf2 !important;
    border-bottom-left-radius: 12px;
}

#me-graph-output .totals-row > div:last-child {
    border-right: 2px solid #e8edf2 !important;
    border-bottom: 2px solid #e8edf2 !important;
    border-left: none !important;
    border-bottom-right-radius: 12px;
    justify-content: flex-end;
}

#me-graph-output .totals-row span:first-child {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    min-width: auto !important;
    width: auto !important;
    margin-right: 0 !important;
}

#me-graph-output .totals-row > div:first-child span:last-child {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(52, 195, 143, 0.14);
    color: #157a58;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

#me-graph-output .totals-row > div:last-child span:last-child {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(244, 106, 106, 0.14);
    color: #b83a3a;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ── Modal / notifications ── */
#me-graph-output .modal-container {
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
    border: 1px solid #e2e8f0;
}

#me-graph-output .blob {
    fill: #ff8227;
}

#me-graph-output .blob:hover {
    fill: #e6741f;
}
