/* ===== Dialog Overlay ===== */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ===== Dialog Box ===== */
.dialog-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    min-width: 320px;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dialog-box-numpad {
    min-width: 340px;
    max-width: 400px;
}

/* ===== Header ===== */
.dialog-header {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

/* ===== Message ===== */
.dialog-message {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* ===== Detail ===== */
.dialog-detail {
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 6px;
}

/* ===== Actions ===== */
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ===== Buttons ===== */
.dialog-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.dialog-btn:hover {
    opacity: 0.85;
}

.dialog-btn-cancel {
    background: #e5e7eb;
    color: #374151;
}

.dialog-btn-valid {
    background: #2563eb;
    color: #fff;
}

/* ===== Numpad Display ===== */
.numpad-display {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 28px;
    font-weight: 700;
    text-align: right;
    color: #1a1a2e;
    margin-bottom: 16px;
    min-height: 52px;
    font-variant-numeric: tabular-nums;
}

/* ===== Numpad Grid ===== */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.numpad-btn {
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 600;
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
    -webkit-user-select: none;
}

.numpad-btn:hover:not(:disabled) {
    background: #f3f4f6;
}

.numpad-btn:active:not(:disabled) {
    background: #e5e7eb;
}

.numpad-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.numpad-btn-backspace {
    font-size: 22px;
    color: #dc2626;
}

/* ===== Numpad Extra Row ===== */
.numpad-extra-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.numpad-btn-action {
    flex: 1;
    font-size: 14px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
}

/* ===== ConfirmInputDialog ===== */
.cfm-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: #F0FDF4; color: #22C55E;
    display: flex; align-items: center; justify-content: center;
}
.cfm-text { font-size: 16px; font-weight: 600; color: #111; text-align: center; line-height: 1.5; }
.cfm-detail { font-size: 14px; color: #6B7280; text-align: center; line-height: 1.5; }

/* ===== NumberInputDialog (new) ===== */
.num-message { font-size: 14px; color: #6B7280; text-align: center; padding: 0 8px; }
.num-screen {
    background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 14px;
    padding: 20px 16px;
    display: flex; align-items: center; justify-content: center;
}
.num-value {
    font-size: 40px; font-weight: 700; color: #111;
    letter-spacing: 3px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}
.num-sign-btn {
    width: 100%; min-height: 44px;
    border-radius: 12px; border: 1px solid rgba(0,0,0,0.10);
    background: #F4F3EF; cursor: pointer;
    font-size: 18px; font-weight: 600; color: #555;
    touch-action: manipulation; transition: all .12s;
}
.num-sign-btn:hover { background: #E8E6DF; color: #111; }
.num-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.num-key {
    height: 58px; border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fff; cursor: pointer;
    font-size: 22px; font-weight: 600; color: #111;
    touch-action: manipulation; transition: all .1s;
    display: flex; align-items: center; justify-content: center;
}
.num-key:hover { background: #F3F4F6; }
.num-key:active { background: #E5E7EB; transform: scale(0.96); }
.num-key--fn { background: #F4F3EF; color: #6B7280; font-size: 18px; }
.num-key--fn:hover { background: #E8E6DF; color: #111; }

/* ===== ChoiceDialog (new) ===== */
.ch-message { font-size: 14px; color: #6B7280; text-align: center; padding: 0 8px; }
.ch-list { display: grid; gap: 8px; }
.ch-item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 60px; padding: 14px 16px; border-radius: 12px;
    border: 2px solid rgba(0,0,0,0.08); background: #fff;
    cursor: pointer; transition: all .12s; touch-action: manipulation; color: #333;
}
.ch-item:hover { border-color: rgba(0,0,0,0.15); background: #FAFAF8; }
.ch-item--on { border-color: #2563EB; background: #EFF6FF; }
.ch-item--on .ch-name { color: #1D4ED8; }
.ch-check { position: absolute; top: 8px; right: 10px; color: #2563EB; }
.ch-img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; }
.ch-name { font-size: 15px; font-weight: 600; color: #111; }
.ch-desc { font-size: 12px; color: #9CA3AF; }
.ch-item--on .ch-desc { color: #6B7280; }

/* ===== EntryInputDialog (new) ===== */
.entry-dlg-box { max-width: min(680px, 95vw); width: 100%; }
.display-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 16px; gap: 12px; }
.entry-display {
    flex: 1; font-size: 24px; font-weight: 600; color: #111;
    border: none; background: transparent;
    font-family: 'SF Mono', Monaco, monospace; outline: none;
}
.entry-backspace {
    width: 48px; height: 48px; border-radius: 12px;
    background: transparent; border: none; cursor: pointer; color: #6B7280;
    display: flex; align-items: center; justify-content: center; touch-action: manipulation;
}
.entry-backspace:hover { background: rgba(0,0,0,0.05); color: #111; }
.pad-card { padding: 12px; }
.keyboard { display: flex; flex-direction: column; gap: 8px; }
.kb-row { display: flex; justify-content: center; gap: 6px; }
.kb-key {
    min-width: 36px; min-height: 48px; border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.10); background: #fff; cursor: pointer;
    font-size: 18px; font-weight: 500; color: #111;
    touch-action: manipulation; transition: all .12s;
    display: flex; align-items: center; justify-content: center;
    flex: 1; max-width: 48px;
}
.kb-key:hover { background: #F3F4F6; border-color: rgba(0,0,0,0.15); }
.kb-key:active { background: #E5E7EB; }
.kb-key--wide { min-width: 120px; max-width: none; flex: 2; }
.kb-key--secondary { background: #FAFAF8; color: #6B7280; font-size: 14px; }
.kb-key--secondary:hover { background: #E5E7EB; color: #111; }

/* ===== EditorInputDialog ===== */
.input-card { padding: 12px; }
.editor-row { display: flex; gap: 8px; align-items: stretch; }
.editor-input {
    flex: 1; resize: vertical;
    padding: 12px 14px; border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.12); background: #fff;
    font-size: 16px; color: #111; font-family: inherit;
}
.editor-input:focus { outline: none; border-color: #111; }
.clear-btn {
    width: 44px; border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.10); background: #FAFAF8;
    cursor: pointer; color: #6B7280;
    display: flex; align-items: center; justify-content: center; touch-action: manipulation;
}
.clear-btn:hover { background: #FEE2E2; color: #EF4444; border-color: rgba(239,68,68,0.3); }

/* ===== InfoInputDialog (new) ===== */
.info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; background: #fff;
    border-bottom: 1px solid #F3F4F6; font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: #6b7280; font-weight: 500; flex: 1; }
.info-value { color: #1f2937; font-weight: 600; text-align: right; flex: 1; }

/* ===== ChoiceDialog (legacy — keep for compat) ===== */
.choice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.choice-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}

.choice-item:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.choice-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.choice-label {
    flex: 1;
}

/* ===== EntryInputDialog ===== */
.entry-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #1f2937;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
    margin-top: 4px;
}

.entry-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ===== InfoInputDialog ===== */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 12px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #6b7280;
    font-weight: 500;
    flex: 1;
}

.info-value {
    color: #1f2937;
    font-weight: 600;
    text-align: right;
    flex: 1;
}
