/* MediFee – ruhig, klar, einhändig bedienbar */
:root {
    --petrol: #0F6B66;
    --petrol-dark: #0B4F4B;
    --petrol-soft: #E6F2EF;
    --bg: #F1F5F4;
    --card: #FFFFFF;
    --ink: #1E2B2A;
    --muted: #5C6B6A;
    --line: #E2EAE9;
    --warn: #B5432F;
    --warn-soft: #FBE9E5;
    --good: #2E7D5B;
    --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

/* Kopf */
.topbar {
    background: var(--petrol);
    color: #fff;
    padding-top: env(safe-area-inset-top);
}
.topbar-inner {
    max-width: 640px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.who { font-size: 14px; opacity: .85; }

/* Inhalt */
.content {
    max-width: 640px; margin: 0 auto;
    padding: 16px 14px calc(84px + env(safe-area-inset-bottom));
}
.pagetitle { font-size: 21px; font-weight: 700; margin: 4px 2px 14px; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.pagehead .pagetitle { margin: 0; }
.sectionhead { font-size: 16px; color: var(--petrol-dark); margin: 20px 0 4px; }

/* Karten */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(15, 107, 102, .07);
}
.card h2 { font-size: 16px; color: var(--petrol-dark); margin: 0 0 10px; }
.card-warn { border-left: 4px solid var(--warn); }
.card-warn h2 { color: var(--warn); }

/* Zeilen in Karten */
.row {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 2px;
    border-top: 1px solid var(--line);
    text-decoration: none; color: inherit;
    min-height: 48px;
    margin: 0;
}
.row:first-of-type, h2 + .row, p + .row { border-top: 0; }
.row-main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.row-main b { font-weight: 600; overflow-wrap: anywhere; }
.chev { color: #A8B8B6; font-size: 22px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.overdue { color: var(--warn); font-weight: 600; }
.childname { font-weight: 700; color: var(--petrol-dark); margin: 12px 0 2px; }

/* Formulare */
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
label.small { font-size: 12px; margin: 8px 0 2px; }
input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #C3D2D0;
    border-radius: 10px;
    font-size: 16px; /* verhindert Auto-Zoom auf iOS */
    font-family: inherit;
    background: #fff;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus-visible {
    outline: 2px solid var(--petrol);
    outline-offset: 1px;
}
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check-row input { width: 20px; height: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 16px;
    background: var(--petrol-soft);
    color: var(--petrol-dark);
    border: 0; border-radius: 10px;
    font-size: 15px; font-weight: 600;
    text-decoration: none; text-align: center;
    cursor: pointer;
    min-height: 46px;
}
.btn-primary { background: var(--petrol); color: #fff; }
.btn-good { background: var(--good); color: #fff; }
.btn-danger { background: var(--warn-soft); color: var(--warn); }
.btn-big { display: block; width: 100%; margin-top: 12px; padding: 14px; font-size: 16px; }
.btn-small { padding: 8px 14px; min-height: 40px; flex-shrink: 0; }
.btnrow { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btnrow .btn { flex: 1; }

/* Meldungen */
.flash { border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 15px; }
.flash-ok { background: var(--petrol-soft); color: var(--petrol-dark); }
.flash-err { background: var(--warn-soft); color: var(--warn); }

/* Bestandskarte */
.stockcard { text-align: center; }
.stock-big { font-size: 40px; font-weight: 800; color: var(--petrol-dark); }
.stock-big .unit { font-size: 18px; font-weight: 600; color: var(--muted); }

/* Sprachseite – der Mikrofon-Knopf ist das Herzstück */
.voicecard { text-align: center; padding: 26px 16px; }
.micbtn {
    width: 118px; height: 118px;
    border-radius: 50%;
    border: 0;
    background: var(--petrol);
    color: #fff;
    font-size: 46px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(15, 107, 102, .35);
    transition: transform .12s ease;
}
.micbtn:active { transform: scale(.94); }
.micbtn:disabled { background: #9FB4B2; box-shadow: none; }
.micbtn.recording {
    background: var(--warn);
    animation: pulse 1.2s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(181, 67, 47, .45); }
    70%  { box-shadow: 0 0 0 22px rgba(181, 67, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(181, 67, 47, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .micbtn.recording { animation: none; }
}
.micstate { margin-top: 14px; color: var(--muted); font-size: 15px; }
.transcript { margin-top: 10px; font-size: 17px; font-weight: 600; min-height: 24px; }
.voicetyped { display: flex; gap: 8px; margin-top: 18px; }
.voicetyped input { flex: 1; }
.confirmcard { border-left: 4px solid var(--petrol); }
.confirmtext { font-size: 18px; font-weight: 600; margin: 4px 0 6px; }
.resultcard { border-left: 4px solid var(--good); font-size: 16px; }
.resultcard.iserror { border-left-color: var(--warn); }
.resultcard p { margin: 0; }

/* Login */
.login-wrap { max-width: 420px; margin: 0 auto; padding-top: 6vh; }
.login-hero { text-align: center; margin-bottom: 18px; }
.login-logo { font-size: 52px; }
.login-hero h1 { color: var(--petrol-dark); margin: 4px 0 2px; }
.login-hero p { color: var(--muted); margin: 0; font-size: 15px; }

/* Untere Navigation */
.bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--card);
    border-top: 1px solid var(--line);
    display: flex; justify-content: space-around; align-items: flex-end;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    max-width: 640px; margin: 0 auto;
}
.bottomnav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    text-decoration: none;
    color: var(--muted);
    font-size: 11px; font-weight: 600;
    padding: 4px 0;
    min-height: 48px; justify-content: flex-end;
}
.bottomnav a span { font-size: 21px; }
.bottomnav a.on { color: var(--petrol); }
.bottomnav .micnav { position: relative; }
.micbubble {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: var(--petrol);
    color: #fff;
    font-size: 24px !important;
    box-shadow: 0 4px 12px rgba(15, 107, 102, .35);
    transform: translateY(-12px);
}
.bottomnav .micnav.on .micbubble { background: var(--petrol-dark); }

code { background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; }
h1, h2, h3 { line-height: 1.25; }
p { margin: 6px 0; }
