/* Port 360: planleggingsmodus (viewer/js/port360_plan.js). Canvas over
   panoramaet, verktøylinje øverst, lagpanel til høyre, bånd for mottakeren.
   Samme uttrykk som resten av Port 360: hvitt, 10 px hjørner, #0284c7. */
#p360_plan_overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 36;
    pointer-events: none;
    touch-action: none;
}
#p360_plan_overlay.active {
    pointer-events: auto;
    cursor: default;
}
#p360_plan_overlay.draw {
    cursor: crosshair;
}
#p360_plan_overlay.muted {
    opacity: 0;
}
/* Farge og hover kopieres fra produktets .snapshot_control-regler av
   port360_plan.js (clone_button_style), så knappen følger UI-innstillingene.
   Her bare det produktet slår på med inline-stil, og en ring når planlegging
   er aktiv. */
.controls_btn.p360_plan_control {
    display: none;
    opacity: 1 !important;
    pointer-events: initial !important;
}
.controls_btn.p360_plan_control.active_control {
    box-shadow: 0 0 0 2px rgba(255,255,255,.85);
}

.p360-plan-bar,
.p360-plan-panel,
.p360-plan-band,
.p360-plan-dialog-box {
    position: absolute;
    z-index: 1060;
    background: rgba(255,255,255,.96);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(60,64,67,.15), 0 1px 3px 1px rgba(60,64,67,.07);
    color: #1f2937;
    font: 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-user-select: none;
    user-select: none;
}
.p360-plan-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 20px);
    padding: 4px;
}
.p360-plan-btn {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1f2937;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
}
.p360-plan-btn:hover {
    background: rgba(0,0,0,.06);
}
.p360-plan-btn:disabled {
    opacity: .35;
    cursor: default;
}
.p360-plan-btn.active {
    background: rgba(2,132,199,.12);
    color: #0284c7;
}
.p360-plan-btn.p360-plan-primary {
    background: #0284c7;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 0 12px;
}
.p360-plan-btn.p360-plan-primary.dirty::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f97316;
    border: 2px solid #ffffff;
}
.p360-plan-btn.p360-plan-close {
    color: #6b7280;
}
.p360-plan-color span {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,.15);
}
.p360-plan-palette {
    display: none;
    position: absolute;
    top: 42px;
    left: 0;
    z-index: 2;
    flex-wrap: wrap;
    gap: 6px;
    width: 150px;
    padding: 8px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.p360-plan-palette.open {
    display: flex;
}
.p360-plan-palette button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 2px solid rgba(0,0,0,.12);
    border-radius: 50%;
    cursor: pointer;
}
.p360-plan-palette input[type=color] {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}
.p360-plan-range {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 6px;
    color: #6b7280;
    font-size: 11px;
}
.p360-plan-range input[type=range] {
    width: 70px;
    margin: 0;
    accent-color: #0284c7;
}
.p360-plan-sep {
    width: 1px;
    height: 22px;
    margin: 0 4px;
    background: rgba(0,0,0,.12);
}

.p360-plan-panel {
    display: none;
    flex-direction: column;
    top: 104px;
    right: 10px;
    bottom: 80px;
    width: 300px;
    max-width: calc(100% - 20px);
    overflow: hidden;
}
#vt_container.p360-planning .p360-plan-panel.open {
    display: flex;
}
.p360-plan-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 0 4px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    font-weight: 600;
}
.p360-plan-tabs {
    display: flex;
    min-width: 0;
}
.p360-plan-tabs button {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    padding: 12px 10px 10px;
    border: 0;
    background: transparent;
    color: #6b7280;
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.p360-plan-tabs button.active {
    color: #0284c7;
}
.p360-plan-tabs button.active::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: #0284c7;
}
.p360-plan-tab {
    display: none;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.p360-plan-panel[data-tab="layers"] .p360-plan-tab-layers,
.p360-plan-panel[data-tab="plans"] .p360-plan-tab-plans {
    display: flex;
}
.p360-plan-plans-head {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px 6px 12px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    font-size: 12px;
    color: #6b7280;
}
.p360-plan-plans-head .who {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.p360-plan-plans-head button {
    appearance: none;
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
}
.p360-plan-plans-head button:hover {
    background: rgba(0,0,0,.06);
}
.p360-plan-plans {
    flex: 1 1 auto;
    overflow: auto;
}
.p360-plan-plans .p360-plan-item {
    padding: 9px 12px;
}
.p360-plan-plans .p360-plan-item.current {
    background: rgba(2,132,199,.07);
}
.p360-plan-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
}
.p360-plan-item-top .p360-plan-item-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.p360-plan-status {
    flex: 0 0 auto;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
    background: rgba(22,163,74,.12);
    color: #15803d;
}
.p360-plan-status.off {
    background: rgba(107,114,128,.14);
    color: #4b5563;
}
.p360-plan-status.exp {
    background: rgba(249,115,22,.14);
    color: #c2410c;
}
.p360-plan-item.current .p360-plan-status {
    background: rgba(2,132,199,.14);
    color: #0369a1;
}
.p360-plan-item.off .p360-plan-item-title,
.p360-plan-item.exp .p360-plan-item-title {
    color: #6b7280;
}
.p360-plan-item-acts {
    display: flex;
    gap: 2px;
    margin-top: 6px;
    margin-left: -6px;
}
.p360-plan-item-acts button {
    appearance: none;
    -webkit-appearance: none;
    width: 30px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #4b5563;
    font-size: 13px;
    cursor: pointer;
}
.p360-plan-item-acts button:hover {
    background: rgba(0,0,0,.06);
    color: #1f2937;
}
.p360-plan-item-acts button.p360-plan-danger {
    color: #e11d48;
}
.p360-plan-item-acts button.p360-plan-activate {
    color: #15803d;
}
.p360-plan-login-intro {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #6b7280;
}
.p360-plan-login .code {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .08em;
    text-align: center;
}
.p360-plan-linkbtn {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    margin: 12px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6b7280;
    font: inherit;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}
.p360-plan-linkbtn:hover {
    color: #0284c7;
}
.p360-plan-panel-close,
.p360-plan-dialog-close {
    appearance: none;
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
}
.p360-plan-props {
    flex: 0 0 auto;
    max-height: 55%;
    overflow: auto;
    padding: 8px 12px 10px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    background: rgba(2,132,199,.05);
}
.p360-plan-props-head {
    margin-bottom: 4px;
    font-weight: 600;
    color: #0284c7;
}
.p360-plan-field {
    margin-top: 8px;
}
.p360-plan-field label {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
    color: #6b7280;
}
.p360-plan-field label b {
    float: right;
    font-weight: 500;
}
.p360-plan-field label.p360-plan-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
    color: #1f2937;
    font-size: 13px;
}
.p360-plan-field input[type=text],
.p360-plan-field textarea,
.p360-plan-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 8px;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    font: inherit;
    -webkit-user-select: text;
    user-select: text;
}
.p360-plan-field input[type=range] {
    width: 100%;
    margin: 0;
    accent-color: #0284c7;
}
.p360-plan-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.p360-plan-swatches button {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 2px solid rgba(0,0,0,.12);
    border-radius: 50%;
    cursor: pointer;
}
.p360-plan-swatches button.active {
    border-color: #1f2937;
    box-shadow: 0 0 0 2px #ffffff inset;
}
.p360-plan-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 10px;
}
.p360-plan-actions.wrap {
    flex-wrap: wrap;
}
.p360-plan-actions button,
.p360-plan-shareouts a {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    font: inherit;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.p360-plan-actions button:hover {
    background: rgba(0,0,0,.04);
}
.p360-plan-actions .p360-plan-primary {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}
.p360-plan-actions .p360-plan-danger {
    color: #e11d48;
}
.p360-plan-actions .status {
    font-size: 12px;
    color: #6b7280;
}
.p360-plan-actions .status.ok { color: #16a34a; }
.p360-plan-actions .status.err { color: #e11d48; }
.p360-plan-list {
    flex: 1 1 auto;
    overflow: auto;
    padding: 6px 0;
}
.p360-plan-empty {
    padding: 14px 12px;
    color: #6b7280;
    font-size: 12px;
}
.p360-plan-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    cursor: pointer;
}
.p360-plan-row:hover {
    background: rgba(0,0,0,.04);
}
.p360-plan-row.active {
    background: rgba(2,132,199,.1);
}
.p360-plan-row.hidden-shape .p360-plan-row-name {
    color: #9ca3af;
}
.p360-plan-row > i {
    flex: 0 0 16px;
    text-align: center;
}
.p360-plan-row-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.p360-plan-row button {
    appearance: none;
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
}
.p360-plan-row button:hover {
    background: rgba(0,0,0,.06);
}

.p360-plan-textinput {
    position: absolute;
    z-index: 1061;
    min-width: 140px;
    max-width: 60%;
    padding: 4px 8px;
    border: 1px dashed #0284c7;
    border-radius: 6px;
    background: rgba(255,255,255,.9);
    font: 600 18px/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    resize: none;
    outline: none;
    -webkit-user-select: text;
    user-select: text;
}

.p360-plan-band {
    display: flex;
    align-items: center;
    gap: 10px;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 20px);
    padding: 8px 10px 8px 14px;
}
.p360-plan-band > i {
    color: #0284c7;
    font-size: 16px;
}
.p360-plan-band.error > i {
    color: #e11d48;
}
.p360-plan-band .text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.p360-plan-band .text b {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.p360-plan-band .text span {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
}
.p360-plan-band .acts {
    display: flex;
    gap: 4px;
}
.p360-plan-band .acts button {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: rgba(0,0,0,.04);
    color: #1f2937;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.p360-plan-band .acts button:hover {
    background: rgba(0,0,0,.08);
}
.p360-plan-band .acts .goto {
    background: #0284c7;
    color: #ffffff;
}

.p360-plan-dialog {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 1070;
}
.p360-plan-dialog.open {
    display: block;
}
.p360-plan-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17,24,39,.45);
}
.p360-plan-dialog-box {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 440px;
    max-width: calc(100% - 20px);
    max-height: calc(100% - 20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.p360-plan-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    font-weight: 600;
}
.p360-plan-dialog-body {
    padding: 4px 14px 14px;
    overflow: auto;
}
.p360-plan-dialog-body .linkrow {
    display: flex;
    gap: 6px;
}
.p360-plan-dialog-body .linkrow input {
    flex: 1 1 auto;
    font-size: 12px;
}
.p360-plan-dialog-body .linkrow button {
    appearance: none;
    -webkit-appearance: none;
    padding: 0 10px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    background: #ffffff;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.p360-plan-shareouts {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
}
.p360-plan-shareouts img {
    width: 110px;
    height: 110px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,.08);
}
.p360-plan-shareouts .expires {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}
.p360-plan-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,.08);
}
.p360-plan-item.revoked .p360-plan-item-title {
    color: #9ca3af;
    text-decoration: line-through;
}
.p360-plan-item-title {
    font-weight: 600;
}
.p360-plan-item-meta {
    margin-top: 2px;
    font-size: 11px;
    color: #6b7280;
}
.p360-plan-note {
    white-space: pre-line;
    padding-top: 8px;
}

@media (max-width: 768px) {
    .p360-plan-bar {
        top: auto;
        bottom: 64px;
        left: 6px;
        right: 6px;
        transform: none;
        max-width: none;
        justify-content: center;
    }
    .p360-plan-bar .p360-plan-btn {
        min-width: 40px;
        height: 40px;
    }
    .p360-plan-range {
        display: none;
    }
    #vt_container.p360-planning .p360-plan-panel.open {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: auto;
        max-width: none;
        max-height: 55%;
        border-radius: 10px 10px 0 0;
    }
    .p360-plan-band {
        top: 8px;
        left: 6px;
        right: 6px;
        transform: none;
        max-width: none;
    }
    .p360-plan-band .text span {
        white-space: normal;
    }
    .p360-plan-band .acts .goto span {
        display: none;
    }
}
