* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px 48px;
}

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px 28px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* ── Header ── */
.header {
    text-align: center;
    margin-bottom: 28px;
}

.header-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
}

.header p {
    font-size: 0.82rem;
    color: #9ca3af;
    margin-top: 3px;
}

/* ── Inputs ── */
.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.input-wrap {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    font-weight: 500;
    pointer-events: none;
}

input[type="number"] {
    width: 100%;
    padding: 12px 14px 12px 26px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    color: #111827;
    font-size: 1.05rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.15s;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

input[type="number"]:focus {
    border-color: #6366f1;
    background: #fff;
}

input[type="number"]::placeholder {
    color: #d1d5db;
}

/* ── Field note ── */
.field-note {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 6px;
    line-height: 1.5;
}


/* ── Calc button ── */
.btn-calc {
    width: 100%;
    padding: 14px;
    background: #111827;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.2px;
}

.btn-calc:hover {
    background: #1f2937;
}

.btn-calc:active {
    transform: scale(0.98);
    background: #374151;
}

/* ── Divider ── */
.divider {
    height: 1px;
    background: #f3f4f6;
    margin: 24px 0;
}

/* ── Result ── */
.result {
    display: none;
}

.result.visible {
    display: block;
}

.result-box {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.result-row:last-child {
    border-bottom: none;
}

.result-row .lbl {
    font-size: 0.88rem;
    color: #6b7280;
}

.result-row .val {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.result-row.fee-row .val {
    color: #f97316;
}

.result-row.grand-row {
    background: #111827;
}

.result-row.grand-row .lbl {
    font-size: 0.9rem;
    font-weight: 600;
    color: #9ca3af;
}

.result-row.grand-row .val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
}

/* ── Copy button ── */
.btn-copy {
    width: 100%;
    margin-top: 14px;
    padding: 13px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 10px;
    color: #16a34a;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, transform 0.1s;
}

.btn-copy:hover {
    background: #dcfce7;
}

.btn-copy:active {
    transform: scale(0.98);
}

.btn-copy.copied {
    background: #dcfce7;
    color: #15803d;
    border-color: #4ade80;
}

/* ── Preview text ── */
.preview-text {
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.83rem;
    color: #6b7280;
    line-height: 1.7;
    white-space: pre;
}

/* ── Note ── */
.note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: #92400e;
    line-height: 1.5;
}

.note-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Reset link ── */
.reset-wrap {
    text-align: center;
    margin-top: 16px;
}

.reset-link {
    background: none;
    border: none;
    color: #d1d5db;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.reset-link:hover {
    color: #9ca3af;
}
