/* Kanak Care — mobile-first stylesheet.
   Phones are the primary target; wider screens progressively get more room. */

:root {
    --brand: #087f75;
    --brand-dark: #066158;
    --brand-soft: #e5f3f1;
    --gold: #e0a526;
    --gold-ink: #b07a0c;
    --gold-soft: #fdf3dc;
    --ink: #16323f;
    --muted: #5b707d;
    --line: #e1e8ec;
    --bg: #f3f6f7;
    --surface: #ffffff;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 45, 55, .05), 0 6px 18px rgba(15, 45, 55, .06);

    --success-bg: #e3f5ea;
    --success-ink: #146c3a;
    --info-bg: #e4effc;
    --info-ink: #1d4f91;
    --warning-bg: #fdf1dc;
    --warning-ink: #8a5300;
    --danger-bg: #fde7e7;
    --danger-ink: #a12a2a;
    --neutral-bg: #eef1f3;
    --neutral-ink: #4f6270;

    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
}

a {
    color: var(--brand);
}

h1, h2, h3 {
    line-height: 1.25;
    margin: 0 0 8px;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; margin-top: 18px; }

p {
    margin: 0 0 10px;
}

small {
    color: var(--muted);
}

/* ---------- Role tint ----------
   Residents, staff and admins each get their own page tint, header strip and label,
   so it is always clear which side of the app is open. */

body.role-resident { --role: #087f75; --role-deep: #05544d; --role-wash: #cfeae4; --bg: #eef7f5; }
body.role-staff    { --role: #9a5b00; --role-deep: #6e4100; --role-wash: #f6dfb4; --bg: #fcf6ec; }
body.role-admin    { --role: #4a3aa8; --role-deep: #33277a; --role-wash: #dcd7f5; --bg: #f3f2fb; }

/* A soft glow of the role colour behind the top of every page, fading into the page tint. */
body[class*="role-"] {
    background:
        radial-gradient(120% 340px at 50% 0, var(--role-wash), transparent 100%) no-repeat,
        var(--bg);
}

body[class*="role-"] .site-header {
    border-top: 4px solid var(--role);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px -10px var(--role);
}

body[class*="role-"] .nav-pill:hover {
    border-color: var(--role);
    color: var(--role);
}

body[class*="role-"] .eyebrow {
    color: var(--role);
}

body[class*="role-"] .panel,
body[class*="role-"] .card,
body[class*="role-"] .stat-card {
    border-color: color-mix(in srgb, var(--role) 14%, var(--line));
    box-shadow: 0 1px 2px rgba(15, 45, 55, .04),
                0 8px 22px -8px color-mix(in srgb, var(--role) 22%, transparent);
}

/* Headline numbers on the dashboards pick up the role colour, with a thin accent line on top. */
body[class*="role-"] .stat-card {
    border-top: 3px solid var(--role);
}

body[class*="role-"] .stat-card strong {
    color: var(--role-deep);
}

body[class*="role-"] footer {
    border-top-color: color-mix(in srgb, var(--role) 18%, var(--line));
}

.role-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    padding: 3px 11px 3px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--role), var(--role-deep));
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px -2px var(--role);
}

.role-chip svg {
    width: 14px;
    height: 14px;
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 10px 16px 8px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}

.brand-mark {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    box-shadow: 0 2px 6px rgba(6, 97, 88, .25);
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: -.01em;
    line-height: 1.1;
    white-space: nowrap;
}

/* "Kanak" means gold, so "Care" takes the gold accent. */
.brand-accent {
    margin-left: .22em;
    color: var(--gold-ink);
}

.brand-tagline {
    display: none;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* The society logo image has built-in white margins, so it is shown a little larger than the mark. */
.society-logo {
    flex: none;
    height: 52px;
    width: auto;
    object-fit: contain;
}

.header-navigation {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.logout-form {
    margin: 0;
    margin-left: auto;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    margin: 0;
}

.nav-pill:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* ---------- Layout ---------- */

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px;
    flex: 1;
}

footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px 24px;
    padding: 20px 16px 28px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.footer-partner {
    width: auto;
    height: 28px;
}

.footer-logo {
    height: 43px;
    width: auto;
}

.corporate-logo {
    height: 24px;
    width: auto;
    opacity: .85;
}

.welcome,
.page-heading {
    margin: 4px 0 16px;
}

.welcome p,
.page-heading p {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 4px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand);
}

.panel,
.card,
.service-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.panel > h2:first-child {
    margin-bottom: 12px;
}

.section-heading {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.section-heading p {
    color: var(--muted);
    margin: 0;
}

.note,
.muted {
    color: var(--muted);
    font-size: .875rem;
}

.notice {
    background: var(--info-bg);
    color: var(--info-ink);
    border-left: 4px solid currentColor;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 12px 0;
}

details {
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--muted);
}

/* A panel of search filters that folds away. */
details.filter-panel {
    margin-top: 0;
    padding-top: 16px;
}

.filter-panel summary {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
}

.filter-panel summary h2 {
    margin: 0;
}

.filter-panel summary::-webkit-details-marker {
    display: none;
}

.filter-panel summary::after {
    content: "▾";
    margin-left: auto;
    color: var(--muted);
    transition: transform .15s;
}

.filter-panel[open] summary::after {
    transform: rotate(180deg);
}

.filter-panel[open] summary {
    margin-bottom: 12px;
}

details ul {
    padding-left: 18px;
    margin: 10px 0 0;
}

details li {
    margin-bottom: 8px;
}

/* ---------- Buttons and links ---------- */

button,
.button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 650;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}

button:hover,
.button:hover,
.button-link:hover {
    background: var(--brand-dark);
}

button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* The button just tapped, while the next page loads. */
button.is-sending {
    opacity: .7;
    cursor: progress;
}

button.is-sending::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-page {
    max-width: 460px;
    margin: 32px auto;
    text-align: center;
}

.error-page .button-link {
    margin-top: 8px;
}

.button-link.secondary,
button.secondary {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.button-link.secondary:hover,
button.secondary:hover {
    background: #d3ebe7;
}

.text-link,
.edit-link {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

.text-link:hover,
.edit-link:hover {
    text-decoration: underline;
}

/* ---------- Messages ---------- */

.messages {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.message {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border-left: 4px solid currentColor;
    background: var(--success-bg);
    color: var(--success-ink);
    font-size: .9rem;
}

.message.error,
.message.row-error {
    background: var(--danger-bg);
    color: var(--danger-ink);
}

.message.warning {
    background: var(--warning-bg);
    color: var(--warning-ink);
}

.message.info {
    background: var(--info-bg);
    color: var(--info-ink);
}

/* ---------- Status pills ---------- */

.status-pill,
.record-status,
.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--neutral-bg);
    color: var(--neutral-ink);
}

[data-tone="success"],
.status.available,
.record-status.active { background: var(--success-bg); color: var(--success-ink); }
[data-tone="info"] { background: var(--info-bg); color: var(--info-ink); }
[data-tone="warning"] { background: var(--warning-bg); color: var(--warning-ink); }
[data-tone="danger"] { background: var(--danger-bg); color: var(--danger-ink); }
[data-tone="neutral"],
.record-status.inactive { background: var(--neutral-bg); color: var(--neutral-ink); }

.status-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.status-summary span {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--neutral-bg);
    font-size: .85rem;
}

/* ---------- Stats and filters ---------- */

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
}

.stat-card span {
    font-size: .8rem;
    color: var(--muted);
}

.stat-card strong {
    font-size: 1.5rem;
    line-height: 1.2;
}

.filter-links {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 14px;
    scrollbar-width: none;
}

.filter-links a {
    flex: none;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.filter-links a:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* The list being shown. */
.filter-links a[aria-current="page"] {
    background: var(--role, var(--brand));
    border-color: var(--role, var(--brand));
    color: #fff;
}

/* ---------- Forms ---------- */

label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 4px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cfdbe1;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    /* 16px stops phones from zooming into the field. */
    font: inherit;
    font-size: 16px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
    border-color: var(--brand);
}

input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    min-height: 20px;
    height: 20px;
    margin: 0 8px 0 0;
    vertical-align: middle;
    accent-color: var(--brand);
}

.form-field,
.form-group,
.filter-field {
    margin-bottom: 14px;
}

.form-field small,
.form-group small {
    display: block;
    margin-top: 4px;
}

.form-field label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    font-weight: 500;
    min-height: 40px;
}

.form-panel form,
.edit-form,
.single-form,
.filter-form {
    display: grid;
    gap: 4px;
}

.form-panel label {
    margin-top: 10px;
}

.form-panel button,
.single-form button,
.card button {
    width: 100%;
    margin-top: 10px;
}

.form-actions,
.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 4px 0 10px;
}

.radio-row label {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0;
}

.review-form label {
    margin: 0;
}

.demo-otp {
    display: grid;
    gap: 4px;
    padding: 14px;
    margin: 12px 0;
    border: 2px dashed var(--brand);
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    text-align: center;
}

.demo-otp strong {
    font-size: 1.2rem;
    letter-spacing: .08em;
}

.column-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 14px;
}

.column-list span {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--neutral-bg);
    font-size: .85rem;
}

.admin-login-card {
    max-width: 420px;
    margin: 12px auto;
}

/* ---------- Tables ----------
   On phones each row becomes a card; cells show their column heading as a label. */

.table-wrap {
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    vertical-align: top;
}

.table-wrap thead {
    display: none;
}

.table-wrap tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 10px;
}

.table-wrap th,
.table-wrap td {
    display: block;
    padding: 5px 0;
    border: 0;
}

/* The label floats in the left 38% of the card; flow-root makes the cell tall enough for a wrapped label. */
.table-wrap td[data-label] {
    display: flow-root;
    padding-left: 38%;
}

.table-wrap td[data-label]::before {
    content: attr(data-label);
    float: left;
    /* Percentages here are of the cell's content box, which is 62% of the card width. */
    width: 56%;
    margin-left: -61.3%;
    padding-top: 2px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
}

/* Cells holding a form use the full card width, with the label above. */
.table-wrap td[data-label]:has(form) {
    padding-left: 0;
}

.table-wrap td[data-label]:has(form)::before {
    float: none;
    display: block;
    width: auto;
    margin: 0 0 4px;
}

.table-wrap tbody th {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    padding-bottom: 0;
}

/* ---------- Home page ---------- */

.services {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.service-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.service-card p {
    color: var(--muted);
}

.service-card .button-link {
    margin-top: auto;
}

.service-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.service-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--brand-soft);
    color: var(--brand);
}

.service-icon svg {
    width: 28px;
    height: 28px;
}

.upcoming .service-icon {
    background: var(--neutral-bg);
    color: var(--neutral-ink);
}

/* Swipeable image strip; the next image peeks in so it is clear there is more to see. */
.gallery {
    display: flex;
    gap: 10px;
    margin: -16px -16px 6px;
    padding: 16px 16px 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    scrollbar-width: none;
    border-radius: var(--radius) var(--radius) 0 0;
}

.gallery::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex: 0 0 82%;
    margin: 0;
    scroll-snap-align: start;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
}

.gallery-item figcaption {
    margin-top: 6px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
}

.upcoming .gallery-item img {
    filter: saturate(.85);
}

.showcase {
    margin-bottom: 16px;
}

.showcase-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 14px;
}

.showcase-card .gallery {
    margin: 0 -16px;
    padding-top: 0;
    border-radius: 0;
}

.showcase-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.showcase-heading h3 {
    margin: 0;
}

.page-art {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    aspect-ratio: 16 / 10;
    margin: 0 0 14px;
    border-radius: var(--radius);
}

.hero {
    display: flex;
    align-items: flex-end;
    min-height: 220px;
    margin: 0 0 18px;
    padding: 20px 18px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    background-size: cover;
    background-position: center 65%;
    color: #fff;
    overflow: hidden;
    position: relative;
}

.hero.has-photo::before {
    content: "";
    position: absolute;
    inset: 0;
    /* Darken the lower part of the photo so the white text stays readable. */
    background: linear-gradient(180deg, rgba(6, 40, 44, .08) 0%, rgba(6, 40, 44, .45) 45%, rgba(6, 40, 44, .88) 100%);
}

.hero-text {
    position: relative;
}

.hero h1 {
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
}

.hero p {
    margin: 0;
    color: rgba(255, 255, 255, .92);
}

.hero .eyebrow {
    color: #e6fffb;
    margin-bottom: 4px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}

/* Step tracker: completed steps get a tick, the current step a ring. */
.tracker {
    display: flex;
    list-style: none;
    margin: 14px 0 10px;
    padding: 0;
    counter-reset: step;
}

.tracker li {
    flex: 1;
    position: relative;
    padding-top: 32px;
    text-align: center;
    font-size: .72rem;
    line-height: 1.25;
    color: var(--muted);
}

.tracker li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 1;
    width: 26px;
    height: 26px;
    margin-left: -13px;
    border-radius: 50%;
    background: var(--neutral-bg);
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
    line-height: 26px;
}

.tracker li + li::after {
    content: "";
    position: absolute;
    top: 12px;
    left: -50%;
    width: 100%;
    height: 3px;
    background: var(--line);
}

.tracker li.done,
.tracker li.current {
    color: var(--ink);
}

.tracker li.current {
    font-weight: 700;
}

.tracker li.done::before {
    content: "✓";
    background: var(--brand);
    color: #fff;
}

.tracker li.current::before {
    background: var(--surface);
    color: var(--brand);
    box-shadow: inset 0 0 0 2px var(--brand), 0 0 0 4px var(--brand-soft);
}

.tracker li.done + li::after {
    background: var(--brand);
}

/* Trackers with many steps: on phones only the current step is labelled; the status line below explains it. */
@media (max-width: 559px) {
    .tracker-long li {
        font-size: 0;
    }

    .tracker-long li.current {
        font-size: .72rem;
        white-space: nowrap;
    }
}

.request-card .note {
    margin: 0;
}

.upcoming {
    opacity: .85;
}

.coming-soon {
    margin-top: auto;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--neutral-bg);
    text-align: center;
    font-weight: 700;
}

/* Role picker: the landing page for the shared WhatsApp link. */
.role-picker {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.role-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--ink);
    text-decoration: none;
}

.role-card:hover,
.role-card:focus-visible {
    border-color: var(--brand);
}

.role-text {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.role-text strong {
    font-size: 1.05rem;
}

.role-text small {
    color: var(--muted);
}

.role-arrow {
    color: var(--brand);
    font-size: 1.6rem;
    line-height: 1;
}

.admin-menu {
    display: grid;
    gap: 8px;
}

a.stat-card {
    color: var(--ink);
    text-decoration: none;
}

.inline-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.inline-actions button {
    min-height: 36px;
    padding: 6px 12px;
}

/* ---------- Service brands (BlinkAuto, Blinkish, ...) ---------- */

.service-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    vertical-align: middle;
}

.service-brand img {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.service-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.service-brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--ink);
}

.service-brand-what {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.service-brand-sm img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
}

.service-brand-sm .service-brand-name {
    font-size: 1rem;
}

.service-brand-lg {
    margin-bottom: 8px;
}

.service-brand-lg img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
}

.service-brand-lg .service-brand-name {
    font-size: 1.5rem;
}

.service-card-title {
    margin: 0;
}

.sub-services {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    list-style: none;
    margin: 4px 0;
    padding: 0;
}

.upcoming .service-brand img {
    filter: saturate(.75);
}

/* ---------- Laundry ---------- */

.choice-list {
    display: grid;
    gap: 8px;
    margin: 6px 0 14px;
}

.choice {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-weight: 600;
}

.choice:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.rate-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
}

.rate-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.rate-list small {
    color: var(--muted);
    font-weight: 400;
}

.mission-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin: -4px 0 10px;
}

.mission-row .mission {
    margin: 0;
}

/* A small pill button for secondary actions, such as opening the rate card. */
.chip-button {
    min-height: 32px;
    padding: 4px 12px;
    border: 1px solid var(--brand);
    border-radius: 999px;
    background: var(--surface);
    color: var(--brand);
    font-size: .82rem;
    font-weight: 700;
}

.chip-button:hover {
    background: var(--brand-soft);
}

/* ---------- Pop-up windows ---------- */

.modal {
    width: min(460px, calc(100% - 32px));
    max-height: min(80dvh, 640px);
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 20px 50px rgba(15, 45, 55, .25);
}

.modal[open] {
    display: flex;
    flex-direction: column;
    animation: modal-in .18s ease-out;
}

.modal::backdrop {
    background: rgba(15, 35, 45, .45);
    backdrop-filter: blur(2px);
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--line);
}

.modal-head h2,
.modal-head form {
    margin: 0;
}

.modal-close {
    min-height: 36px;
    width: 36px;
    padding: 0;
    border-radius: 999px;
    background: var(--neutral-bg);
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1;
}

.modal-close:hover {
    background: var(--line);
}

.modal-body {
    overflow-y: auto;
    padding: 4px 16px 8px;
}

.modal-body .rate-list li:last-child {
    border-bottom: 0;
}

.pickup-form {
    margin: 10px 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.pickup-form summary {
    font-weight: 700;
    cursor: pointer;
}

.pickup-form h4 {
    margin: 14px 0 4px;
}

.qty-row {
    display: grid;
    grid-template-columns: 1fr 96px;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.qty-row small {
    display: block;
    color: var(--muted);
}

.bill-total {
    font-size: 1.05rem;
}

/* Bills stay a real table on phones: item, quantity, and amount read best side by side. */
.table-wrap.bill {
    margin: 10px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
}

.table-wrap.bill thead {
    display: table-header-group;
}

.table-wrap.bill tr {
    display: table-row;
    border: 0;
    padding: 0;
    margin: 0;
}

.table-wrap.bill th,
.table-wrap.bill td,
.table-wrap.bill td[data-label] {
    display: table-cell;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    font-size: .9rem;
}

.table-wrap.bill td[data-label]::before {
    content: none;
}

.table-wrap.bill.bill-awaiting {
    border: 2px solid var(--gold);
}

.table-wrap.bill td:nth-child(2) {
    white-space: nowrap;
}

.table-wrap.bill td small {
    color: var(--muted);
    font-size: .78rem;
}

.table-wrap.bill thead th {
    font-size: .75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.table-wrap.bill tfoot th {
    border-bottom: 0;
    font-size: 1rem;
}

.table-wrap.bill th:last-child,
.table-wrap.bill td:last-child {
    text-align: right;
}

.mission {
    margin: -4px 0 10px;
    font-style: italic;
    font-weight: 600;
    color: #6d28d9;
}

.continue-as select {
    font-size: 1rem;
}

[data-staff-role][hidden] {
    display: none;
}

/* ---------- Order form: weight and pieces ---------- */

.choice-unit {
    margin-left: auto;
    color: var(--muted);
    font-weight: 400;
}

.form-label {
    margin: 0 0 6px;
    font-weight: 700;
}

.edit-order summary {
    padding: 10px 0;
    font-weight: 700;
    color: var(--brand);
    cursor: pointer;
}
fieldset.form-field {
    margin: 0 0 14px;
    padding: 0;
    border: 0;
}

fieldset.form-field legend {
    margin-bottom: 6px;
    padding: 0;
    font-weight: 600;
}

.accept-decline {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
    margin: 10px 0 4px;
}

.accept-decline form,
.accept-decline button {
    width: 100%;
    margin: 0;
}

.call-link {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success-ink);
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}

/* ---------- Help tips: a '?' that explains on tap or hover ---------- */

.panel,
.page-heading,
.welcome,
.kyc-card,
.showcase-card {
    position: relative;
}

.tip {
    display: inline-block;
    vertical-align: middle;
    margin-left: 2px;
}

.tip-button {
    width: 22px;
    min-height: 0;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    background: var(--neutral-bg);
    color: var(--neutral-ink);
    font-size: .75rem;
    font-weight: 700;
    line-height: 22px;
}

/* The bubble spans the card it sits in, so it never runs off a phone screen. */
.tip-text {
    display: none;
    position: absolute;
    z-index: 30;
    left: 12px;
    right: 12px;
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: #fff;
    font-size: .85rem;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: 0 8px 24px rgba(15, 45, 55, .25);
}

.tip:hover .tip-text,
.tip:focus-within .tip-text {
    display: block;
}

/* ---------- Compact phone layout ---------- */

@media (max-width: 559px) {
    h1 { font-size: 1.3rem; }
    h2 { font-size: 1.05rem; }

    .container {
        /* Room at the bottom so the install and notification banners never cover the last line. */
        padding: 10px 12px 80px;
    }

    .site-header {
        padding: 8px 12px 6px;
    }

    .header-navigation {
        margin-top: 6px;
    }

    .society-logo {
        height: 44px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

    .brand-name {
        font-size: 1.15rem;
    }

    .hero {
        min-height: 120px;
        padding: 14px;
        margin-bottom: 12px;
    }

    .hero p {
        font-size: .9rem;
    }

    .welcome,
    .page-heading {
        margin: 0 0 10px;
    }

    .panel,
    .card,
    .showcase-card {
        padding: 12px;
        margin-bottom: 10px;
    }

    .kyc-card {
        padding: 12px;
        margin-bottom: 10px;
    }

    .page-art {
        display: none;
    }

    .gallery-item {
        flex-basis: 56%;
    }

    .gallery-item figcaption {
        font-size: .75rem;
    }

    .note {
        font-size: .8rem;
    }

    .choice {
        min-height: 44px;
        padding: 8px 12px;
    }

    .stat-card {
        padding: 8px 10px;
    }

    .stat-card strong {
        font-size: 1.2rem;
    }

    footer {
        padding: 12px;
        gap: 10px 16px;
    }

    .footer-logo {
        height: 32px;
    }

    .corporate-logo {
        height: 18px;
    }
}

.resend-form {
    margin: 0;
}

.link-button {
    display: inline;
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- UPI payment and ratings ---------- */

.pay-box {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.pay-button {
    width: 100%;
}

.upi-qr {
    margin: 10px 0;
}

.upi-qr summary {
    color: var(--brand);
    font-weight: 600;
    cursor: pointer;
}

.upi-qr svg {
    display: block;
    width: 200px;
    height: auto;
    margin: 10px auto 4px;
}

.upi-qr small {
    display: block;
    text-align: center;
    color: var(--muted);
}

.paid-note {
    color: var(--success-ink);
    font-weight: 600;
}

/* Star picker: the radios are listed 5..1 and shown right-to-left, so hovering a star lights it and those before. */
.stars {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
}

.stars legend {
    width: 100%;
    margin-bottom: 4px;
    font-weight: 600;
}

.stars input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.stars label {
    font-size: 2.2rem;
    line-height: 1;
    color: var(--line);
    cursor: pointer;
}

.stars input:checked ~ label,
.stars label:hover,
.stars label:hover ~ label {
    color: var(--gold);
}

.stars input:focus-visible + label {
    outline: 2px solid var(--brand);
    border-radius: 4px;
}

.stars-shown {
    color: var(--gold);
    letter-spacing: 1px;
}

/* ---------- Installable app ---------- */

.app-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 520px;
    margin: 0 auto;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(15, 45, 55, .2);
    font-size: .9rem;
    font-weight: 600;
}

.app-banner[hidden] {
    display: none;
}

.app-banner span {
    flex: 1;
}

.app-banner button {
    min-height: 38px;
    padding: 6px 12px;
}

.offline-page {
    text-align: center;
    padding-top: 15vh;
}

/* ---------- Notifications ---------- */

.bell {
    position: relative;
    gap: 4px;
}

.badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger-ink);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.badge[hidden] {
    display: none;
}

.toast {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    box-shadow: 0 8px 24px rgba(15, 45, 55, .3);
}

.toast[hidden] {
    display: none;
}

.toast button {
    flex: none;
    min-height: 36px;
    background: var(--gold);
    color: var(--ink);
}

.notification-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.notification-list a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
}

.notification-list .unread a {
    border-left: 4px solid var(--brand);
    background: var(--brand-soft);
}

.notification-list span {
    color: var(--muted);
    font-size: .9rem;
}

.notification-list small {
    color: var(--muted);
}

/* ---------- Laundry flow ---------- */

.people {
    list-style: none;
    margin: 8px 0;
    padding: 0;
}

.people li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    padding: 6px 0;
}

.people li > span {
    min-width: 64px;
    color: var(--muted);
    font-size: .85rem;
}

.trip {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--info-bg);
    color: var(--info-ink);
    font-size: .8rem;
    font-style: normal;
    font-weight: 600;
}

.trip-buttons.single {
    grid-template-columns: 1fr;
}

.trip-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0 4px;
}

.count-pill {
    display: inline-block;
    min-width: 24px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: .8rem;
    text-align: center;
    vertical-align: middle;
}

.route-step {
    margin: 14px 0 4px;
    font-weight: 700;
    color: var(--brand-dark);
}

/* ---------- Request cards (KYC queue, work board, washer jobs) ---------- */

.kyc-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}

.panel .kyc-card {
    box-shadow: none;
    background: #fbfcfd;
}

.panel.kyc-card {
    box-shadow: var(--shadow);
    scroll-margin-top: 110px;
}

.kyc-card-heading {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.kyc-card-heading h2,
.kyc-card-heading h3 {
    margin: 0 0 4px;
}

.kyc-card-heading p {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 2px;
}

.kyc-card h3 {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.kyc-card .kyc-card-heading h3 {
    padding-top: 0;
    border-top: 0;
}

/* ---------- Larger screens ---------- */

@media (min-width: 560px) {
    .brand-tagline {
        display: block;
    }

    .gallery-item {
        flex-basis: 46%;
    }

    .brand-mark {
        width: 46px;
        height: 46px;
    }

    .society-logo {
        height: 64px;
    }

    .review-form {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .review-form input,
    .review-form select {
        width: auto;
        flex: 1 1 200px;
    }

    .review-form button {
        flex: none;
    }

    .form-actions,
    .filter-actions {
        flex-direction: row;
        align-items: center;
    }

    .section-heading {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .kyc-card-heading {
        flex-direction: row;
        justify-content: space-between;
    }

    .services {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero {
        min-height: 280px;
        padding: 28px;
    }
}

@media (min-width: 860px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.3rem; }

    .site-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding: 12px max(24px, calc((100% - 1080px) / 2 + 16px));
    }

    .header-navigation {
        margin-top: 0;
        order: 2;
    }

    .header-top {
        flex: 1;
    }

    .container {
        padding: 24px 16px;
    }

    .panel,
    .card {
        padding: 22px;
    }

    .filter-form {
        grid-template-columns: 2fr 1fr 1fr;
        align-items: end;
        gap: 12px;
    }

    .filter-actions {
        grid-column: 1 / -1;
    }

    /* Regular tables on wide screens. */
    .table-wrap {
        overflow-x: auto;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--surface);
    }

    .table-wrap thead {
        display: table-header-group;
    }

    .table-wrap tr {
        display: table-row;
        border: 0;
        border-radius: 0;
        padding: 0;
        margin: 0;
    }

    .table-wrap th,
    .table-wrap td,
    .table-wrap td[data-label],
    .table-wrap td[data-label]:has(form) {
        display: table-cell;
        position: static;
        padding: 11px 14px;
        border-bottom: 1px solid var(--line);
    }

    .table-wrap td[data-label]::before {
        content: none;
    }

    .table-wrap thead th {
        background: #f6f9fa;
        font-size: .78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--muted);
        white-space: nowrap;
    }

    .table-wrap tbody th {
        width: 34%;
        font-size: .9rem;
        color: var(--ink);
    }

    .table-wrap tbody tr:last-child > * {
        border-bottom: 0;
    }

    .table-wrap .review-form {
        min-width: 260px;
    }
}

/* ---------- Company home page (/) ---------- */
.company-hero {
    min-height: 180px;
}




.product-grid {
    display: grid;
    gap: 14px;
}

@media (min-width: 720px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.product-card.upcoming {
    opacity: .8;
}

.product-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.product-head img {
    flex: none;
    border-radius: 12px;
}

.product-head > div {
    flex: 1;
    min-width: 0;
}

.product-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.product-what {
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
}

.product-card > p {
    margin: 0 0 12px;
    color: var(--muted);
}

.product-link {
    margin-top: auto;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}

/* A product's full logo (it includes the name) across the top of its card. */
.product-logo {
    display: block;
    margin: -4px -4px 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1px solid var(--line);
}

.product-logo img {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto;
}

.product-head > .product-what {
    flex: 1;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
