:root {
    --black: #1b1b1b;
    --grey: #777777;
    --light: #eeeeee;
    --line: #cccccc;
    --red: #5f2321;
    --blue: #0088cc;
    --ink: #1b1b1b;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: white;
    color: var(--ink);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

#root { min-height: 100vh; padding-bottom: 96px; }

.is-hot {
    outline: 2px solid #f59e0b;
    outline-offset: 4px;
    border-radius: 8px;
    animation: pulse 1.15s ease-in-out infinite;
}

.is-entering { animation: rise 0.45s ease; }

.popover { animation: pop 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.actions-menu { animation: pop 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.overlay { animation: fade 0.25s ease; }
.dialog { animation: pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }

.modules.is-hot .module { animation: lift 0.55s ease both; }
.modules.is-hot .module:nth-child(2) { animation-delay: 0.06s; }
.modules.is-hot .module:nth-child(3) { animation-delay: 0.12s; }
.modules.is-hot .module:nth-child(4) { animation-delay: 0.18s; }

@keyframes pulse {
    0%, 100% { outline-color: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); }
    50% { outline-color: #fff7ed; box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes pop {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

@keyframes fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lift {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes coach-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .is-hot, .is-entering, .popover, .actions-menu, .overlay, .dialog, .coach, .modules.is-hot .module {
        animation: none;
    }
}

/* header, same structure as the app */
.app-header {
    background: var(--black);
    color: var(--grey);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 20px;
    min-height: 48px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo, .nav-btn, .account-btn {
    background: none;
    border: 0;
    color: var(--grey);
    padding: 4px 0;
}
.logo { color: #eee; font-size: 20px; }
.nav-btn:hover, .account-btn:hover, .logo:hover, .nav-btn.is-on { color: white; }
.nav, .account { display: flex; align-items: center; gap: 14px; }
.menu-wrap { position: relative; }
.popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    color: var(--ink);
    min-width: 220px;
    padding: 6px;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 30;
}
.popover.right { left: auto; right: 0; }
.popover button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--ink);
}
.popover button:hover { background: var(--red); color: white; }

.page { padding: 12px; }
.start { max-width: 80rem; margin: 0 auto; padding: 48px 16px; }
.lead { text-align: center; font-size: 24px; margin: 0; }
.modules {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}
.module {
    background: none;
    border: 0;
    color: var(--red);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.module:disabled { cursor: default; }
.glyph {
    width: 80px;
    height: 80px;
    border: 2px solid var(--red);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 13px;
}
.calendly-title { display: block; text-align: center; font-size: 24px; margin: 64px 0 12px; }
.calendly {
    min-height: 160px;
    border: 1px dashed var(--line);
    display: grid;
    place-items: center;
    color: var(--grey);
}

.card { background: var(--light); padding: 12px; }
.card + .card { margin-top: 12px; }
.card h2, .section-title { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.page-title { font-size: 36px; font-weight: 700; margin: 0; }
.title-row, .split, .row { display: flex; gap: 8px; align-items: center; }
.title-row { justify-content: space-between; margin-bottom: 12px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.field input, .search input, .dialog input[type="text"], .dialog input[type="email"] {
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 8px 10px;
    background: white;
}
.field input.is-invalid { border-color: #800508; background: #fff5f5; }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0 12px; font-size: 14px; }
.hint { color: #333; font-size: 14px; line-height: 1.45; margin: 8px 0 0; }
.error { color: #800508; font-size: 14px; margin: 0 0 8px; }

.btn {
    background: var(--red);
    color: white;
    border: 0;
    border-radius: 6px;
    padding: 8px 14px;
}
.btn.secondary { background: #e5e7eb; color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}
.linkish { background: none; border: 0; color: var(--blue); padding: 0; }

.customers { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.customers-list { width: 25%; min-width: 240px; }
.customers-detail { flex: 1; min-width: 0; }
.search { margin-bottom: 8px; }
.list-table, .grid-table { width: 100%; border-collapse: collapse; background: white; }
.list-table th, .grid-table th, .list-table td, .grid-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.list-table tbody tr.is-selected { background: var(--light); }
.grid-table tbody tr:nth-child(even) { background: #f8f8f8; }
.badge {
    background: #16a34a;
    color: white;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
}
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 16px; }
.service { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.cog { background: none; border: 0; color: var(--grey); font-size: 16px; }
.banner {
    background: var(--light);
    border-left: 4px solid var(--red);
    padding: 10px 12px;
    margin-bottom: 12px;
    line-height: 1.45;
}
.icon-row { display: flex; gap: 4px; }
.icon-btn {
    background: var(--red);
    color: white;
    border: 0;
    border-radius: 6px;
    width: 34px;
    height: 34px;
}

.profile-row { display: grid; grid-template-columns: 180px 1fr; max-width: 520px; padding: 4px 0; }

.calc-bar, .actions {
    position: fixed;
    right: 20px;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--red);
    color: white;
    border-radius: 6px;
    padding: 4px;
}
.calc-bar { bottom: 40px; }
.actions { bottom: 92px; }
.calc-bar .btn, .actions .btn { background: transparent; color: white; }
.actions-menu {
    position: fixed;
    right: 20px;
    bottom: 132px;
    z-index: 26;
    background: white;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 6px;
    min-width: 200px;
}
.actions-menu button {
    display: flex;
    width: 100%;
    gap: 8px;
    background: var(--red);
    color: white;
    border: 0;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 4px 0;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
}
.dialog {
    background: white;
    width: min(640px, 100%);
    max-height: min(70vh, 640px);
    overflow: auto;
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}
.dialog.is-hot {
    animation: pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), pulse 1.15s ease-in-out 0.4s infinite;
}
.dialog header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dialog header h2 { margin: 0; font-size: 18px; }
.dialog footer { display: flex; justify-content: space-between; margin-top: 16px; }

.coach {
    position: fixed;
    z-index: 65;
    left: 16px;
    bottom: 72px;
    width: min(440px, calc(100% - 32px));
    margin: 0;
    background: var(--black);
    color: white;
    border-radius: 6px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    animation: coach-in 0.4s ease;
}
.coach p { margin: 0; color: #ddd; grid-column: 1 / -1; }
.coach .how { color: #fbbf24; }
.coach .btn { background: white; color: var(--black); }
.coach .linkish { color: white; }

.toast {
    position: fixed;
    right: 20px;
    bottom: 150px;
    z-index: 35;
    background: white;
    border-left: 4px solid #16a34a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 10px 12px;
    max-width: 320px;
}

#chrome {
    position: fixed;
    z-index: 70;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    width: min(720px, calc(100% - 24px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}
.chrome-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #111;
    color: white;
    border-radius: 999px;
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.chrome-bar a,
.chrome-bar button,
.chrome-tools button {
    background: #2a2a2a;
    color: white;
    border: 0;
    border-radius: 999px;
    padding: 6px 10px;
    text-decoration: none;
}
.chrome-panel {
    width: min(640px, 100%);
    max-height: 220px;
    overflow: auto;
    background: #111;
    color: #ddd;
    border-radius: 12px;
    padding: 10px 12px;
}
.chrome-panel pre { margin: 8px 0 0; white-space: pre-wrap; }
.chrome-tools { display: flex; gap: 8px; }

@media (max-width: 860px) {
    .modules, .fields, .services { grid-template-columns: 1fr 1fr; }
    .customers { flex-direction: column; }
    .customers-list { width: 100%; }
    .coach { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .is-hot, .is-entering, .popover, .actions-menu, .overlay, .dialog, .dialog.is-hot, .coach, .modules.is-hot .module {
        animation: none;
    }
}
