/* ── Military Time Converter ────────────────────────────────────── */

.mtc-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 860px;
    margin: 2rem auto;
    background: #f7fee7;
    border: 1.5px solid #bef264;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 32px rgba(77,124,15,0.12);
    color: #1a2e05;
    box-sizing: border-box;
}
.mtc-wrap *, .mtc-wrap *::before, .mtc-wrap *::after { box-sizing: border-box; }

/* ── Header ── */
.mtc__header {
    background: linear-gradient(135deg, #1a2e05 0%, #365314 40%, #4d7c0f 75%, #65a30d 100%);
    padding: clamp(1.4rem, 4vw, 2rem) clamp(1.2rem, 4vw, 2rem);
}
.mtc__header h2 {
    font-size: clamp(1.3rem, 4vw, 1.8rem) !important;
    font-weight: 900 !important; color: #fff !important;
    margin: 0 0 0.25rem 0 !important; letter-spacing: -0.01em;
}
.mtc__header p { font-size: 0.9rem; color: #d9f99d; margin: 0; }

/* ── Body: two cards side by side ── */
.mtc__body {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 0;
}

.mtc__card {
    flex: 1;
    padding: clamp(1.2rem, 3vw, 1.75rem);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.mtc__card-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #4d7c0f;
    border-bottom: 2px solid #ecfccb;
    padding-bottom: 0.5rem;
}

.mtc__label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a2e05;
    margin-bottom: 0.4rem;
}

/* ── Time row (hour : min AM/PM) ── */
.mtc__time-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.mtc__colon {
    font-size: 1.4rem;
    font-weight: 900;
    color: #bef264;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Inputs ── */
.mtc__input-row {
    display: flex;
    align-items: center;
    border: 2px solid #bef264;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
    flex: 1;
}
.mtc__input-row:focus-within {
    border-color: #65a30d;
    box-shadow: 0 0 0 3px rgba(101,163,13,0.15);
}
.mtc__select {
    flex: 1; border: none; outline: none;
    padding: 0.65rem 0.6rem; font-size: 1rem;
    color: #1a2e05; background: transparent; font-weight: 600;
    cursor: pointer; font-family: inherit;
    appearance: none; -webkit-appearance: none; width: 100%;
}
.mtc__input {
    flex: 1; border: none; outline: none;
    padding: 0.65rem 0.75rem; font-size: 1rem;
    color: #1a2e05; background: transparent; font-weight: 600;
    width: 100%;
}
.mtc__input--large {
    font-size: 1.3rem; font-weight: 800; letter-spacing: 4px;
    font-family: 'Courier New', Courier, monospace;
}
.mtc__input--large::placeholder { letter-spacing: 2px; font-size: 1rem; color: #94a3b8; font-weight: 400; }
.mtc__unit {
    background: #ecfccb; color: #4d7c0f;
    padding: 0.65rem 0.75rem; font-size: 0.85rem;
    font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.mtc__error { margin: 0; font-size: 12px; color: #ef4444; }

/* ── AM/PM Toggle ── */
.mtc__ampm-toggle {
    display: flex;
    border: 2px solid #bef264;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}
.mtc__ampm-btn {
    padding: 0.65rem 0.75rem; border: none;
    font-size: 13px; font-weight: 800; cursor: pointer;
    font-family: inherit; background: #fff; color: #94a3b8; transition: all 0.15s;
}
.mtc__ampm-btn--active { background: #4d7c0f; color: #fff; }
.mtc__ampm-btn:hover:not(.mtc__ampm-btn--active) { background: #f7fee7; color: #4d7c0f; }

/* ── Arrow ── */
.mtc__arrow { text-align: center; font-size: 1.4rem; color: #4d7c0f; line-height: 1; }

/* ── Result box ── */
.mtc__result-box {
    background: #f7fee7;
    border: 2px solid #bef264;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mtc__result-box.mtc--has-value {
    background: #ecfccb;
    border-color: #84cc16;
}
.mtc__result-main { display: flex; align-items: baseline; gap: 0.5rem; }
.mtc__result-val {
    font-size: 1.7rem; font-weight: 900; color: #365314;
    font-family: 'Courier New', Courier, monospace; letter-spacing: 3px; line-height: 1;
}
.mtc__result-unit { font-size: 0.9rem; font-weight: 700; color: #4d7c0f; }
.mtc__result-spoken {
    font-size: 0.78rem; font-style: italic; color: #65a30d; font-weight: 600;
}

/* ── Formula note ── */
.mtc__formula {
    font-size: 0.75rem; color: #64748b; line-height: 1.6;
    background: #f8fafc; border-left: 3px solid #bef264;
    padding: 0.5rem 0.75rem; border-radius: 0 6px 6px 0;
}

/* ── Clear button ── */
.mtc__clear-btn {
    align-self: flex-start; background: none;
    border: 1.5px solid #cbd5e1; border-radius: 7px;
    padding: 0.35rem 0.85rem; font-size: 0.78rem;
    color: #64748b; cursor: pointer; transition: all 0.15s; font-weight: 600;
    font-family: inherit;
}
.mtc__clear-btn:hover { border-color: #ef4444; color: #ef4444; background: #fff5f5; }

/* ── Divider between cards ── */
.mtc__divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-width: 48px;
    background: #f7fee7;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #4d7c0f;
    border-left: 1px solid #ecfccb;
    border-right: 1px solid #ecfccb;
}

/* ── Reference table ── */
.mtc__table-section {
    padding: clamp(1rem, 3vw, 1.5rem);
    background: #fff;
    border-top: 1.5px solid #ecfccb;
}
.mtc__table-title {
    font-size: clamp(0.9rem, 2.5vw, 1rem) !important;
    font-weight: 800 !important; color: #1a2e05 !important; margin: 0 0 0.85rem !important;
}
.mtc__table-wrap { overflow-x: auto; }
.mtc__table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.mtc__table thead tr { background: linear-gradient(90deg, #1a2e05, #4d7c0f); }
.mtc__table thead th {
    color: #fff; padding: 0.6rem 1rem; text-align: left;
    font-weight: 700; font-size: 0.82rem; white-space: nowrap;
}
.mtc__table tbody tr:nth-child(even) { background: #f7fee7; }
.mtc__table tbody tr:hover { background: #ecfccb; }
.mtc__table tbody td { padding: 0.5rem 1rem; color: #1a2e05; font-weight: 500; border-bottom: 1px solid #ecfccb; }
.mtc__mil-cell { font-family: 'Courier New', monospace; font-size: 1rem; letter-spacing: 2px; color: #365314; }

/* Period badges */
.mtc__period-badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 700; white-space: nowrap;
}
.mtc__period--midnight  { background: #1e293b; color: #94a3b8; }
.mtc__period--morning   { background: #fef9c3; color: #854d0e; }
.mtc__period--noon      { background: #fef08a; color: #713f12; }
.mtc__period--afternoon { background: #fed7aa; color: #9a3412; }
.mtc__period--evening   { background: #e0e7ff; color: #3730a3; }
.mtc__period--night     { background: #1e1b4b; color: #a5b4fc; }

/* ── Note ── */
.mtc__note {
    background: #f7fee7; border-top: 1.5px solid #bef264;
    padding: 0.85rem clamp(1rem, 3vw, 1.5rem);
    font-size: 0.82rem; color: #1a2e05; line-height: 1.65;
}

/* ── Responsive ── */
@media (max-width: 620px) {
    .mtc__body { flex-direction: column; }
    .mtc__divider {
        width: 100%; min-width: unset; height: 36px;
        border-left: none; border-right: none;
        border-top: 1px solid #ecfccb; border-bottom: 1px solid #ecfccb;
    }
    .mtc__card { padding: 1rem; }
    .mtc__time-row { flex-wrap: wrap; }
}
