/* ==========================================
   MODALS
========================================== */

/* MODALS */
  .p18-square-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,0.58);
  }
  .p18-square-modal[hidden] { display: none; }
  .p18-square-modal--map-pick {
    align-items: flex-end;
    justify-content: flex-end;
    pointer-events: none;
    background: rgba(0,0,0,0.28);
  }
  .p18-square-panel {
    width: min(100%, 540px);
    max-height: min(86vh, 760px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(0,0,0,0.42);
    padding: 22px;
  }
  .p18-square-modal--map-pick .p18-square-panel {
    width: min(100%, 430px);
    max-height: min(78vh, 680px);
    pointer-events: auto;
  }
  .p18-square-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
  }
  .p18-square-panel-title {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 740;
    color: var(--text);
  }
  .p18-square-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
  }
  .p18-square-close:hover { color: var(--text); border-color: var(--muted); }
  .p18-square-details {
    display: grid;
    gap: 12px;
  }
  .p18-square-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
  }
  .p18-square-row strong {
    color: var(--text);
    font-weight: 650;
    text-align: right;
  }
  .p18-square-message {
    color: #c1c6bd;
    font-size: 15px;
    line-height: 1.65;
    padding-top: 2px;
  }
  .p18-square-image {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: #101211;
    margin-top: 4px;
  }
  .p18-square-available {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
    margin: 4px 0 18px;
  }
  .p18-square-claim {
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }
  .p18-claim-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 2px 0 18px;
  }
  .p18-claim-step {
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted2);
    font-size: 11px;
    line-height: 1.2;
    padding: 8px 6px;
    text-align: center;
  }
  .p18-claim-step span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
  }
  .p18-claim-step--active {
    border-color: rgba(54,214,107,0.75);
    color: var(--text);
  }
  .p18-claim-step--active span {
    color: var(--green);
  }
  .p18-claim-step-panel h3 {
    color: var(--text);
    font-size: 18px;
    line-height: 1.25;
    margin-bottom: 14px;
  }
  .p18-selection-type {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
  }
  .p18-selection-type > span {
    color: var(--muted);
    font-size: 12px;
  }
  .p18-selection-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .p18-selection-toggle button {
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    padding: 10px;
  }
  .p18-selection-toggle button.p18-selection-toggle--active {
    border-color: rgba(54,214,107,0.75);
    color: var(--text);
  }
  .p18-block-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
  }
  .p18-block-option {
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 10px;
    text-align: left;
    font: inherit;
    font-size: 13px;
    line-height: 1.35;
  }
  .p18-block-option strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 2px;
  }
  .p18-block-option--active {
    border-color: rgba(54,214,107,0.8);
    color: #c1c6bd;
  }
  .p18-block-warning,
  .p18-form-status {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    margin: 10px 0 14px;
  }
  .p18-block-warning--invalid { color: #d4d8d1; }
  .p18-form-status--error { color: #d4d8d1; }
  .p18-claim-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
  }
  .p18-claim-field {
    display: grid;
    gap: 5px;
  }
  .p18-claim-field label {
    color: var(--muted);
    font-size: 12px;
  }
  .p18-claim-field input,
  .p18-claim-field textarea {
    width: 100%;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: #101211;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    padding: 10px 11px;
  }
  .p18-claim-field textarea {
    min-height: 78px;
    resize: vertical;
  }
  .p18-claim-help,
  .p18-claim-note {
    color: var(--muted2);
    font-size: 12px;
    line-height: 1.5;
  }
  .p18-claim-note {
    margin-top: 2px;
  }
  .p18-claim-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 4px;
  }
  .p18-claim-form-actions .p18-btn-primary { flex: 1; }
  .p18-claim-form-actions .p18-btn-ghost {
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
  }
  .p18-claim-success {
    display: grid;
    gap: 14px;
    color: var(--muted);
    line-height: 1.65;
  }
  .p18-claim-success h3 {
    color: var(--text);
    font-size: 22px;
    line-height: 1.2;
  }
  .p18-claim-success .p18-btn-primary {
    text-align: center;
  }
