@font-face {
    font-family: Exposure;
    src: url("assets/fonts/Exposure-205TF-VAR.woff2") format("woff2");
    font-style: normal;
}

@font-face {
    font-family: Exposure;
    src: url("assets/fonts/Exposure-205TF-VAR-Italic.woff2") format("woff2");
    font-style: italic;
}

@font-face {
    font-family: OpenRunde;
    src: url("assets/fonts/OpenRunde-Regular.woff2") format("woff2");
    font-weight: 400;
}

@font-face {
    font-family: OpenRunde;
    src: url("assets/fonts/OpenRunde-Medium.woff2") format("woff2");
    font-weight: 500;
}

:root {
    color-scheme: light;
    --surface: #fffdfa;
    --ink: #171717;
    --muted: #737373;
    --muted-strong: #525252;
    --line: #17171724;
    --input-line: #d4d4d4;
    --soft-line: #e5e5e5;
    --subtle-line: #f0f0f0;
    --accent: #3b6ea5;
    --white: #ffffff;
    --green-surface: #f0fdf4;
    --green-line: #bbf7d0;
    --green-ink: #166534;
    --red-surface: #fef2f2;
    --red-line: #fecaca;
    --red-ink: #991b1b;
    --font-sans: "OpenRunde", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
    --shadow-sm: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;
    --shadow-xs: 0 1px 2px 0 #0000000d;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-sans);
    overscroll-behavior: none;
}

body {
    min-height: 100%;
    margin: 0;
}

button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: inherit;
}

button:not(:disabled),
label[for],
select:not(:disabled) {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

textarea {
    resize: vertical;
}

svg {
    display: block;
}

hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
    margin: 0;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-family: Exposure, OpenRunde, sans-serif;
    font-variation-settings: "EXPO" -10;
    font-weight: 500;
    line-height: 1.2;
    text-wrap: pretty;
}

h2,
h3 {
    font-family: OpenRunde, system-ui, sans-serif;
    font-weight: 500;
    line-height: 1.3;
    text-wrap: pretty;
}

.auth-gate {
    display: grid;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, #fff6d6 0%, transparent 34%),
        linear-gradient(315deg, #f7f7f7 0%, transparent 32%),
        var(--surface);
    padding: clamp(1rem, 4vw, 3rem);
}

.landing-site {
    min-height: 100dvh;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, #fff9e8 0%, var(--surface) 36rem),
        var(--surface);
    color: var(--ink);
}

.landing-nav {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    width: min(1180px, calc(100% - 2rem));
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    margin: 1rem auto 0;
    padding: 0.45rem 0.5rem;
    box-shadow: 0 18px 60px #00000014;
    backdrop-filter: blur(18px);
}

.landing-nav a,
.landing-hero-button,
.landing-footer a {
    text-decoration: none;
}

.landing-nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--ink);
    font-weight: 500;
}

.landing-nav-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.landing-nav-links a {
    display: inline-flex;
    min-height: 2.625rem;
    align-items: center;
    border-radius: 999px;
    color: var(--muted-strong);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0 0.875rem;
}

.landing-nav-links a:hover,
.landing-nav-links a:focus-visible {
    color: var(--ink);
    background: #ffffffb8;
}

.landing-nav-links .landing-nav-cta {
    border: 1px solid rgb(234, 187, 73);
    background: rgb(234, 187, 73);
    color: var(--ink);
}

.landing-hero {
    position: relative;
    display: grid;
    width: min(1180px, calc(100% - 2rem));
    min-height: calc(100dvh - 5.5rem);
    align-items: center;
    margin: 0 auto;
    padding: clamp(3rem, 8vw, 7rem) 0 clamp(3rem, 7vw, 6rem);
}

.landing-hero::before {
    position: absolute;
    right: -8%;
    bottom: 8%;
    width: min(680px, 62vw);
    aspect-ratio: 1;
    border: 1px solid #17171714;
    border-radius: 50%;
    background:
        repeating-linear-gradient(60deg, transparent 0 24px, #eabb4924 24px 26px),
        #ffffff52;
    content: "";
}

.landing-hero-copy {
    position: relative;
    z-index: 2;
    display: grid;
    max-width: 760px;
    gap: 1.15rem;
}

.landing-panel {
    display: grid;
    width: min(680px, 100%);
    gap: 1.25rem;
}

.landing-brand {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--white) 86%, transparent);
    padding: 0.375rem 0.875rem 0.375rem 0.375rem;
    box-shadow: var(--shadow-sm);
}

.landing-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.landing-brand span,
.landing-kicker,
.landing-feature-grid strong {
    font-weight: 500;
}

.landing-copy {
    display: grid;
    gap: 0.875rem;
}

.landing-kicker {
    color: var(--muted);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.landing-copy h1 {
    max-width: 12ch;
    font-size: clamp(2.75rem, 8vw, 5.75rem);
    line-height: 0.96;
}

.landing-copy p:last-child {
    max-width: 34rem;
    color: var(--muted-strong);
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.45;
}

.landing-hero-copy h1 {
    max-width: 8ch;
    font-size: clamp(4rem, 13vw, 10.5rem);
    line-height: 0.88;
}

.landing-hero-copy > p:not(.landing-kicker) {
    max-width: 44rem;
    color: var(--muted-strong);
    font-size: clamp(1.08rem, 2vw, 1.35rem);
    line-height: 1.5;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.landing-hero-button {
    min-height: 3rem;
}

.landing-product-stage {
    position: absolute;
    right: 0;
    bottom: 5rem;
    z-index: 1;
    display: grid;
    width: min(520px, 48vw);
    gap: 1rem;
    pointer-events: none;
}

.landing-invoice-sheet,
.landing-payment-card {
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--white) 92%, transparent);
    box-shadow: 0 24px 80px #00000017;
    backdrop-filter: blur(16px);
}

.landing-invoice-sheet {
    display: grid;
    gap: 1rem;
    border-radius: 0.5rem;
    padding: 1.1rem;
}

.landing-sheet-head,
.landing-sheet-client,
.landing-sheet-total,
.landing-payment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.landing-sheet-head img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.landing-mini-label,
.landing-sheet-client span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.landing-sheet-client {
    align-items: flex-start;
    border-block: 1px solid var(--subtle-line);
    padding-block: 0.875rem;
}

.landing-sheet-client small {
    color: var(--muted);
}

.landing-sheet-lines {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.625rem 1rem;
    color: var(--muted-strong);
}

.landing-sheet-total {
    border-top: 2px solid var(--ink);
    padding-top: 0.8rem;
}

.landing-payment-card {
    position: relative;
    justify-self: end;
    width: min(360px, 92%);
    border-left: 8px solid rgb(234, 187, 73);
    border-radius: 0.5rem;
    padding: 1rem 1rem 1.35rem;
}

.landing-payment-amount {
    font-family: Exposure, OpenRunde, sans-serif;
    font-size: 2rem;
    font-weight: 500;
}

.landing-payment-bar {
    position: absolute;
    right: 1rem;
    bottom: 0.8rem;
    left: 1rem;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: #17171712;
}

.landing-payment-bar span {
    display: block;
    width: 68%;
    height: 100%;
    border-radius: inherit;
    background: rgb(234, 187, 73);
}

.landing-feature-grid {
    display: grid;
    max-width: 640px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.landing-feature-grid article {
    display: grid;
    gap: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--white) 88%, transparent);
    padding: 0.875rem;
    box-shadow: var(--shadow-xs);
}

.landing-feature-grid span {
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.35;
}

.landing-section,
.landing-flow-section,
.landing-trust,
.landing-final,
.landing-footer {
    width: min(1180px, calc(100% - 2rem));
    margin-inline: auto;
}

.landing-section,
.landing-flow-section,
.landing-trust,
.landing-final {
    padding-block: clamp(3rem, 7vw, 6rem);
}

.landing-suite {
    display: grid;
    grid-template-columns: minmax(260px, 0.68fr) minmax(0, 1.32fr);
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: start;
}

.landing-section-head {
    display: grid;
    max-width: 720px;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.landing-suite-head {
    position: sticky;
    top: 6rem;
    margin-bottom: 0;
}

.landing-section-head > p:not(.landing-kicker) {
    color: var(--muted-strong);
    font-size: 1rem;
    line-height: 1.5;
}

.landing-section-head h2,
.landing-trust h2,
.landing-final h2 {
    display: block;
    max-width: 11ch;
    margin: 0;
    font-family: Exposure, OpenRunde, sans-serif;
    font-size: clamp(2.25rem, 6vw, 5.5rem);
    font-weight: 500;
    line-height: 0.94;
}

.landing-suite-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
    grid-template-rows: auto auto;
    gap: 0.75rem;
}

.landing-suite-card {
    display: grid;
    min-height: 180px;
    align-content: start;
    gap: 0.625rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--white) 92%, transparent);
    padding: 1rem;
    box-shadow: var(--shadow-xs);
}

.landing-suite-card strong {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 500;
    line-height: 1.05;
}

.landing-suite-card p {
    color: var(--muted-strong);
    line-height: 1.45;
}

.landing-suite-card-main {
    min-height: 420px;
    align-content: space-between;
    grid-row: span 2;
    background:
        linear-gradient(135deg, #fff5cf 0%, #ffffff 52%),
        var(--white);
}

.landing-suite-card-main strong {
    max-width: 12ch;
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    line-height: 0.92;
}

.landing-suite-card-main p {
    max-width: 28rem;
    font-size: 1.05rem;
}

.landing-suite-card-note {
    border-color: #17171740;
    background: var(--ink);
    color: var(--white);
}

.landing-suite-card-note .landing-mini-label,
.landing-suite-card-note p {
    color: #ffffffb8;
}

.landing-suite-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.landing-suite-mini span {
    border: 1px solid #17171724;
    border-radius: 999px;
    background: #ffffffc9;
    padding: 0.45rem 0.7rem;
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 500;
}

.landing-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid #000000;
    border-radius: 0.75rem;
    background: var(--ink);
    color: var(--white);
    overflow: hidden;
}

.landing-flow article {
    display: grid;
    min-height: 260px;
    align-content: space-between;
    gap: 1rem;
    border-left: 1px solid #ffffff24;
    padding: clamp(1rem, 3vw, 1.35rem);
}

.landing-flow article:first-child {
    border-left: 0;
}

.landing-flow article strong {
    font-size: clamp(1.3rem, 2.4vw, 2rem);
    font-weight: 500;
    line-height: 1.05;
}

.landing-flow article span {
    color: rgb(234, 187, 73);
    font-family: Exposure, OpenRunde, sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 500;
    line-height: 0.86;
}

.landing-flow article p {
    color: #ffffffbf;
    line-height: 1.45;
}

.landing-flow-ledger {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: var(--white);
    margin-top: 0.75rem;
    overflow: hidden;
}

.landing-flow-ledger span {
    padding: 0.85rem 1rem;
    border-left: 1px solid var(--soft-line);
    color: var(--muted-strong);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

.landing-flow-ledger span:first-child {
    border-left: 0;
}

.landing-trust {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.75fr);
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: center;
    border-block: 1px solid var(--line);
    background:
        linear-gradient(90deg, #eef8f1 0%, transparent 34%),
        var(--surface);
}

.landing-trust-grid {
    display: grid;
    gap: 0.5rem;
}

.landing-trust-grid article {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.875rem;
    border: 1px solid var(--green-line);
    border-radius: 999px;
    background: #ffffffd4;
    padding: 0.55rem 0.95rem 0.55rem 0.55rem;
}

.landing-trust-grid span {
    display: inline-flex;
    width: 2.35rem;
    height: 2.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--green-surface);
    color: var(--green-ink);
    font-family: Exposure, OpenRunde, sans-serif;
    font-size: 1rem;
    font-weight: 500;
}

.landing-trust-grid p {
    color: var(--muted-strong);
    line-height: 1.4;
}

.landing-final {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background:
        linear-gradient(90deg, #ffffff 0%, #fff3c3 100%);
    margin-block: clamp(3rem, 7vw, 6rem);
    padding: clamp(1rem, 4vw, 2rem);
}

.landing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding-block: 1.25rem 2rem;
}

.landing-footer a {
    color: var(--ink);
    font-weight: 500;
}

.auth-card {
    width: min(440px, 100%);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--white) 96%, transparent);
    padding: 1.25rem;
    box-shadow: 0 24px 80px #0000001f;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-brand img {
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    object-fit: contain;
}

.auth-brand h1 {
    font-size: 1.75rem;
}

.auth-brand p,
.auth-message,
.auth-switch {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-panel[hidden] {
    display: none;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.auth-submit,
.auth-wide-button {
    width: 100%;
}

.auth-divider {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    background: var(--line);
    content: "";
}

.auth-provider-stack {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.auth-switch {
    text-align: center;
}

.auth-switch button {
    border: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 600;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-message {
    min-height: 1.25rem;
    margin-top: 1rem;
}

.auth-message.is-error {
    color: var(--red-ink);
}

.app-shell {
    min-height: 100dvh;
    background: var(--surface);
    padding-block: 1.5rem;
    padding-bottom: calc(7rem + env(safe-area-inset-bottom));
}

.page-wrap {
    width: 100%;
    max-width: 1480px;
    margin-inline: auto;
    padding-inline: 1rem;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: -0.75rem -0.75rem 1.5rem;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    padding: 0.75rem;
    backdrop-filter: blur(18px);
}

.brand-lockup {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1rem;
}

.brand-logo-wrap {
    display: block;
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
}

.brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.text-name {
    font-size: 24px;
    line-height: 1.3;
}

.text-label {
    font-size: 15px;
    line-height: 1.2;
}

.text-body {
    font-size: 15px;
    line-height: 1.6;
}

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

.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

body[data-view="payments"] .invoice-view-action,
body[data-view="time"] .invoice-view-action {
    display: none;
}

.action-row .payment-view-action {
    display: none;
}

body[data-view="payments"] .action-row .payment-view-action {
    display: inline-flex;
}

body[data-view="time"] .action-row {
    display: none;
}

.primary-button,
.secondary-button,
.tiny-button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-xs);
    transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1), border-color 150ms cubic-bezier(0.4, 0, 0.2, 1), background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-button:active,
.secondary-button:active,
.tiny-button:active,
.icon-button:active {
    transform: scale(0.98);
}

.primary-button svg,
.secondary-button svg,
.tiny-button svg,
.icon-button svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.primary-button {
    min-height: 40px;
    background: var(--ink);
    color: var(--surface);
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.secondary-button {
    min-height: 40px;
    background: var(--white);
    border-color: var(--line);
    color: var(--ink);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.tiny-button {
    min-height: 32px;
    background: var(--white);
    border-color: var(--line);
    color: var(--ink);
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.icon-button {
    width: 40px;
    height: 40px;
    background: var(--white);
    border-color: var(--line);
    color: var(--ink);
    padding: 0;
}

.primary-button:disabled,
.secondary-button:disabled,
.tiny-button:disabled,
.icon-button:disabled {
    border-color: var(--line);
    background: #f5f5f5;
    color: var(--muted);
    box-shadow: none;
    transform: none;
}

.ghost {
    box-shadow: none;
}

.app-view {
    display: none;
}

.app-view.is-active {
    display: block;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}

.invoice-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.invoice-edit-column {
    min-width: 0;
}

.invoice-preview-column {
    min-width: 0;
}

.invoice-preview-column .invoice-sheet {
    margin-top: 0;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.panel-title {
    font-size: 18px;
    line-height: 1.4;
    font-weight: 500;
}

.panel > .panel-title {
    margin-bottom: 1rem;
}

.invoice-editor-panel > .panel-title {
    margin-bottom: 1.25rem;
}

.section-head,
.settings-section-head,
.line-items-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.section-head {
    margin-bottom: 1rem;
    justify-content: flex-start;
}

.section-head .panel-title {
    margin-bottom: 0;
}

.muted-icon {
    width: 1rem;
    height: 1rem;
    color: var(--muted);
}

.form-stack,
.settings-section,
.client-editor,
.line-item-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-stack {
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.form-section {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid var(--line);
    padding-top: 1.25rem;
}

.form-row > .form-section {
    border-top: 0;
    padding-top: 0;
}

.collapsible-section {
    gap: 0.875rem;
}

.collapsible-trigger {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 0;
    background: transparent;
    color: var(--ink);
    padding: 0;
    text-align: left;
    font: inherit;
}

.collapsible-trigger > span:not(.collapsible-title-stack),
.collapsible-title-stack > span:first-child {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
}

.collapsible-title-stack {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.125rem;
}

.collapsible-subtitle {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collapse-icon {
    width: 1rem;
    height: 1rem;
    color: var(--muted);
    transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.collapsible-section.is-collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.collapsible-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.collapsible-body[hidden] {
    display: none;
}

.collapsible-line-head {
    align-items: center;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    padding: 0 0 0.75rem;
}

.collapsible-line-head .collapsible-trigger {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2.25rem;
}

.collapsible-line-head .tiny-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.field {
    min-width: 0;
}

.field label {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    line-height: 1.333;
    text-transform: uppercase;
}

.field label.label-with-icon {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.field-lock-icon {
    display: inline-flex;
    width: 0.875rem;
    height: 0.875rem;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.field-lock-icon[hidden] {
    display: none;
}

.field-lock-icon svg {
    width: 0.875rem;
    height: 0.875rem;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    border: 1px solid var(--input-line);
    border-radius: 0.375rem;
    outline: none;
    background: var(--white);
    color: var(--ink);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.field input,
.field select {
    height: 42px;
}

.dual-select-row {
    display: grid;
    grid-template-columns: minmax(92px, 0.78fr) minmax(118px, 1fr);
    gap: 0.5rem;
}

.field select,
.payment-range-control select,
.payment-list-controls select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted-strong) 50%),
        linear-gradient(135deg, var(--muted-strong) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    padding-right: 2.25rem;
}

.field textarea {
    min-height: 84px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--ink);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--ink);
}

.field.is-locked input,
.field.is-locked textarea,
.field input:disabled,
.field textarea:disabled {
    border-color: var(--line);
    background: #f7f7f7;
    color: var(--muted);
    cursor: not-allowed;
    box-shadow: none;
}

.split-grid,
.triple-grid,
.quad-grid,
.item-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.triple-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quad-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.item-grid {
    grid-template-columns: minmax(132px, 1fr) minmax(86px, 0.65fr) minmax(104px, 0.8fr) auto;
    align-items: end;
}

.item-description-field {
    grid-column: 1 / -1;
}

.item-description-field textarea {
    min-height: 96px;
}

.item-remove-button {
    align-self: end;
}

.form-section h3,
.line-items-head h3,
.settings-section h3 {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
}

.line-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.line-items-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px dashed var(--input-line);
    border-radius: 0.75rem;
    background: #fff;
    padding: 1rem;
}

.line-items-empty p {
    color: var(--muted);
    font-size: 0.875rem;
}

.line-item-editor,
.client-editor {
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: #fff;
    padding: 1rem;
}

.line-item-source {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.line-item-source span {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f6f6f6;
    color: var(--ink);
    padding: 0.125rem 0.5rem;
    font-weight: 500;
}

.remove-button {
    width: 36px;
    height: 36px;
    align-self: end;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0.5rem;
    transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.remove-button:hover {
    color: #dc2626;
}

.remove-button svg {
    width: 1rem;
    height: 1rem;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
}

.empty-note {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.history-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    padding: 0.875rem;
}

.history-title {
    overflow: hidden;
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-meta {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.history-actions {
    display: flex;
    gap: 0.375rem;
}

.mini-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--ink);
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.mini-action svg,
.mini-action img {
    width: 1rem;
    height: 1rem;
}

.action-svg {
    display: block;
    object-fit: contain;
}

.mini-action[data-action="pdf"] .action-svg,
.mini-action[data-payment-action="pdf"] .action-svg {
    width: 1.2rem;
    height: 1.2rem;
}

.icon-mini {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    line-height: 1;
}

.mini-action.danger {
    color: var(--red-ink);
}

.delete-popover {
    position: fixed;
    z-index: 50;
    width: 240px;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    color: var(--ink);
    padding: 0.875rem;
    box-shadow: 0 16px 48px #00000024;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 160ms cubic-bezier(0.4, 0, 0.2, 1), transform 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

.delete-popover.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.delete-popover-title {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.35;
}

.delete-popover-text {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.delete-popover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.375rem;
    margin-top: 0.75rem;
}

.payment-tracker-view {
    padding-top: 0.25rem;
}

.tracker-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.payment-tracker-view .tracker-head,
.time-tracker-view .tracker-head {
    position: sticky;
    top: 1rem;
    z-index: 14;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    padding: 0.75rem;
    backdrop-filter: blur(18px);
}

.time-tracker-view .tracker-head {
    display: none;
}

.tracker-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    padding: 0.25rem;
    box-shadow: var(--shadow-xs);
}

.tracker-actions .primary-button,
.tracker-actions .secondary-button {
    min-height: 34px;
    border-radius: 999px;
    box-shadow: none;
    padding: 0.45rem 0.75rem;
    font-size: 0.8125rem;
}

.tracker-actions .secondary-button {
    border-color: transparent;
    background: transparent;
    color: var(--muted-strong);
}

.tracker-actions .primary-button:disabled,
.tracker-actions .secondary-button:disabled {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    opacity: 1;
}

.payment-stats {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.payment-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
    gap: 0.75rem;
    align-items: stretch;
}

.payment-line-card {
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.payment-bento-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.payment-insights {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 0.75rem;
}

.payment-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.stat-panel {
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    line-height: 1.333;
    text-transform: uppercase;
}

.stat-value {
    margin-top: 0.5rem;
    color: var(--ink);
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 500;
    line-height: 1.1;
}

.stat-note {
    margin-top: 0.375rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.payment-stat-panel {
    min-height: 132px;
}

.payment-stat-panel.is-hot {
    border-color: color-mix(in srgb, rgb(234, 187, 73) 62%, var(--line));
    background: linear-gradient(180deg, #fff7df 0%, var(--white) 100%);
}

.payment-stat-panel.is-hot .stat-value {
    color: var(--ink);
}

.payment-graph-card {
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.payment-graph-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.payment-graph-head h3 {
    color: var(--ink);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.3;
}

.payment-graph-head p {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.payment-line-chart {
    position: relative;
    height: 220px;
    margin-top: 1rem;
}

.payment-line-chart canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.payment-chart-empty {
    display: grid;
    min-height: 220px;
    place-items: center;
}

.payment-graph-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.875rem;
    color: var(--muted-strong);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
}

.payment-graph-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-legend-bar {
    width: 1.45rem;
    height: 0.75rem;
    border: 1px solid var(--green-ink);
    border-radius: 0.25rem;
    background: color-mix(in srgb, var(--green-ink) 88%, var(--white));
}

.payment-legend-bar.is-expected {
    border-color: rgb(234, 187, 73);
    background: color-mix(in srgb, rgb(234, 187, 73) 28%, var(--white));
}

.payment-range-control {
    display: grid;
    min-width: 244px;
    gap: 0.25rem;
}

.payment-range-control span {
    color: var(--muted);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    line-height: 1.25;
    text-transform: uppercase;
}

.payment-range-control select {
    height: 34px;
    width: 100%;
    min-width: 0;
    border: 1px solid var(--input-line);
    border-radius: 999px;
    outline: none;
    background-color: var(--white);
    color: var(--ink);
    padding: 0.35rem 2rem 0.35rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: var(--shadow-xs);
}

.payment-range-selects {
    display: grid;
    grid-template-columns: minmax(86px, 0.78fr) minmax(112px, 1fr);
    gap: 0.5rem;
}

.collection-meter {
    display: flex;
    height: 1rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f7f7f7;
    margin-top: 1.25rem;
}

.collection-meter-paid {
    background: color-mix(in srgb, var(--green-ink) 82%, var(--white));
}

.collection-meter-unpaid {
    background: color-mix(in srgb, var(--red-ink) 76%, var(--white));
}

.collection-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem 1rem;
    margin-top: 0.875rem;
    color: var(--muted-strong);
    font-size: 0.75rem;
    line-height: 1.4;
}

.collection-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.legend-swatch {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 999px;
}

.legend-swatch.is-paid {
    background: color-mix(in srgb, var(--green-ink) 82%, var(--white));
}

.legend-swatch.is-unpaid {
    background: color-mix(in srgb, var(--red-ink) 76%, var(--white));
}

.payment-bar-chart {
    display: grid;
    gap: 0.625rem;
    margin-top: 1rem;
}

.payment-bar-row {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) minmax(72px, auto);
    gap: 0.625rem;
    align-items: center;
}

.payment-bar-label,
.payment-bar-value {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.2;
}

.payment-bar-value {
    color: var(--muted-strong);
    text-align: right;
}

.payment-bar-track {
    display: flex;
    width: var(--bar-width);
    min-width: 0.5rem;
    height: 0.75rem;
    overflow: hidden;
    border-radius: 999px;
    background: #f3f3f3;
}

.payment-bar-fill.is-paid {
    background: color-mix(in srgb, var(--green-ink) 80%, var(--white));
}

.payment-bar-fill.is-unpaid {
    background: color-mix(in srgb, var(--red-ink) 74%, var(--white));
}

.payment-list {
    display: grid;
    gap: 0.75rem;
}

.payment-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 0 0.5rem;
}

.payment-search-control {
    display: flex;
    min-height: 42px;
    flex: 1 1 320px;
    align-items: center;
    gap: 0.625rem;
    border: 1px solid var(--input-line);
    border-radius: 0.5rem;
    background: var(--white);
    padding: 0 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.payment-search-control:focus-within {
    border-color: var(--ink);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--ink);
}

.payment-search-control svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    color: var(--muted);
}

.payment-search-control input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-size: 0.875rem;
}

.payment-list-controls {
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
}

.payment-list-controls label {
    display: grid;
    gap: 0.25rem;
}

.payment-list-controls span {
    color: var(--muted);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    line-height: 1.25;
    text-transform: uppercase;
}

.payment-list-controls select {
    height: 36px;
    min-width: 132px;
    border: 1px solid var(--input-line);
    border-radius: 0.5rem;
    outline: none;
    background-color: var(--white);
    color: var(--ink);
    padding: 0.4rem 2rem 0.4rem 0.7rem;
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: var(--shadow-xs);
}

.payment-list-controls select:focus {
    border-color: var(--ink);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--ink);
}

.payment-list-summary {
    min-height: 1.25rem;
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.payment-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(260px, max-content) minmax(170px, auto) 32px;
    gap: 1rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.payment-card.is-paid {
    border-color: color-mix(in srgb, var(--green-ink) 34%, var(--line));
    background: linear-gradient(90deg, #ecfdf3 0%, var(--white) 34%);
}

.payment-card.is-unpaid {
    border-color: color-mix(in srgb, rgb(234, 187, 73) 58%, var(--line));
    background: linear-gradient(90deg, #fff8df 0%, var(--white) 36%);
}

.payment-card.is-selecting {
    cursor: pointer;
}

.payment-card.is-selected {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.payment-card::before {
    position: absolute;
    top: 0.875rem;
    bottom: 0.875rem;
    left: -1px;
    width: 6px;
    border-radius: 0 999px 999px 0;
    content: "";
}

.payment-card.is-paid::before {
    background: var(--green-ink);
    box-shadow: 0 0 18px color-mix(in srgb, var(--green-ink) 24%, transparent);
}

.payment-card.is-unpaid::before {
    background: rgb(234, 187, 73);
    box-shadow: 0 0 18px #eabb4940;
}

.payment-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.payment-select input {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--ink);
}

.payment-main {
    min-width: 0;
}

.payment-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
}

.payment-title {
    display: flex;
    flex: 1 1 260px;
    min-width: 0;
    align-items: baseline;
    gap: 0.5rem;
    overflow: hidden;
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
}

.payment-invoice-number {
    flex: 0 0 auto;
}

.payment-client-name {
    min-width: 0;
    overflow: hidden;
    color: var(--muted-strong);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payment-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0.5rem 0 0;
}

.payment-meta-grid div {
    min-width: 104px;
}

.payment-meta-grid dt {
    margin: 0;
    color: var(--muted);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    line-height: 1.25;
    text-transform: uppercase;
}

.payment-meta-grid dd {
    margin: 0.125rem 0 0;
    color: var(--ink);
    font-size: 0.8125rem;
    line-height: 1.35;
}

.payment-amount-block {
    justify-self: end;
    min-width: 150px;
    border-left: 1px solid var(--soft-line);
    padding-left: 1rem;
    text-align: right;
}

.payment-amount-label {
    display: block;
    color: var(--muted);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    line-height: 1.25;
    text-transform: uppercase;
}

.payment-total {
    margin-top: 0.1875rem;
    color: var(--ink);
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    font-weight: 500;
    line-height: 1.05;
    white-space: nowrap;
}

.payment-total.is-positive {
    color: var(--green-ink);
}

.payment-amount-note {
    margin-top: 0.45rem;
    color: var(--green-ink);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25;
}

.payment-status-block {
    display: flex;
    justify-self: end;
    width: min(100%, 360px);
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
    margin-right: -1.5rem;
    padding-right: 0.125rem;
}

.payment-status-copy {
    display: grid;
    min-width: 0;
    gap: 0.125rem;
}

.payment-status-copy strong {
    color: var(--ink);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.1;
}

.payment-status-copy span {
    color: var(--muted);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.25;
}

.status-clock-hive {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    overflow: visible;
}

.status-paid-hive {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    overflow: visible;
}

.hive-outline {
    fill: #fff9e8;
    stroke: var(--ink);
    stroke-linejoin: round;
    stroke-width: 2.35;
}

.paid-hive-outline {
    fill: color-mix(in srgb, var(--green-ink) 12%, var(--white));
    stroke: var(--green-ink);
    stroke-linejoin: round;
    stroke-width: 2.35;
}

.paid-hive-check {
    fill: none;
    stroke: var(--green-ink);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3.35;
}

.clock-hand-svg {
    stroke: var(--ink);
    stroke-linecap: round;
    stroke-width: 2.35;
    transform-box: fill-box;
    transform-origin: 50% 100%;
}

.clock-hand-svg.is-hour {
    animation: payment-clock-hour 9s linear infinite;
}

.clock-hand-svg.is-minute {
    animation: payment-clock-minute 3s linear infinite;
}

.payment-status-toggle {
    position: relative;
    isolation: isolate;
    min-height: 38px;
    min-width: 122px;
    overflow: hidden;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--ink);
    margin-top: 0.625rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: 0 8px 20px #0000000d;
    transition: border-color 180ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 180ms cubic-bezier(0.4, 0, 0.2, 1), transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.payment-status-toggle::before {
    position: absolute;
    inset: -40% auto -40% -58%;
    z-index: -1;
    width: 54%;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--white) 72%, transparent), transparent);
    content: "";
    opacity: 0;
    transform: skewX(-18deg);
}

.payment-status-toggle::after {
    display: inline-block;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    margin-left: 0.45rem;
    background: currentColor;
    content: "";
    opacity: 0.42;
    transform: translateY(-1px);
}

.payment-status-toggle.is-unpaid {
    border-color: rgb(234, 187, 73);
    background: linear-gradient(180deg, #fff7d6 0%, #ffe9a7 100%);
    box-shadow: 0 10px 24px #eabb4930;
}

.payment-status-toggle.is-paid {
    border-color: color-mix(in srgb, var(--green-ink) 28%, var(--line));
    background: linear-gradient(180deg, var(--green-surface) 0%, #dcfce7 100%);
    color: var(--green-ink);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--green-ink) 16%, transparent);
}

.payment-status-toggle:hover,
.payment-status-toggle:focus-visible {
    transform: translateY(-1px);
}

.payment-status-toggle:hover::before,
.payment-status-toggle:focus-visible::before {
    opacity: 1;
    animation: status-button-shine 760ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.payment-status-toggle:active {
    transform: translateY(1px) scale(0.985);
}

.payment-card-actions {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.375rem;
}

.payment-menu-trigger {
    width: 28px;
    height: 36px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    opacity: 0.68;
    transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.payment-menu-trigger:hover,
.payment-menu-trigger:focus-visible {
    opacity: 1;
}

.payment-menu-trigger:active {
    transform: scale(0.94);
}

.payment-menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 55;
    display: grid;
    min-width: 172px;
    gap: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    padding: 0.35rem;
    box-shadow: 0 18px 48px #00000024;
}

.payment-menu-panel[hidden] {
    display: none;
}

.payment-menu-item {
    display: flex;
    min-height: 38px;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--ink);
    padding: 0.45rem 0.55rem;
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: left;
}

.payment-menu-item:hover,
.payment-menu-item:focus-visible {
    background: #f7f7f7;
}

.payment-menu-item.danger {
    color: var(--red-ink);
}

.payment-menu-item .action-svg {
    width: 1rem;
    height: 1rem;
}

.gmail-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
    gap: 1rem;
    align-items: start;
}

.gmail-settings-main {
    display: grid;
    gap: 0.875rem;
}

.gmail-settings-main input[readonly] {
    background: #f7f7f7;
    color: var(--muted-strong);
}

.gmail-auto-card {
    justify-content: flex-start;
}

.gmail-pubsub-panel {
    display: grid;
    gap: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: #fafafa;
    padding: 0.875rem;
}

.gmail-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gmail-settings-side {
    display: grid;
    gap: 0.625rem;
}

.gmail-status-card {
    position: relative;
    display: flex;
    min-height: 128px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #fff8df 0%, var(--white) 58%);
    padding: 1rem;
    box-shadow: var(--shadow-xs);
}

.gmail-status-card.is-connected {
    background: linear-gradient(135deg, #ecfdf3 0%, var(--white) 62%);
    border-color: color-mix(in srgb, var(--green-ink) 28%, var(--line));
}

.gmail-status-kicker {
    color: var(--muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    line-height: 1.25;
    text-transform: uppercase;
}

.gmail-status-title {
    margin-top: 0.25rem;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.gmail-status-note {
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.gmail-status-error {
    margin-top: 0.45rem;
    color: var(--red-ink);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.35;
}

.gmail-status-dot {
    width: 0.75rem;
    height: 0.75rem;
    flex: 0 0 0.75rem;
    border-radius: 999px;
    background: rgb(234, 187, 73);
    box-shadow: 0 0 0 5px #eabb4924;
}

.gmail-status-card.is-connected .gmail-status-dot {
    background: var(--green-ink);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--green-ink) 15%, transparent);
}

.gmail-match-list {
    display: grid;
    gap: 0.5rem;
}

.gmail-match-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.625rem;
    background: var(--white);
    padding: 0.65rem 0.75rem;
}

.gmail-match-card.is-matched {
    border-color: color-mix(in srgb, var(--green-ink) 26%, var(--line));
    background: var(--green-surface);
}

.gmail-match-card.is-ambiguous {
    border-color: color-mix(in srgb, rgb(234, 187, 73) 46%, var(--line));
    background: #fff8df;
}

.gmail-match-title,
.gmail-match-card > span {
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
}

.gmail-match-meta {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.6875rem;
    line-height: 1.3;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes payment-clock-hour {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes payment-clock-minute {
    from {
        transform: rotate(80deg);
    }
    to {
        transform: rotate(440deg);
    }
}

@keyframes status-button-shine {
    from {
        transform: translateX(0) skewX(-18deg);
    }
    to {
        transform: translateX(360%) skewX(-18deg);
    }
}

.time-tracker-view {
    padding-top: 0.25rem;
}

.time-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.875rem;
    align-items: stretch;
    margin-bottom: 1.25rem;
}

.time-current-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
}

.time-current-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.time-current-head h3 {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
}

.time-current-elapsed {
    color: var(--ink);
    font-size: clamp(2rem, 7vw, 4rem);
    font-weight: 500;
    line-height: 0.95;
    white-space: nowrap;
}

.time-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.time-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.time-earnings-card {
    --salary-honeycomb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='72' viewBox='0 0 84 72' fill='none'%3E%3Cg stroke='%23eabb49' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='.92' shape-rendering='geometricPrecision'%3E%3Cpath d='M21 .5 41.8 12.5v24L21 48.5 .2 36.5v-24L21 .5Z'/%3E%3Cpath d='M63 .5 83.8 12.5v24L63 48.5 42.2 36.5v-24L63 .5Z'/%3E%3Cpath d='M42 36.5 62.8 48.5v24L42 84.5 21.2 72.5v-24L42 36.5Z'/%3E%3C/g%3E%3C/svg%3E");
    --salary-reveal-mask: linear-gradient(90deg, transparent 0%, transparent 35%, #000 46%, #000 54%, transparent 65%, transparent 100%);
    position: relative;
    grid-column: 1 / -1;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #fffdf8 0%, var(--white) 100%);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.time-earnings-card::before,
.time-earnings-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: 0;
    mask-image: var(--salary-reveal-mask);
    mask-repeat: no-repeat;
    mask-size: 280% 100%;
    mask-position: -95% 0;
    -webkit-mask-image: var(--salary-reveal-mask);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 280% 100%;
    -webkit-mask-position: -95% 0;
}

.time-earnings-card::before {
    --salary-sweep-opacity: 0.44;
    background: linear-gradient(90deg, transparent 0%, rgba(234, 187, 73, 0.06) 24%, rgba(234, 187, 73, 0.2) 50%, rgba(234, 187, 73, 0.06) 76%, transparent 100%);
    filter: blur(0.5px);
}

.time-earnings-card::after {
    --salary-sweep-opacity: 0.82;
    background-image: var(--salary-honeycomb);
    background-repeat: repeat;
    background-size: 84px 72px;
}

.time-earnings-card.is-live::before {
    animation: salary-honeycomb-sweep 6.4s infinite;
}

.time-earnings-card.is-live::after {
    animation: salary-honeycomb-sweep 6.4s infinite;
}

.time-earnings-card.is-live:not(.is-running)::before {
    --salary-sweep-opacity: 0.32;
    animation-duration: 6.9s;
}

.time-earnings-card.is-live:not(.is-running)::after {
    --salary-sweep-opacity: 0.62;
    animation-duration: 6.9s;
}

.time-earnings-card.is-running {
    border-color: #dfbc62;
    background: #fffaf0;
}

.time-earnings-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.time-earnings-value {
    position: relative;
    display: flex;
    justify-content: flex-start;
    width: fit-content;
    margin-top: 0.375rem;
    color: var(--ink);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 500;
    line-height: 0.95;
    text-align: left;
}

.time-earnings-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

.live-salary-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--ink);
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.live-salary-pill::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--muted);
}

.time-earnings-card.is-running .live-salary-pill::before {
    background: rgb(234, 187, 73);
    animation: live-dot 900ms ease-in-out infinite;
}

.time-earnings-note {
    position: relative;
    z-index: 1;
    margin-top: 0.625rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.time-rate-control {
    position: relative;
    flex: 0 0 auto;
}

.time-rate-control .mini-action {
    background: #fafafa;
}

.time-rate-popover {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 55;
    width: min(260px, calc(100vw - 2rem));
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    padding: 0.875rem;
    box-shadow: 0 16px 48px #00000024;
}

.time-rate-popover label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    line-height: 1.333;
    text-transform: uppercase;
}

.time-rate-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
}

.time-rate-input-row input {
    width: 100%;
    border: 1px solid var(--input-line);
    border-radius: 0.375rem;
    outline: none;
    background: var(--white);
    color: var(--ink);
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.time-rate-popover .secondary-button {
    width: 100%;
    min-height: 34px;
    margin-top: 0.5rem;
    justify-content: center;
    padding: 0.375rem 0.625rem;
}

.time-rate-popover .primary-button {
    min-height: 34px;
    padding: 0.375rem 0.75rem;
}

@keyframes salary-honeycomb-sweep {
    0% {
        opacity: 0;
        mask-position: -90% 0;
        -webkit-mask-position: -90% 0;
        animation-timing-function: ease-out;
    }
    6% {
        opacity: var(--salary-sweep-opacity);
        mask-position: -84% 0;
        -webkit-mask-position: -84% 0;
        animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
    }
    92% {
        opacity: var(--salary-sweep-opacity);
        mask-position: 184% 0;
        -webkit-mask-position: 184% 0;
        animation-timing-function: ease-in;
    }
    96% {
        opacity: 0;
        mask-position: 190% 0;
        -webkit-mask-position: 190% 0;
    }
    100% {
        opacity: 0;
        mask-position: -90% 0;
        -webkit-mask-position: -90% 0;
    }
}

@keyframes live-dot {
    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.65;
    }
    50% {
        transform: scale(1.25);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .time-earnings-card.is-running::before,
    .time-earnings-card::before,
    .time-earnings-card::after,
    .time-earnings-card.is-running .live-salary-pill::before {
        animation: none;
    }

    .time-earnings-card.is-live::after {
        opacity: 0.28;
        mask-position: 50% 0;
        -webkit-mask-position: 50% 0;
    }
}

.time-side-stack {
    display: grid;
    order: -1;
    gap: 0.75rem;
}

.time-invoice-panel {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.time-invoice-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.875rem;
}

.time-invoice-head h3 {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
}

.time-invoice-bridge {
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    border-radius: 0.625rem;
    background: color-mix(in srgb, var(--accent) 7%, var(--white));
    padding: 0.875rem;
}

.time-bridge-empty {
    color: var(--muted-strong);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.time-bridge-invoice {
    margin-top: 0.625rem;
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
}

.time-bridge-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.625rem;
}

.time-bridge-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    border-top: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
    padding-top: 0.5rem;
    color: var(--muted-strong);
    font-size: 0.75rem;
    line-height: 1.35;
}

.time-bridge-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.time-bridge-item strong {
    color: var(--ink);
    font-weight: 500;
}

.time-entry-list {
    display: grid;
    gap: 0.75rem;
}

.time-entry-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(96px, auto) auto;
    gap: 1rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.time-entry-card.is-added {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.time-entry-main {
    min-width: 0;
}

.time-entry-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
}

.time-entry-title {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.time-entry-meta,
.time-entry-notes,
.time-entry-link {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.time-entry-notes {
    color: var(--muted-strong);
}

.time-entry-link {
    color: var(--accent);
    font-weight: 500;
}

.time-entry-link.is-muted {
    color: var(--muted);
    font-weight: 400;
}

.time-entry-duration {
    justify-self: end;
    color: var(--ink);
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
}

.time-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
}

.time-status.is-running {
    border-color: var(--green-line);
    background: var(--green-surface);
    color: var(--green-ink);
}

.time-status.is-paused {
    border-color: var(--line);
    background: var(--surface);
    color: var(--muted-strong);
}

.time-status.is-done,
.time-status.is-added {
    border-color: var(--line);
    background: var(--white);
    color: var(--ink);
}

.time-status.is-added {
    border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
    background: color-mix(in srgb, var(--accent) 9%, var(--white));
    color: var(--accent);
}

.time-entry-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.375rem;
}

.time-entry-action {
    min-height: 32px;
    padding-inline: 0.625rem;
}

.time-entry-action.icon-mini {
    padding: 0;
}

.time-entry-action.is-primary {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--surface);
}

.floating-nav-dock {
    position: fixed;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0;
    overflow: visible;
    pointer-events: none;
}

.floating-nav {
    --active-index: 1;
    position: relative;
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(106px, 1fr));
    isolation: isolate;
    min-width: 0;
    overflow: visible;
    pointer-events: auto;
}

body[data-view="time"] .floating-nav {
    --active-index: 0;
}

body[data-view="creator"] .floating-nav {
    --active-index: 1;
}

body[data-view="payments"] .floating-nav {
    --active-index: 2;
}

.nav-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    width: calc(100% / 3);
    border-radius: 0.5rem;
    background: rgb(234, 187, 73);
    box-shadow: inset 0 0 0 1px #0000000d;
    transform: translateX(calc(var(--active-index) * 100%));
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

.nav-tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted-strong);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: auto;
    white-space: nowrap;
    transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tab:first-child {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0;
}

.nav-tab:last-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0.5rem;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0.5rem;
}

.nav-tab svg {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    flex: 0 0 1rem;
}

.nav-tab.is-active {
    background: transparent;
    color: var(--ink);
}

.nav-tab:active {
    transform: scale(0.98);
}

.floating-nav::before {
    position: absolute;
    z-index: -1;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--white) 94%, transparent);
    box-shadow: 0 16px 48px #00000024;
    content: "";
    inset: -0.375rem;
    pointer-events: auto;
}

.floating-account-wrap {
    grid-column: 3;
    justify-self: start;
    position: relative;
    pointer-events: auto;
}

.floating-account-button {
    display: inline-flex;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--ink);
    margin-left: 0.75rem;
    overflow: visible;
    padding: 0;
    pointer-events: auto;
    box-shadow: 0 16px 48px #00000024;
    transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1), background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-account-button span {
    font-family: Exposure, OpenRunde, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
}

.floating-account-button:hover,
.floating-account-button:focus-visible,
.floating-account-button[aria-expanded="true"] {
    background: rgb(234, 187, 73);
}

.floating-account-button:active {
    transform: scale(0.96);
}

.account-popover {
    position: fixed;
    z-index: 55;
    display: grid;
    width: min(270px, calc(100vw - 1.5rem));
    gap: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    padding: 0.45rem;
    box-shadow: 0 18px 54px #00000024;
    opacity: 0;
    transform: translateY(0.375rem) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 160ms cubic-bezier(0.4, 0, 0.2, 1), transform 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

.account-popover[hidden] {
    display: none;
}

.account-popover.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.account-popover-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    border-bottom: 1px solid var(--soft-line);
    margin-bottom: 0.25rem;
    padding: 0.625rem 0.625rem 0.75rem;
}

.account-avatar.small {
    width: 38px;
    height: 38px;
    font-size: 0.8rem;
}

.account-popover-head p,
.account-popover-head span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-popover-head p {
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
}

.account-popover-head span {
    display: block;
    margin-top: 0.125rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.account-menu-item {
    display: flex;
    min-height: 38px;
    width: 100%;
    align-items: center;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--ink);
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
}

.account-menu-item:hover,
.account-menu-item:focus-visible {
    background: #f7f7f7;
}

.account-menu-item.danger {
    color: var(--red-ink);
}

.toast-host {
    position: fixed;
    top: auto;
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(5.75rem + env(safe-area-inset-bottom));
    z-index: 60;
    display: flex;
    width: min(360px, calc(100vw - 2rem));
    flex-direction: column;
    gap: 0.625rem;
    pointer-events: none;
}

.toast-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
    border: 1px solid var(--green-line);
    border-radius: 0.75rem;
    background: var(--green-surface);
    color: var(--green-ink);
    padding: 0.875rem;
    box-shadow: 0 16px 48px #00000018;
    opacity: 0;
    pointer-events: auto;
    transform: translate(1rem, 0.375rem);
    transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1), transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-card.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-card.is-error {
    border-color: var(--red-line);
    background: var(--red-surface);
    color: var(--red-ink);
}

.toast-card p {
    font-size: 0.875rem;
    line-height: 1.4;
}

.toast-close {
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: currentColor;
    padding: 0.25rem;
}

.toast-close svg {
    width: 1rem;
    height: 1rem;
}

.invoice-sheet {
    width: 100%;
    max-width: 210mm;
    margin: 1.5rem auto 0;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    color: #171717;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.invoice-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 2rem;
}

.invoice-title {
    font-family: Exposure, OpenRunde, sans-serif;
    font-size: 1.875rem;
    font-variation-settings: "EXPO" -10;
    font-weight: 500;
    line-height: 1.2;
}

.invoice-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.invoice-brand-logo {
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    object-fit: contain;
}

.invoice-small {
    margin-top: 0.25rem;
    color: #525252;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.invoice-date-stack {
    text-align: left;
}

.invoice-date-stack p,
.invoice-party p,
.invoice-footer {
    color: #525252;
    font-size: 0.875rem;
    line-height: 1.45;
}

.invoice-date-stack strong,
.invoice-party strong {
    color: #171717;
    font-weight: 500;
}

.invoice-parties {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.invoice-kicker {
    margin-bottom: 0.5rem;
    color: #737373;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    line-height: 1.333;
    text-transform: uppercase;
}

.invoice-party-name {
    color: #171717;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.45;
}

.invoice-lines {
    margin-bottom: 2.5rem;
    overflow-x: auto;
}

.invoice-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}

.invoice-table thead tr {
    border-bottom: 1px solid #171717;
}

.invoice-table tbody tr {
    border-bottom: 1px solid #e5e5e5;
}

.invoice-table th {
    padding-block: 0.75rem;
    color: #737373;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    line-height: 1.333;
    text-transform: uppercase;
}

.invoice-table td {
    padding-block: 1rem;
    color: #171717;
    font-size: 0.875rem;
    line-height: 1.45;
    vertical-align: top;
}

.invoice-table th:first-child,
.invoice-table td:first-child,
.invoice-table .description-col {
    padding-right: 1rem;
    text-align: left;
}

.invoice-table .description-col {
    padding-left: 1rem;
}

.invoice-table th:not(:first-child):not(.description-col),
.invoice-table td:not(:first-child):not(.description-col) {
    padding-left: 1rem;
    text-align: right;
}

.invoice-table .date-col {
    width: 120px;
    white-space: nowrap;
}

.invoice-table .hours-col {
    width: 100px;
}

.invoice-table .rate-col,
.invoice-table .amount-col {
    width: 140px;
}

.tabular {
    font-variant-numeric: tabular-nums;
}

.invoice-totals {
    width: 100%;
    max-width: 20rem;
    margin-left: auto;
}

.total-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    padding-block: 0.5rem;
    color: #171717;
    font-size: 0.875rem;
}

.total-row span:first-child {
    color: #525252;
}

.total-row.grand {
    border-bottom: 0;
    padding-block: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.total-row.grand span:first-child {
    color: #171717;
}

.invoice-footer {
    margin-top: 3rem;
    border-top: 1px solid #e5e5e5;
    padding-top: 1.5rem;
}

.invoice-footer p + p {
    margin-top: 0.25rem;
}

.settings-dialog {
    width: min(980px, calc(100vw - 2rem));
    height: min(820px, calc(100dvh - 2rem));
    max-height: min(820px, calc(100dvh - 2rem));
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    color: var(--ink);
    padding: 0;
    box-shadow: 0 24px 80px #0000002e;
}

.settings-dialog::backdrop {
    background: #17171752;
}

.invoice-preview-dialog {
    width: min(980px, calc(100vw - 2rem));
    max-height: min(900px, calc(100dvh - 2rem));
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--surface);
    color: var(--ink);
    padding: 0;
    box-shadow: 0 24px 80px #0000002e;
}

.invoice-preview-dialog::backdrop {
    background: #17171752;
}

.entry-picker-dialog {
    width: min(820px, calc(100vw - 2rem));
    max-height: min(760px, calc(100dvh - 2rem));
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    color: var(--ink);
    padding: 0;
    box-shadow: 0 24px 80px #0000002e;
}

.entry-picker-dialog::backdrop {
    background: #17171752;
}

.time-edit-dialog {
    width: min(720px, calc(100vw - 2rem));
    max-height: min(720px, calc(100dvh - 2rem));
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    color: var(--ink);
    padding: 0;
    box-shadow: 0 24px 80px #0000002e;
}

.time-edit-dialog::backdrop {
    background: #17171752;
}

.invoice-preview-shell,
.entry-picker-shell,
.time-edit-shell {
    display: flex;
    max-height: inherit;
    flex-direction: column;
}

.invoice-preview-header,
.entry-picker-header,
.time-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--white);
    padding: 1rem 1.25rem;
}

.invoice-preview-body,
.entry-picker-body,
.time-edit-body {
    overflow: auto;
    padding: 1.25rem;
}

.time-edit-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.time-edit-actions {
    border-top: 1px solid var(--line);
    padding: 1rem 1.25rem;
}

.entry-picker-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.entry-picker-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    padding: 1rem;
}

.entry-picker-list,
.custom-entry-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-entry-panel[hidden] {
    display: none;
}

.entry-picker-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.875rem;
}

.entry-picker-card.is-linked {
    background: #fafafa;
}

.entry-picker-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.entry-picker-title {
    font-size: 0.9375rem;
    font-weight: 500;
}

.entry-picker-meta,
.entry-picker-notes {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.preview-invoice-sheet {
    margin-top: 0;
}

.settings-shell {
    display: flex;
    height: 100%;
    max-height: inherit;
    flex-direction: column;
}

.settings-header,
.settings-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
}

.settings-header {
    border-bottom: 1px solid var(--line);
}

.settings-footer {
    border-top: 1px solid var(--line);
    justify-content: flex-end;
}

.settings-body {
    display: grid;
    min-height: 0;
    flex: 1 1 auto;
    grid-template-columns: 218px minmax(0, 1fr);
    overflow: hidden;
    padding: 0;
}

.settings-nav {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.25rem;
    border-right: 1px solid var(--line);
    background: #fafafa;
    padding: 0.75rem;
    overflow: auto;
}

.settings-nav-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--muted);
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    transition: background 150ms cubic-bezier(0.4, 0, 0.2, 1), border-color 150ms cubic-bezier(0.4, 0, 0.2, 1), color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-nav-item:hover {
    background: #f2f2f2;
    color: var(--ink);
}

.settings-nav-item.is-active {
    border-color: var(--line);
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.settings-nav-item svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.settings-content {
    min-width: 0;
    overflow: auto;
    padding: 1.25rem;
}

.settings-section {
    border: 0;
    border-radius: 0;
    padding: 0;
}

.settings-panel {
    display: flex;
    max-width: 720px;
    flex-direction: column;
    gap: 1rem;
}

.settings-panel[hidden] {
    display: none;
}

.settings-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.875rem;
}

.settings-panel-head h3 {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
}

.settings-hint {
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.toggle-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 0.875rem;
}

.toggle-card input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--ink);
}

.client-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.client-editor-title {
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-editor-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: #fafafa;
    padding: 1rem;
}

.account-avatar {
    display: inline-flex;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: rgb(234, 187, 73);
    color: var(--ink);
    font-family: Exposure, OpenRunde, sans-serif;
    font-size: 1rem;
    font-weight: 500;
}

.account-name {
    color: var(--ink);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.3;
}

.account-meta {
    margin-top: 0.125rem;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.35;
}

.security-stack {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.security-card {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: #fafafa;
    padding: 1rem;
}

.security-card h3 {
    font-size: 0.9375rem;
}

.passkey-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.passkey-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--soft-line);
    border-radius: 0.5rem;
    background: var(--white);
    padding: 0.75rem;
}

.passkey-row strong {
    display: block;
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.passkey-row span {
    display: block;
    margin-top: 0.125rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.security-output {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: var(--white);
    color: var(--ink);
    padding: 0.75rem;
}

.security-form {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.invite-button {
    align-self: end;
    min-height: 44px;
}

.security-actions {
    justify-content: flex-start;
}

.danger-button {
    border-color: var(--red-line);
    background: var(--red-surface);
    color: var(--red-ink);
}

.pdf-stage {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2147483647;
    width: 178mm;
    background: #ffffff;
    pointer-events: none;
}

.pdf-sheet {
    width: 178mm;
    max-width: none;
    margin: 0;
    box-shadow: none;
}

@media (min-width: 40rem) {
    .app-shell {
        padding-block: 2.5rem;
        padding-bottom: calc(7rem + env(safe-area-inset-bottom));
    }

    .page-wrap {
        padding-inline: 2rem;
    }

    .invoice-sheet {
        padding: 3rem;
    }

    .invoice-header {
        flex-direction: row;
        align-items: flex-start;
    }

    .invoice-date-stack {
        text-align: right;
    }

    .invoice-parties {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 64rem) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .form-row-two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 76rem) {
    .invoice-workbench {
        grid-template-columns: minmax(0, 1.08fr) minmax(430px, 0.92fr);
        gap: 1.5rem;
    }

    .invoice-preview-column {
        position: sticky;
        top: calc(var(--topbar-offset, 96px) + 1.5rem);
        max-height: calc(100dvh - var(--topbar-offset, 96px) - 2.5rem);
        overflow: auto;
        padding-bottom: 0.25rem;
    }

    .invoice-preview-column .invoice-sheet {
        padding: 2rem;
    }

    .invoice-preview-column .invoice-table {
        min-width: 0;
    }

    .invoice-preview-column .invoice-table th,
    .invoice-preview-column .invoice-table td {
        font-size: 0.75rem;
    }

    .invoice-preview-column .invoice-table .date-col {
        width: 92px;
    }

    .invoice-preview-column .invoice-table .hours-col {
        width: 72px;
    }

    .invoice-preview-column .invoice-table .rate-col,
    .invoice-preview-column .invoice-table .amount-col {
        width: 92px;
    }
}

@media (max-width: 980px) {
    .auth-gate {
        padding: 1rem;
    }

    .auth-card {
        justify-self: center;
    }

    .landing-hero {
        min-height: auto;
        padding-block: 4rem;
    }

    .landing-hero::before {
        top: 10rem;
        right: -14rem;
        bottom: auto;
        width: 560px;
    }

    .landing-product-stage {
        position: relative;
        right: auto;
        bottom: auto;
        width: 100%;
        margin-top: 2rem;
    }

    .landing-copy h1,
    .landing-copy p:last-child {
        max-width: 100%;
    }

    .landing-suite,
    .landing-suite-layout,
    .landing-flow,
    .landing-trust {
        grid-template-columns: 1fr;
    }

    .landing-suite-head {
        position: static;
    }

    .landing-suite-card-main {
        min-height: 340px;
        grid-row: auto;
    }

    .landing-trust {
        gap: 1.25rem;
    }

    .payment-dashboard {
        grid-template-columns: 1fr;
    }

    .payment-insights,
    .payment-stat-grid,
    .payment-bento-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payment-card {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .payment-status-block {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
        width: auto;
        margin-right: 0;
    }

    .payment-amount-block {
        grid-column: 1 / -1;
        justify-self: stretch;
        min-width: 0;
        border-top: 1px solid var(--soft-line);
        border-left: 0;
        padding-top: 0.75rem;
        padding-left: 0;
        text-align: left;
    }

    .payment-card-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .gmail-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .landing-site {
        background: var(--surface);
    }

    .landing-nav {
        position: relative;
        align-items: stretch;
        border-radius: 0.75rem;
        flex-direction: column;
        margin-top: 0.75rem;
    }

    .landing-nav-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.125rem;
    }

    .landing-nav-links a {
        white-space: nowrap;
    }

    .landing-nav-links .landing-nav-cta {
        margin-left: auto;
    }

    .landing-hero {
        width: min(100% - 1.5rem, 1180px);
        padding-block: 3rem;
    }

    .landing-hero-copy h1 {
        font-size: clamp(3.6rem, 24vw, 6rem);
    }

    .landing-hero-copy > p:not(.landing-kicker) {
        font-size: 1rem;
    }

    .landing-product-stage {
        gap: 0.75rem;
    }

    .landing-invoice-sheet,
    .landing-payment-card {
        width: 100%;
    }

    .landing-payment-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .landing-suite-card,
    .landing-suite-card-main {
        min-height: auto;
    }

    .landing-flow {
        grid-template-columns: 1fr;
    }

    .landing-flow article {
        min-height: auto;
        border-top: 1px solid #ffffff24;
        border-left: 0;
    }

    .landing-flow article:first-child {
        border-top: 0;
    }

    .landing-flow-ledger {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .landing-flow-ledger span:nth-child(odd) {
        border-left: 0;
    }

    .landing-flow-ledger span:nth-child(n + 3) {
        border-top: 1px solid var(--soft-line);
    }

    .landing-trust-grid article {
        align-items: start;
        border-radius: 0.5rem;
    }

    .landing-section,
    .landing-flow-section,
    .landing-trust,
    .landing-final,
    .landing-footer {
        width: min(100% - 1.5rem, 1180px);
    }

    .landing-section-head h2,
    .landing-trust h2,
    .landing-final h2 {
        max-width: 100%;
        font-size: clamp(2.35rem, 13vw, 4rem);
    }

    .landing-final {
        align-items: flex-start;
        flex-direction: column;
        margin-block: 2.5rem;
    }

    .landing-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .action-row {
        justify-content: stretch;
        width: 100%;
    }

    body[data-view="payments"] .action-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.375rem;
    }

    body[data-view="payments"].is-payment-selection-mode .action-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body[data-view="payments"] .payment-view-action {
        min-height: 36px;
        min-width: 0;
        padding: 0.45rem 0.35rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    body[data-view="payments"] .payment-view-action svg {
        width: 0.875rem;
        height: 0.875rem;
    }

    .brand-logo-wrap {
        width: 56px;
        height: 56px;
    }

    .primary-button,
    .secondary-button {
        flex: 1 1 auto;
    }

    .split-grid,
    .triple-grid,
    .quad-grid,
    .item-grid,
    .toggle-grid {
        grid-template-columns: 1fr;
    }

    .line-items-empty,
    .entry-picker-card {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .line-items-empty {
        flex-direction: column;
    }

    .collapsible-line-head {
        align-items: stretch;
        flex-direction: column;
    }

    .dialog-actions {
        flex-direction: column-reverse;
    }

    .settings-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .settings-nav {
        flex-direction: row;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 0.625rem;
    }

    .settings-nav-item {
        width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .settings-content {
        padding: 1rem;
    }

    .remove-button {
        justify-self: start;
        align-self: auto;
    }

    .history-card {
        grid-template-columns: 1fr;
    }

    .history-actions {
        flex-wrap: wrap;
    }

    .payment-insights,
    .payment-stat-grid,
    .payment-bento-grid,
    .payment-card,
    .time-workbench,
    .time-stats,
    .time-entry-card {
        grid-template-columns: 1fr;
    }

    .payment-card,
    .time-entry-card {
        align-items: start;
    }

    .payment-graph-head,
    .payment-range-control {
        align-items: stretch;
    }

    .payment-graph-head {
        flex-direction: column;
    }

    .payment-list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .payment-search-control {
        flex-basis: auto;
    }

    .payment-list-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payment-list-controls select {
        width: 100%;
        min-width: 0;
    }

    .payment-range-control {
        width: 100%;
    }

    .payment-bar-row {
        grid-template-columns: 2.25rem minmax(0, 1fr);
    }

    .payment-bar-value {
        grid-column: 2;
        text-align: left;
    }

    .payment-card {
        gap: 0.75rem;
    }

    .payment-card-actions {
        grid-column: 2;
        grid-row: auto;
    }

    .payment-amount-block {
        grid-column: 1 / -1;
        justify-self: stretch;
        min-width: 0;
        border-top: 1px solid var(--soft-line);
        border-left: 0;
        padding-top: 0.75rem;
        padding-left: 0;
        text-align: left;
    }

    .payment-total {
        text-align: left;
    }

    .time-entry-duration {
        justify-self: start;
    }

    .time-actions .primary-button,
    .time-actions .secondary-button {
        flex: 1 1 auto;
    }

    .payment-card-actions,
    .time-entry-actions,
    .tracker-actions {
        justify-content: flex-start;
    }

    .payment-tracker-view .tracker-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .payment-tracker-view .tracker-actions .primary-button,
    .payment-tracker-view .tracker-actions .secondary-button {
        width: 100%;
        min-width: 0;
        padding-inline: 0.375rem;
        white-space: nowrap;
    }

    .floating-nav-dock {
        width: auto;
    }

    .floating-nav {
        width: min(318px, calc(100vw - 7rem));
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .floating-account-button {
        margin-left: 0.5rem;
    }

    .landing-feature-grid {
        grid-template-columns: 1fr;
    }

    .landing-payment-card {
        justify-self: start;
    }

    .nav-tab {
        flex: 1 1 0;
        min-width: 0;
        padding-inline: 0.5rem;
    }

    .nav-tab svg {
        flex: 0 0 1rem;
    }

    .toast-host {
        top: auto;
        right: 0.75rem;
        bottom: calc(6.25rem + env(safe-area-inset-bottom));
        width: min(340px, calc(100vw - 1.5rem));
    }

    .invoice-sheet {
        padding: 1.5rem 1.25rem;
    }

    .invoice-preview-body {
        padding: 0.75rem;
    }

    .entry-picker-body,
    .time-edit-body {
        padding: 0.75rem;
    }

    .invoice-table {
        min-width: 600px;
    }
}

@media print {
    @page {
        size: A4;
        margin: 16mm;
    }

    html,
    body {
        background: #ffffff !important;
        color: #171717 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .print-hidden,
    .toast-host,
    .invoice-preview-dialog,
    .entry-picker-dialog,
    .settings-dialog {
        display: none !important;
    }

    #invoiceCreatorView {
        display: block !important;
    }

    .invoice-workbench {
        display: block !important;
    }

    #paymentTrackerView,
    .floating-nav {
        display: none !important;
    }

    .app-shell {
        background: #ffffff !important;
        padding: 0 !important;
    }

    .page-wrap {
        max-width: none !important;
        padding: 0 !important;
    }

    .invoice-sheet {
        margin-top: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: #ffffff !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .invoice-lines {
        overflow: visible;
    }
}
