/**
 * ETYKIETOWNIK — Clean, professional admin metabox styles.
 * Design: WooCommerce-native feel, consistent spacing, no inline styles.
 * @since 3.4.0
 */

/* ======================= TITLE ======================= */
.etyk-title-cta {
    font-weight: 400;
    font-size: 12px;
    color: #f97316;
}

/* ======================= CONTAINER ======================= */
#ps-label-wrap {
    padding: 4px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ======================= STATUS CARDS ======================= */
.etyk-status-card {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    border-width: 1px;
    border-style: solid;
}

.etyk-status-card strong {
    white-space: nowrap;
}

.etyk-status-card--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.etyk-status-card--warning {
    background: #fefce8;
    border-color: #fde68a;
    color: #854d0e;
}

.etyk-status-card--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.etyk-status-card--info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.etyk-status-value {
    font-weight: 700;
}

.etyk-explorer-links {
    font-size: 10px;
    color: #94a3b8;
    margin-left: 6px;
}

.etyk-explorer-links a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.15s;
}

.etyk-explorer-links a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.etyk-wallet-links {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 3px;
}

.etyk-wallet-links a {
    color: #3b82f6;
    text-decoration: none;
}

/* ======================= CHECKLIST ======================= */
.etyk-checklist {
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.7;
}

.etyk-check {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 1px 0;
}

.etyk-check-icon {
    flex-shrink: 0;
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.etyk-check-label {
    color: #6b7280;
    white-space: nowrap;
    min-width: 90px;
}

.etyk-check-value {
    color: #111827;
    font-weight: 600;
}

.etyk-check-fail .etyk-check-fix {
    color: #dc2626;
    font-style: italic;
}

.etyk-check-divider {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e5e7eb;
}

/* ======================= TWO-COLUMN LAYOUT ======================= */
.etyk-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

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

.etyk-layout-mascot {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 4px;
}

/* ======================= HEADER ======================= */
.etyk-header {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
}

.etyk-header-info {
    flex: 1;
    min-width: 0;
}

.etyk-info {
    padding: 10px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 13px;
    color: #1e40af;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    height: 100%;
    align-items: center;
}

.etyk-info strong {
    color: #1e3a5f;
}

.etyk-mascot-link {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.etyk-mascot-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.etyk-mascot {
    width: 180px;
    height: auto;
    border-radius: 6px;
}

/* ======================= TIP BOX ======================= */
.etyk-tip {
    margin: 8px 0;
    padding: 8px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 11px;
    color: #1e40af;
}

/* ======================= SWITCH ======================= */
.etyk-switch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.etyk-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.etyk-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.etyk-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: background 0.2s;
}

.etyk-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.etyk-switch input:checked + .etyk-slider {
    background: #2563eb;
}

.etyk-switch input:checked + .etyk-slider::before {
    transform: translateX(20px);
}

/* ======================= STEPS ======================= */
#etyk-options {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

/* Size buttons */
.etyk-sizes {
    display: flex;
    gap: 8px;
}

.etyk-size-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 70px;
    background: #fff;
}

.etyk-size-btn:hover {
    border-color: #f97316;
    background: #fff7ed;
}

.etyk-size-btn.active {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: 0 0 0 1px #f97316;
}

.etyk-size-btn input {
    display: none;
}

.etyk-size-btn span {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
}

.etyk-size-btn small {
    font-size: 10px;
    color: #6b7280;
    margin-top: 2px;
}

/* Price row */
.etyk-price-row {
    padding: 10px 14px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 14px;
}

.etyk-price-label {
    font-weight: 600;
    color: #854d0e;
}

.etyk-price-value {
    font-weight: 800;
    font-size: 16px;
    color: #111827;
    margin: 0 6px;
}

/* Submit button */
#etyk-submit {
    margin-top: 10px;
    height: 42px;
    font-size: 14px;
    font-weight: 700;
    background: #f97316;
    border-color: #ea580c;
    color: #fff;
    border-radius: 8px;
    transition: background 0.15s;
}

#etyk-submit:hover {
    background: #ea580c;
}

.etyk-field {
    margin-bottom: 12px;
}

.etyk-field > label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
    color: #374151;
}

/* ======================= COMPLETED ======================= */
.etyk-completed {
    text-align: center;
    padding: 8px 0;
}

.etyk-success-badge {
    display: inline-block;
    padding: 8px 24px;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.etyk-details {
    text-align: left;
    margin: 0 auto 16px;
    border-collapse: collapse;
    font-size: 13px;
    max-width: 500px;
}

.etyk-details td {
    padding: 5px 12px 5px 0;
    vertical-align: top;
}

.etyk-details td:first-child {
    color: #6b7280;
    white-space: nowrap;
    font-weight: 500;
}

.etyk-details td:last-child {
    color: #111827;
}

.etyk-details a {
    color: #2563eb;
    text-decoration: none;
}

.etyk-details a:hover {
    text-decoration: underline;
}

.etyk-details code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #4b5563;
}

.etyk-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.etyk-actions .button-primary {
    background: #2563eb;
    border-color: #1d4ed8;
    border-radius: 6px;
    font-weight: 600;
    padding: 0 20px;
    height: 36px;
    line-height: 36px;
    transition: background 0.15s;
}

.etyk-actions .button-primary:hover {
    background: #1d4ed8;
}

.etyk-actions .button {
    border-radius: 6px;
    height: 36px;
    line-height: 34px;
}

/* ======================= PAYMENT AREA ======================= */
#etyk-step-payment {
    margin-top: 8px;
}

.etyk-countdown {
    font-size: 14px;
}

#etyk-timer {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 20px;
    font-weight: 700;
    color: #dc2626;
}

.etyk-status-indicator {
    padding: 16px;
    font-size: 14px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Pulsing dot */
.etyk-pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #f59e0b;
    border-radius: 50%;
    animation: etyk-pulse 1.5s ease-in-out infinite;
}

@keyframes etyk-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* Spinner */
.etyk-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: etyk-spin 0.6s linear infinite;
}

@keyframes etyk-spin {
    to { transform: rotate(360deg); }
}

/* ======================= TIMELINE ======================= */
.etyk-history {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.etyk-history summary {
    cursor: pointer;
    font-weight: 700;
    color: #111827;
    font-size: 13px;
    margin-bottom: 10px;
    user-select: none;
}

.etyk-history summary span {
    font-weight: 400;
    color: #94a3b8;
    font-size: 11px;
}

.etyk-timeline {
    position: relative;
    padding-left: 22px;
}

.etyk-timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #e5e7eb;
    border-radius: 1px;
}

.etyk-event {
    position: relative;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #fafafa;
    border-radius: 8px;
    border-left: 3px solid var(--etyk-event-color, #e5e7eb);
    transition: background 0.15s;
}

.etyk-event:hover {
    background: #f3f4f6;
}

.etyk-event-dot {
    position: absolute;
    left: -19px;
    top: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--etyk-event-color, #94a3b8);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e5e7eb;
}

.etyk-event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.etyk-event-title {
    font-weight: 600;
    font-size: 12px;
    color: #1f2937;
}

.etyk-event-time {
    font-size: 10px;
    color: #9ca3af;
    font-family: "SF Mono", monospace;
}

.etyk-event-detail {
    margin-top: 3px;
    font-size: 11px;
    color: #6b7280;
    word-break: break-all;
    line-height: 1.5;
}

.etyk-event-detail code {
    background: #f3f4f6;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
}

.etyk-event-detail a {
    color: #3b82f6;
    text-decoration: none;
}

.etyk-event-detail a:hover {
    text-decoration: underline;
}

/* ======================= INLINE CONFIG ======================= */
.etyk-inline-form {
    margin-top: 6px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.etyk-inline-form input {
    border-radius: 4px;
}

.etyk-inline-status {
    font-size: 11px;
    margin-left: 8px;
}

/* ======================= NOT READY ======================= */
.etyk-not-ready {
    text-align: center;
    padding: 12px;
    color: #6b7280;
    font-style: italic;
}

/* ======================= GENERATING ======================= */
.etyk-generating {
    padding: 24px;
    text-align: center;
}

/* ======================= RESPONSIVE ======================= */
@media (max-width: 782px) {
    .etyk-sizes {
        flex-direction: column;
    }
    .etyk-info {
        flex-direction: column;
        gap: 4px;
    }
    .etyk-details {
        font-size: 12px;
    }
}

/* ======================= GENERAL POLISH ======================= */

.etyk-history details summary:hover {
    color: #2563eb;
    transition: color 0.15s;
}

.etyk-check {
    vertical-align: middle;
    align-items: center;
}

.etyk-dropoff-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ======================= ONBOARDING ======================= */
.etyk-onboarding {
    margin: 0 0 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #fed7aa;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.12);
}

.etyk-onboarding-header {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 50%, #fdba74 100%);
    padding: 20px 24px;
    text-align: center;
}

.etyk-onboarding-header h2 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.etyk-onboarding-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.etyk-onboarding-body {
    background: #fff;
    padding: 20px 24px;
}

.etyk-onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.etyk-onboarding-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.etyk-onboarding-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
}

.etyk-onboarding-num--pending {
    background: #fff7ed;
    color: #f97316;
    border: 2px solid #fdba74;
}

.etyk-onboarding-num--done {
    background: #dcfce7;
    color: #16a34a;
    border: 2px solid transparent;
}

.etyk-onboarding-num--disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border: 2px solid #e5e7eb;
}

.etyk-onboarding-step-body {
    flex: 1;
    padding-top: 2px;
}

.etyk-onboarding-step-title {
    margin: 0 0 4px;
    font-weight: 700;
    font-size: 14px;
}

.etyk-onboarding-step-title--pending { color: #1a1a2e; }
.etyk-onboarding-step-title--done    { color: #16a34a; }
.etyk-onboarding-step-title--disabled { color: #9ca3af; }

.etyk-onboarding-step-desc {
    margin: 0 0 6px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.etyk-onboarding-step-done {
    margin: 0;
    font-size: 12px;
    color: #16a34a;
}

.etyk-onboarding-btn {
    font-size: 12px;
    padding: 4px 12px;
    background: #f97316;
    border-color: #ea580c;
    color: #fff;
}

/* ======================= GENERATING VIEW ======================= */
.etyk-gen-confirmed {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.etyk-gen-confirmed h3 {
    margin: 0 0 12px;
    color: #166534;
    font-size: 15px;
}

.etyk-gen-table {
    width: 100%;
    font-size: 13px;
    color: #166534;
    border-collapse: collapse;
}

.etyk-gen-table td {
    padding: 3px 0;
}

.etyk-gen-table td:first-child {
    font-weight: 600;
    white-space: nowrap;
    padding-right: 12px;
}

.etyk-gen-progress {
    background: #fffbeb;
    border: 2px solid #fde68a;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.etyk-gen-progress-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.etyk-gen-progress h3 {
    margin: 0 0 8px;
    color: #92400e;
    font-size: 14px;
}

.etyk-gen-progress p {
    margin: 0 0 8px;
    font-size: 12px;
    color: #78350f;
}

.etyk-gen-progress .etyk-gen-hint {
    margin: 0;
    font-size: 11px;
    color: #a16207;
}

.etyk-gen-spinner {
    margin-top: 12px;
}

.etyk-gen-spinner .spinner {
    float: none;
    margin: 0;
}

/* ======================= COMPLETED VIEW ======================= */
@keyframes etyk-pulse-btn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5); }
    50%      { box-shadow: 0 0 0 12px rgba(249, 115, 22, 0); }
}

.etyk-done-banner {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.etyk-done-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.etyk-done-header-icon {
    font-size: 32px;
    line-height: 1;
}

.etyk-done-header h3 {
    margin: 0;
    color: #166534;
    font-size: 16px;
    font-weight: 800;
}

.etyk-done-header p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #15803d;
}

.etyk-done-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    font-size: 12px;
    color: #166534;
    margin-bottom: 14px;
}

.etyk-done-grid strong {
    color: inherit;
}

.etyk-done-grid a {
    color: #166534;
    font-weight: 700;
    text-decoration: underline;
}

.etyk-done-grid-full {
    grid-column: 1 / -1;
}

.etyk-done-grid code {
    font-size: 10px;
    background: #d1fae5;
    padding: 1px 4px;
    border-radius: 3px;
}

.etyk-done-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.etyk-btn-download {
    background: #f97316;
    border-color: #ea580c;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    height: 46px;
    line-height: 44px;
    padding: 0 28px;
    border-radius: 10px;
    animation: etyk-pulse-btn 2s infinite;
    text-decoration: none;
}

.etyk-btn-download:hover,
.etyk-btn-download:focus {
    color: #fff;
    background: #ea580c;
}

.etyk-btn-print {
    height: 46px;
    line-height: 44px;
    font-size: 14px;
    border-radius: 10px;
    padding: 0 20px;
}

/* PDF preview */
.etyk-pdf-wrap {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.etyk-pdf-toolbar {
    background: #f8fafc;
    padding: 8px 14px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.etyk-pdf-toolbar span {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.etyk-pdf-toolbar .button {
    font-size: 12px;
    height: 30px;
    line-height: 28px;
    padding: 0 14px;
    background: #1d2327;
    color: #fff;
    border-color: #1d2327;
    border-radius: 6px;
}

.etyk-pdf-embed {
    width: 100%;
    height: 600px;
    display: block;
}

/* ======================= STEP 1: SIZE PICKER ======================= */
.etyk-warning-box {
    font-size: 11px;
    color: #666;
    margin: 0 0 8px;
    font-style: italic;
    background: #fffbeb;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #fde68a;
}

.etyk-size-btn {
    position: relative;
    flex: 1;
    padding: 8px 6px 10px;
    text-align: center;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    transition: all 0.15s;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.etyk-size-btn:hover {
    border-color: #f97316;
    background: #fff7ed;
}

.etyk-size-btn.active {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: 0 0 0 1px #f97316;
}

.etyk-size-radio {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
    accent-color: #f97316;
}

.etyk-size-letter {
    display: block;
    font-size: 22px;
    font-weight: 900;
    color: #1a1a2e;
}

.etyk-size-dims {
    display: block;
    color: #888;
    font-size: 10px;
    line-height: 1.3;
}

.etyk-size-maxkg {
    display: block;
    color: #aaa;
    font-size: 9px;
}

.etyk-size-price {
    display: block;
    margin-top: 4px;
    color: #f97316;
    font-size: 14px;
    font-weight: 800;
}

/* Weight slider */
.etyk-weight-label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    font-size: 12px;
}

.etyk-weight-val {
    font-weight: 700;
    color: #f97316;
    font-size: 13px;
}

.etyk-weight-range {
    width: 100%;
    accent-color: #f97316;
    height: 6px;
}

.etyk-weight-limits {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #ccc;
    margin-top: 1px;
}

/* ======================= STEP 2: RECEIVER FORM ======================= */
.etyk-recv-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
}

.etyk-field-group {
    margin-bottom: 6px;
}

.etyk-field-label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 2px;
}

.etyk-field-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}

.etyk-field-input:focus {
    border-color: #f97316;
    outline: none;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.etyk-field-static {
    padding: 6px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.etyk-field-static-sub {
    font-weight: 400;
    color: #94a3b8;
}

.etyk-recv-warning {
    padding: 8px 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 8px;
}

.etyk-recv-warning p {
    margin: 0;
    font-size: 11px;
    color: #991b1b;
    font-weight: 600;
}

.etyk-recv-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

#etyk-submit {
    height: 42px;
    font-size: 14px;
    font-weight: 700;
    background: #f97316;
    border-color: #ea580c;
    color: #fff;
    border-radius: 8px;
    transition: background 0.15s;
    flex: 1;
}

#etyk-submit:hover {
    background: #ea580c;
}

/* ======================= ERROR BANNER ======================= */
.etyk-error-banner-body {
    flex: 1;
}

#etyk-reset-btn {
    white-space: nowrap;
}

/* ======================= HISTORY ACCORDION ======================= */
.etyk-history {
    margin-top: 12px;
}

.etyk-history summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.etyk-history summary:hover {
    color: #2563eb;
    border-color: #bfdbfe;
    transition: all 0.15s;
}

.etyk-history summary .etyk-history-count {
    font-weight: 400;
    color: #94a3b8;
}

.etyk-history summary .etyk-history-arrow {
    margin-left: auto;
    font-size: 10px;
    color: #cbd5e1;
}

/* ======================= RESPONSIVE — WP Admin Mobile (782px) ======================= */

@media (max-width: 782px) {

    /* Layout: stack vertically, hide mascot */
    .etyk-layout {
        flex-direction: column;
    }

    .etyk-layout-mascot {
        display: none;
    }

    /* Size buttons: allow wrapping */
    .etyk-sizes {
        flex-wrap: wrap;
    }

    .etyk-size-btn {
        min-width: 80px;
    }

    /* Checklist items: stack label + value */
    .etyk-checklist .etyk-check {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .etyk-checklist .etyk-check-label {
        min-width: unset;
    }

    /* Action buttons: full-width stacked */
    .etyk-actions,
    .etyk-done-actions,
    .etyk-recv-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .etyk-actions .button,
    .etyk-actions .button-primary,
    .etyk-done-actions .button,
    .etyk-done-actions a {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    /* Status card: tighter on mobile */
    .etyk-status-card {
        padding: 8px 10px;
        font-size: 11px;
    }

    /* PDF preview: shorter */
    .etyk-pdf-embed {
        height: 300px;
    }

    /* Completed view grid: single column */
    .etyk-done-grid {
        grid-template-columns: 1fr;
    }

    /* Dropoff row: wrap on small screens */
    .etyk-dropoff-row {
        flex-wrap: wrap;
    }

    /* Onboarding: tighter padding */
    .etyk-onboarding-header {
        padding: 16px;
    }

    .etyk-onboarding-body {
        padding: 16px;
    }
}

/* ======================= UNIFIED FORM FIELDS ======================= */
/* Override inline styles from VPS metabox — consistent WC-native styling. */
#etyk-step-receiver h4 {
    margin: 0 0 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

#etyk-step-receiver > div {
    margin-bottom: 10px !important;
}

#etyk-step-receiver label {
    display: block !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 4px !important;
}

#etyk-step-receiver input[type="text"],
#etyk-step-receiver input[type="email"],
#etyk-step-receiver input[type="tel"] {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #111827 !important;
    background: #fff !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    box-sizing: border-box !important;
}

#etyk-step-receiver input:focus {
    border-color: #f97316 !important;
    box-shadow: 0 0 0 2px rgba(249,115,22,0.15) !important;
    outline: none !important;
}

/* Destination locker readonly field */
#etyk-step-receiver > div:last-of-type > div:not(.etyk-status-card) {
    padding: 8px 12px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}

#etyk-step-receiver > div:last-of-type > div span {
    font-weight: 400 !important;
    color: #94a3b8 !important;
}

/* Receiver action buttons */
#etyk-step-receiver #etyk-back-to-size {
    margin-right: 8px;
}

#etyk-step-receiver #etyk-submit {
    height: 44px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    background: #f97316 !important;
    border-color: #ea580c !important;
    color: #fff !important;
    border-radius: 8px !important;
    padding: 0 24px !important;
    box-shadow: 0 2px 8px rgba(249,115,22,0.25) !important;
}

#etyk-step-receiver #etyk-submit:hover {
    background: #ea580c !important;
    box-shadow: 0 4px 12px rgba(249,115,22,0.35) !important;
}

/* ======================= UNIFIED SPACING ======================= */
/* Fix inconsistent padding/margins in metabox sections */
.etyk-status-card {
    margin-bottom: 10px;
    padding: 12px 16px;
}

.etyk-checklist {
    padding: 12px 16px;
}

#etyk-options {
    margin-top: 16px;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
}

/* Size buttons — override inline styles */
.etyk-sizes .etyk-size-btn {
    position: relative !important;
    flex: 1 !important;
    padding: 12px 8px 14px !important;
    text-align: center !important;
    cursor: pointer !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px !important;
    background: #fff !important;
    transition: all 0.15s !important;
}

.etyk-sizes .etyk-size-btn input[type="radio"] {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    margin: 0 !important;
    accent-color: #f97316 !important;
}

/* ======================= WEIGHT SLIDER — hidden by default ======================= */
#etyk-weight-section {
    display: none;
}
#etyk-weight-section.etyk-weight-visible {
    display: block;
}

/* ======================= GREEN CONFIRMED SIZE — REFINED ======================= */
@keyframes etyk-size-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.04); }
    100% { transform: scale(1); }
}

.etyk-size-btn.etyk-size-confirmed {
    border-color: #86efac !important;
    background: #f0fdf4 !important;
    box-shadow: 0 0 0 1px #86efac, 0 2px 8px rgba(34,197,94,0.12) !important;
    animation: etyk-size-pop 0.35s ease-out !important;
}

.etyk-size-btn.etyk-size-confirmed::after {
    content: "\2713";
    position: absolute;
    top: 6px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(34,197,94,0.3);
    animation: etyk-check-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes etyk-check-in {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.etyk-size-btn.etyk-size-confirmed strong {
    color: #16a34a !important;
}

/* PSCP crypto widget — NOT overridden. Zero CSS changes to payment plugin. */

/* ======================= GENERATING STATE ======================= */
.etyk-gen-confirmed {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.etyk-gen-confirmed h3 {
    margin: 0 0 12px;
    color: #166534;
    font-size: 15px;
}

.etyk-gen-confirmed table {
    width: 100%;
    font-size: 13px;
    color: #166534;
}

.etyk-gen-confirmed table td {
    padding: 3px 0;
}

.etyk-gen-confirmed table td:first-child {
    font-weight: 600;
    width: 100px;
}

.etyk-gen-spinner {
    background: #fffbeb;
    border: 2px solid #fde68a;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.etyk-gen-spinner h3 {
    margin: 0 0 8px;
    color: #92400e;
    font-size: 14px;
}

.etyk-gen-spinner p {
    margin: 0 0 8px;
    font-size: 12px;
    color: #78350f;
}

.etyk-gen-spinner .etyk-safe-refresh {
    font-size: 11px;
    color: #a16207;
}

/* ======================= COMPLETED STATE ======================= */
.etyk-done-banner {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.etyk-done-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.etyk-done-header h3 {
    margin: 0;
    color: #166534;
    font-size: 16px;
    font-weight: 800;
}

.etyk-done-header p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #15803d;
}

.etyk-done-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    font-size: 12px;
    color: #166534;
    margin-bottom: 14px;
}

.etyk-done-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes etyk-pulse-dl {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.5); }
    50%      { box-shadow: 0 0 0 12px rgba(249,115,22,0); }
}

.etyk-btn-download {
    background: #f97316 !important;
    border-color: #ea580c !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    height: 46px !important;
    line-height: 44px !important;
    padding: 0 28px !important;
    border-radius: 10px !important;
    animation: etyk-pulse-dl 2s infinite !important;
    text-decoration: none !important;
}

.etyk-btn-download:hover {
    animation: none !important;
    box-shadow: 0 6px 18px rgba(249,115,22,0.4) !important;
}

.etyk-btn-print {
    height: 46px !important;
    line-height: 44px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    padding: 0 20px !important;
}

.etyk-label-preview {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.etyk-label-preview-header {
    background: #f8fafc;
    padding: 8px 14px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.etyk-tx-code {
    font-size: 10px;
    background: #d1fae5;
    padding: 1px 4px;
    border-radius: 3px;
}

/* ======================= UNIFORM SPACING ======================= */
/* Consistent padding and margins across all metabox states */
.etyk-layout-main > div,
.etyk-layout-main > .etyk-status-card {
    margin-bottom: 10px;
}

.etyk-layout-main > div:last-child {
    margin-bottom: 0;
}

/* Generating + Completed states — normalize inline-styled divs */
.etyk-layout-main > div[style*="background:#f0fdf4"],
.etyk-layout-main > div[style*="background:linear-gradient"] {
    border-radius: 10px;
    margin-bottom: 12px;
}

.etyk-layout-main table td {
    padding: 4px 0;
}

/* Warning tip */
.etyk-tip {
    font-size: 11px;
    margin: 6px 0 10px;
}

/* ======================= PREPARE LABEL BUTTON — PULSATING ======================= */
@keyframes etyk-pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(249,115,22,0.3), 0 0 0 0 rgba(249,115,22,0.4); }
    50%      { box-shadow: 0 6px 18px rgba(249,115,22,0.4), 0 0 0 10px rgba(249,115,22,0); }
}

#etyk-toggle {
    width: 100% !important;
    height: 52px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    border-color: #c2410c !important;
    color: #fff !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    margin-bottom: 12px !important;
    animation: etyk-pulse 2s ease-in-out infinite !important;
    transition: all 0.2s !important;
    letter-spacing: 0.02em !important;
}

#etyk-toggle:hover {
    transform: translateY(-2px) !important;
    animation: none !important;
    box-shadow: 0 8px 24px rgba(249,115,22,0.45) !important;
}

#etyk-toggle.etyk-cancel-mode {
    animation: none !important;
    background: #64748b !important;
    border-color: #475569 !important;
    box-shadow: none !important;
}

/* ======================= GREEN SELECTED SIZE ======================= */
.etyk-size-btn.etyk-size-confirmed {
    border-color: #22c55e !important;
    background: #f0fdf4 !important;
    box-shadow: 0 0 0 2px #22c55e !important;
    position: relative;
}

.etyk-size-btn.etyk-size-confirmed::after {
    content: "\2713";
    position: absolute;
    top: 4px;
    left: 6px;
    width: 20px;
    height: 20px;
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.etyk-size-btn.etyk-size-confirmed strong {
    color: #16a34a !important;
}

/* ======================= CRYPTO PAYMENT OPTIONS ======================= */
.etyk-crypto-options {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: etyk-crypto-in 0.4s ease-out;
}

@keyframes etyk-crypto-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

.etyk-crypto-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.etyk-crypto-card:hover {
    border-color: #7c3aed;
    background: #faf5ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124,58,237,0.12);
}

.etyk-crypto-card.etyk-crypto-sol { border-left: 4px solid #9945FF; }
.etyk-crypto-card.etyk-crypto-eth { border-left: 4px solid #627EEA; }
.etyk-crypto-card.etyk-crypto-btc { border-left: 4px solid #F7931A; }

.etyk-crypto-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    flex-shrink: 0;
    color: #fff;
}

.etyk-crypto-sol .etyk-crypto-icon { background: linear-gradient(135deg, #9945FF, #14F195); }
.etyk-crypto-eth .etyk-crypto-icon { background: linear-gradient(135deg, #627EEA, #3C3C3D); }
.etyk-crypto-btc .etyk-crypto-icon { background: linear-gradient(135deg, #F7931A, #E8821A); }

.etyk-crypto-info {
    flex: 1;
    min-width: 0;
}

.etyk-crypto-name {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.etyk-crypto-time {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.4;
}

.etyk-crypto-time.etyk-crypto-warning {
    color: #dc2626;
    font-weight: 600;
}

.etyk-crypto-price {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
    flex-shrink: 0;
}
