/* ── Port Noticeboard Service Page ──────────────────────────────────────────
   Scoped to #svc-noticeboard and #char-tab-quests. Table rows use shared mkt-table / mkt-row /
   mkt-td / mkt-th classes from market-panel.css. Only noticeboard-specific
   overrides and new components live here.
   Removal: delete this file's <link>, #svc-noticeboard in game.html, and
            the 'noticeboard' case in cityServices.js _renderPanel.
   ──────────────────────────────────────────────────────────────────────────── */

.nb-svc-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-bottom: var(--space-xl);
    min-width: 0;
    max-width: 100%;
}

.nb-svc-quest-section {
    min-width: 0;
    max-width: 100%;
}

.nb-svc-quest-section + .nb-svc-quest-section {
    margin-top: var(--space-lg);
}

:is(#svc-noticeboard, #char-tab-quests) .mkt-detail-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-width: 0;
}

:is(#svc-noticeboard, #char-tab-quests) .svc-section .bl-header {
    margin-bottom: 0;
}

:is(#svc-noticeboard, #char-tab-quests) .bl-header__title-row {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

:is(#svc-noticeboard, #char-tab-quests) .bl-header__title-row .bl-header__title {
    margin: 0;
}

:is(#svc-noticeboard, #char-tab-quests) .bl-header__sub {
    font-size: var(--font-size-base);
}

:is(#svc-noticeboard, #char-tab-quests) .bl-header__text {
    margin-top: 0;
}

/* ── Table scroll container ─────────────────────────────────────────────────── */
.nb-svc-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    max-width: 100%;
}

:is(#svc-noticeboard, #char-tab-quests) .mkt-td {
    padding: 15px 10px;
}

:is(#svc-noticeboard, #char-tab-quests) .nb-svc-quest-table {
    width: 100%;
    table-layout: auto;
}

:is(#svc-noticeboard, #char-tab-quests) .nb-svc-quest-table th:first-child,
:is(#svc-noticeboard, #char-tab-quests) .nb-svc-quest-table td:first-child {
    width: 100%;
    min-width: 0;
}

:is(#svc-noticeboard, #char-tab-quests) .nb-svc-quest-table .nb-svc-reward-cell,
:is(#svc-noticeboard, #char-tab-quests) .nb-svc-quest-table th:nth-child(2) {
    width: 1%;
    white-space: nowrap;
}

:is(#svc-noticeboard, #char-tab-quests) .nb-svc-action-cell,
:is(#svc-noticeboard, #char-tab-quests) .nb-svc-quest-table th:nth-child(3) {
    width: 1%;
    white-space: nowrap;
    padding-right: 10px;
}

/* ── Quest accordion rows ───────────────────────────────────────────────────── */
:is(#svc-noticeboard, #char-tab-quests) .nb-svc-quest-row {
    cursor: pointer;
}

:is(#svc-noticeboard, #char-tab-quests) .nb-svc-quest-row[aria-expanded='true'] {
    background: rgba(197, 160, 89, 0.04);
}

.nb-svc-quest-detail-cell {
    padding: 0 10px 14px 52px !important;
    background: rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .quest-lore {
    width: 100%;
    max-width: 660px;
    box-sizing: border-box;
    margin: var(--space-md) 0;
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .quest-lore .ob-section-label {
    margin-bottom: 4px;
}

.quest-lore-icon {
    flex-shrink: 0;
    opacity: 0.65;
    margin-top: 2px;
    display: block;
}

#quest-location-modal .nb-svc-quest-detail-inner {
    margin-top: var(--space-md);
}

#quest-location-modal .quest-lore {
    margin-top: 0;
}

#quest-location-modal .quest-location-picker {
    margin-top: var(--space-md);
}

#quest-location-modal .quest-location-picker .ob-section-label {
    margin-bottom: var(--space-sm);
}

#quest-location-modal .quest-location-picker .ms-select {
    width: 100%;
}

.nb-svc-quest-steps-label {
    font-size: var(--font-size-sm);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 var(--space-md);
}

:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-svc-quest-steps .fv-step {
    align-items: center;
    padding: 10px 14px;
    border-left: none;
    border-radius: var(--radius-sm);
}

:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-svc-quest-steps .fv-step-marker {
    margin-top: 0;
}

:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-svc-quest-steps .fv-step--active {
    border-left: none;
    background: rgba(197, 160, 89, 0.04);
}

:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-svc-quest-steps .fv-step--done .fv-step-marker {
    background: rgb(92 197 89 / 15%);
    border-color: rgb(89 197 104 / 40%);
    color: rgb(89 197 144 / 90%);
}

:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-svc-quest-steps .fv-step-marker-icon {
    display: block;
    width: 12px;
    height: 12px;
}

:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-svc-quest-steps .fv-step-label {
    font-size: var(--font-size-base);
    flex: 1;
    min-width: 0;
}

:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-svc-quest-steps .fv-step-sublabel {
    font-size: var(--font-size-sm);
}

:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-svc-quest-steps .fv-step--future .fv-step-marker,
:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-svc-quest-steps .fv-step--future .fv-step-label,
:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-svc-quest-steps .fv-step--future .fv-step-sublabel,
:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal)
    .nb-svc-quest-steps
    .fv-step--future
    .nb-quest-step-progress,
:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal)
    .nb-svc-quest-steps
    .fv-step--future
    .nb-quest-step-icon {
    opacity: 0.45;
}

/* ── Step cards (new quest layout) ─────────────────────────────────────────── */
:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-quest-step-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: var(--space-xs);
}

:is(#svc-noticeboard, #char-tab-quests, #quest-location-modal) .nb-quest-step-card:last-child {
    margin-bottom: 0;
}

.nb-quest-step-progress {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    box-sizing: border-box;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    white-space: nowrap;
    margin-left: var(--space-sm);
    text-align: center;
}

.nb-quest-step-icon {
    flex-shrink: 0;
    opacity: 0.55;
    margin-left: var(--space-sm);
    display: block;
}

/* ── Quest cell: type badge + title + desc stacked ──────────────────────────── */
.nb-svc-quest-cell {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    min-width: 0;
}

.nb-svc-quest-cell > div:last-child {
    min-width: 0;
    flex: 1;
}

/* ── Poster cell: item icon + name + item stacked ───────────────────────────── */
.nb-svc-poster-cell {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nb-svc-item-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.9;
}

/* ── Shared cell typography ─────────────────────────────────────────────────── */
.nb-svc-cell-title {
    font-size: var(--font-size-md);
    color: var(--text-primary);
    font-weight: 500;
}

.nb-svc-cell-title--gold {
    font-family: var(--font-heading);
    font-size: var(--font-size-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-gold);
    font-weight: 700;
}

.nb-svc-quest-cell .nb-svc-cell-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nb-svc-cell-sub {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-top: 1px;
}

.nb-svc-quest-cell .nb-svc-cell-sub {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.nb-svc-route-cell {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

.nb-svc-route-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--accent-gold, #d4be8c);
    transition:
        color 0.12s,
        text-decoration-color 0.12s;
}

.nb-svc-route-link:hover,
.nb-svc-route-link:focus-visible {
    color: var(--text-gold);
    text-decoration-color: currentColor;
    outline: none;
}

.nb-svc-route-sep {
    color: var(--text-secondary);
}

/* ── Jobs table: shrink left columns, cluster cargo/reward/action on the right ─ */
#svc-noticeboard .nb-svc-jobs-table {
    width: 100%;
    table-layout: auto;
    min-width: 0;
}

#svc-noticeboard .nb-svc-jobs-table th:first-child,
#svc-noticeboard .nb-svc-jobs-table td:first-child,
#svc-noticeboard .nb-svc-jobs-table .nb-svc-route-cell {
    min-width: 0;
}

#svc-noticeboard .nb-svc-jobs-table .nb-svc-poster-cell > div:last-child {
    min-width: 0;
}

#svc-noticeboard .nb-svc-jobs-table .nb-svc-poster-cell .nb-svc-cell-title,
#svc-noticeboard .nb-svc-jobs-table .nb-svc-poster-cell .nb-svc-cell-sub,
#svc-noticeboard .nb-svc-jobs-table .nb-svc-route-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#svc-noticeboard .nb-svc-jobs-table .nb-svc-cargo-cell,
#svc-noticeboard .nb-svc-jobs-table .nb-svc-reward-cell,
#svc-noticeboard .nb-svc-jobs-table .nb-svc-action-cell,
#svc-noticeboard .nb-svc-jobs-table th:nth-child(3),
#svc-noticeboard .nb-svc-jobs-table th:nth-child(4),
#svc-noticeboard .nb-svc-jobs-table th:nth-child(5) {
    width: 1%;
    white-space: nowrap;
}

#svc-noticeboard .nb-svc-jobs-table .nb-svc-action-cell,
#svc-noticeboard .nb-svc-jobs-table th:nth-child(5) {
    padding-right: 10px;
}

#svc-noticeboard .nb-svc-jobs-table .nb-svc-cargo-cell,
#svc-noticeboard .nb-svc-jobs-table .nb-svc-reward-cell {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
}

/* ── Reward / pay cells: gold tint ──────────────────────────────────────────── */
.nb-svc-reward-cell {
    color: var(--text-gold) !important;
}

.nb-svc-quest-rewards {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.nb-svc-quest-xp {
    color: var(--text-success);
    font-size: var(--font-size-sm);
    line-height: 1.2;
}

.nb-svc-reward-cell img {
    vertical-align: middle;
    margin-right: 2px;
    opacity: 0.85;
}

/* ── Quest type icon ────────────────────────────────────────────────────────── */
.nb-svc-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-top: 1px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.nb-svc-type-icon-img {
    display: block;
    opacity: 0.88;
}

/* ── Cargo icon alignment ───────────────────────────────────────────────────── */
#svc-noticeboard .mkt-td img {
    vertical-align: middle;
}

/* ── Action buttons: compact mkt-detail-cta in table cells ─────────────────── */
:is(#svc-noticeboard, #char-tab-quests) .mkt-detail-cta {
    width: auto;
    min-width: 4.75rem;
    padding: 7px 12px;
    box-sizing: border-box;
}

:is(#svc-noticeboard, #char-tab-quests) .mkt-detail-cta:disabled {
    opacity: 0.45;
}

:is(#svc-noticeboard, #char-tab-quests) .mkt-detail-cta:disabled:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(197, 160, 89, 0.28);
}

.nb-svc-quest-empty {
    padding: var(--space-md) 0;
    color: var(--text-muted);
}

/* ── Mobile: hide route column on small screens ─────────────────────────────── */
@media (max-width: 600px) {
    #svc-noticeboard .nb-svc-route-cell,
    #svc-noticeboard .nb-svc-jobs-table th:nth-child(2) {
        display: none;
    }

    #svc-noticeboard .nb-svc-jobs-table .nb-svc-cargo-cell,
    #svc-noticeboard .nb-svc-jobs-table .nb-svc-reward-cell {
        padding-left: var(--space-xs);
        padding-right: var(--space-xs);
    }
}
