/* calculator styles. Extracted from tools/calculator.blade.php. */

.h-btn--sm { padding: 10px 16px; font-size: 13.5px; }

/* Hero */
.h-hero { position: relative; padding: 64px 0 48px; background: var(--bg-white); overflow: hidden; }
.h-hero__grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(59,130,246,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(59,130,246,0.06) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); z-index: 0; }
.h-hero__glow { position: absolute; width: 460px; height: 460px; border-radius: 50%; filter: blur(120px); opacity: 0.26; z-index: 0; pointer-events: none; }
.h-hero__glow--a { background: var(--primary-light); top: -160px; right: -120px; }
.h-hero__glow--b { background: var(--accent); bottom: -180px; left: -120px; opacity: .18; }
[dir="rtl"] .h-hero__glow--a { right: auto; left: -120px; }
[dir="rtl"] .h-hero__glow--b { left: auto; right: -120px; }
.h-hero__inner { position: relative; z-index: 1; max-width: 760px; text-align: center; margin: 0 auto; }
.h-chip--ghost { margin-bottom: 20px; }
.h-hero__title { font-size: clamp(32px, 5vw, 50px); font-weight: 800; line-height: 1.12; letter-spacing: -0.025em; color: var(--text-dark); margin: 0 0 16px; }
.h-hero__lede { font-size: 17px; line-height: 1.65; color: var(--text-light); margin: 0 auto; max-width: 600px; }
@media (max-width: 640px) { .h-hero { padding: 44px 0 32px; } }

/* Section */
.h-tools-section { padding: 40px 0 80px; background: var(--bg-light); }
@media (max-width: 640px) { .h-tools-section { padding: 32px 0 56px; } }

/* ===== CALCULATOR SHELL ===== */
.h-calc {
    max-width: 760px;
    margin: 0 auto;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    box-shadow: var(--h-card-shadow);
    overflow: hidden;
}
.h-calc__tabs {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}
.h-calc__tab {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 700;
    color: var(--text-medium);
    cursor: pointer;
    transition: all .25s var(--h-ease);
    font-family: inherit;
}
.h-calc__tab i { font-size: 13px; }
.h-calc__tab:hover { background: var(--bg-white); color: var(--primary); }
.h-calc__tab.is-active { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(30,64,175,.22); }
@media (max-width: 520px) {
    .h-calc__tab { flex-direction: column; gap: 4px; padding: 10px 4px; font-size: 12px; }
}

.h-calc__panel { padding: 24px; }
.h-calc__panel[hidden] { display: none; }
.h-calc__hint { font-size: 13px; color: var(--text-light); margin: 0 0 16px; text-align: center; }

/* Display */
.h-calc__display {
    position: relative;
    background: #0f172a;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 16px;
    text-align: right;
    overflow: hidden;
}
[dir="rtl"] .h-calc__display { text-align: left; direction: ltr; }
.h-calc__expr {
    font-size: 14px;
    color: #94a3b8;
    min-height: 20px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    word-break: break-all;
    line-height: 1.4;
}
.h-calc__result {
    font-size: 38px;
    font-weight: 700;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    word-break: break-all;
    line-height: 1.2;
    margin-top: 4px;
}
.h-calc__display--acc .h-calc__expr { color: #94a3b8; text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; }
.h-calc__badges {
    position: absolute;
    top: 14px; left: 18px;
    display: flex; gap: 8px; align-items: center;
}
[dir="rtl"] .h-calc__badges { left: auto; right: 18px; }
.h-calc__memind {
    background: var(--primary-light);
    color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}
.h-calc__angle {
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,.2);
    font-size: 11px; font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s ease;
}
.h-calc__angle:hover { background: rgba(255,255,255,.22); }

/* Scientific keys */
.h-calc__sci {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}
.h-calc__sci[hidden] { display: none; }
@media (max-width: 520px) { .h-calc__sci { grid-template-columns: repeat(4, 1fr); } }

/* Keypad */
.h-calc__keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.h-key {
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    border-radius: 12px;
    padding: 16px 0;
    font-size: 18px; font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all .15s var(--h-ease);
    font-family: inherit;
    user-select: none;
}
.h-key:hover { background: var(--bg-light); border-color: var(--primary-light); transform: translateY(-1px); }
.h-key:active { transform: scale(.96); }
.h-key--fn { font-size: 13px; padding: 12px 0; background: var(--bg-light); color: var(--primary); font-weight: 700; }
.h-key--op { background: rgba(59,130,246,.08); color: var(--primary); font-weight: 700; }
.h-key--util { background: var(--bg-light); color: var(--text-medium); font-size: 16px; }
.h-key--mem { background: var(--bg-lighter); color: var(--text-light); font-size: 13px; font-weight: 700; padding: 12px 0; }
.h-key--eq { background: var(--primary); color: #fff; font-weight: 800; box-shadow: 0 6px 14px rgba(30,64,175,.25); }
.h-key--eq:hover { background: var(--primary-dark); }
.h-key--add { background: #dcfce7; color: #15803d; font-size: 14px; font-weight: 700; }
.h-key--sub { background: #fee2e2; color: #b91c1c; font-size: 14px; font-weight: 700; }

/* History */
.h-calc__history { margin-top: 18px; border-top: 1px solid var(--border-light); padding-top: 14px; }
.h-calc__history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.h-calc__history-head span { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.06em; display: inline-flex; align-items: center; gap: 6px; }
.h-calc__history-head i { font-size: 11px; color: var(--primary); }
.h-calc__mini-btn { background: var(--bg-light); border: 1px solid var(--border-light); color: var(--text-medium); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: all .2s ease; font-family: inherit; }
.h-calc__mini-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.h-calc__history-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow-y: auto; }
.h-calc__history-list li { font-family: ui-monospace, monospace; font-size: 13px; color: var(--text-medium); padding: 8px 12px; background: var(--bg-light); border-radius: 8px; cursor: pointer; transition: background .2s ease; word-break: break-all; }
.h-calc__history-list li:hover { background: var(--bg-lighter); }
.h-calc__history-list li b { color: var(--text-dark); }

/* ===== ACCOUNTANT ===== */
.h-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 680px) { .h-acc { grid-template-columns: 1fr; } }
.h-acc__totals { margin-bottom: 14px; }
.h-acc__total { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: rgba(59,130,246,.08); border-radius: 10px; }
.h-acc__total span { font-size: 12px; font-weight: 700; color: var(--text-medium); text-transform: uppercase; letter-spacing: 0.06em; }
.h-acc__total strong { font-size: 20px; font-weight: 800; color: var(--primary); font-family: ui-monospace, monospace; }
.h-acc__keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.h-acc__keys .h-key--add, .h-acc__keys .h-key--sub { grid-column: span 3; padding: 14px 0; }
@media (max-width: 680px) { .h-acc__keys .h-key--add, .h-acc__keys .h-key--sub { grid-column: span 3; } }

.h-acc__tape { background: var(--bg-light); border: 1px solid var(--border-light); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; }
.h-acc__tape-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.h-acc__tape-head span { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.06em; display: inline-flex; align-items: center; gap: 6px; }
.h-acc__tape-head i { color: var(--primary); font-size: 11px; }
.h-acc__tape-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; flex-grow: 1; max-height: 300px; overflow-y: auto; }
.h-acc__tape-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--bg-white); border-radius: 8px; font-family: ui-monospace, monospace; font-size: 14px; }
.h-acc__tape-list li .op { font-weight: 800; }
.h-acc__tape-list li.add .op { color: #15803d; }
.h-acc__tape-list li.sub .op { color: #b91c1c; }
.h-acc__tape-list li .val { color: var(--text-dark); font-weight: 600; }
.h-acc__tape-empty { background: transparent !important; color: var(--text-light) !important; font-family: inherit !important; font-size: 13px !important; text-align: center; padding: 24px 12px !important; }

.h-acc__tools { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
@media (max-width: 680px) { .h-acc__tools { grid-template-columns: 1fr; } }
.h-acc__card { background: var(--bg-light); border: 1px solid var(--border-light); border-radius: 14px; padding: 20px; }
.h-acc__card-title { font-size: 14px; font-weight: 800; color: var(--text-dark); margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.h-acc__card-title i { color: var(--primary); font-size: 13px; }
.h-acc__field { margin-bottom: 12px; }
.h-acc__field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-medium); margin-bottom: 5px; }
.h-acc__field input { width: 100%; padding: 11px 13px; border: 1px solid var(--border-light); border-radius: 10px; font: inherit; font-size: 15px; color: var(--text-dark); background: var(--bg-white); transition: all .2s ease; }
.h-acc__field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.14); }
.h-acc__btns { display: flex; gap: 8px; margin-bottom: 14px; }
.h-acc__btns .h-btn { flex: 1; justify-content: center; }
.h-acc__results { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px dashed var(--border-medium); }
.h-acc__results[hidden] { display: none; }
.h-acc__res-row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.h-acc__res-row span { color: var(--text-medium); }
.h-acc__res-row strong { color: var(--text-dark); font-family: ui-monospace, monospace; font-weight: 600; }
.h-acc__res-row--total { padding-top: 6px; border-top: 1px solid var(--border-light); }
.h-acc__res-row--total span { font-weight: 700; }
.h-acc__res-row--total strong { color: var(--primary); font-size: 16px; font-weight: 800; }

/* CTA */
.h-cta { position: relative; padding: 80px 0; overflow: hidden; color: #fff; }
.h-cta__bg { position: absolute; inset: 0; background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%); z-index: 0; }
.h-cta__bg::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle at 18% 24%, rgba(255,255,255,.18) 0%, transparent 40%), radial-gradient(circle at 82% 76%, rgba(255,255,255,.12) 0%, transparent 40%); }
.h-cta__inner { position: relative; z-index: 1; text-align: center; max-width: 700px; margin: 0 auto; padding: 0 20px; }
.h-cta__icon { width: 64px; height: 64px; margin: 0 auto 20px; background: rgba(255,255,255,.18); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.25); border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff; }
.h-cta__title { font-size: clamp(26px, 4vw, 38px); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; color: #fff; }
.h-cta__desc { font-size: 16px; line-height: 1.6; color: rgba(255,255,255,.9); margin: 0 0 28px; }
.h-cta__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
