:root {
    color-scheme: light;
    --ink: #1e2925;
    --muted: #78817b;
    --line: #e2e8f0;
    --paper: #f8fafc;
    --white: #fff;
    --forest: #183b32;
    --green: #2c785b;
    --coral: #cf5d43;
    --lime: #d4ec77;
    --mono: "DM Mono", monospace;
    --sans: "DM Sans", sans-serif;
    --display: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html { width: 100%; min-height: 100%; }
body { width: 100%; min-width: 0; min-height: 100vh; min-height: 100dvh; margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.trip-controls { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; padding: 18px 0; }
.trip-controls details { position: relative; padding: 8px; border: 1px solid var(--line); background: var(--white); }
.trip-controls summary { cursor: pointer; font-weight: 700; }
.trip-controls form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 8px; }
.trip-controls input, .trip-controls select { max-width: 100%; padding: 6px; }
.trip-switcher { align-items: center !important; margin-top: 0 !important; }
.topbar { min-height: 64px; padding: 0 max(28px, calc((100vw - 1880px) / 2)); background: var(--forest); color: #f4f8f4; display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: inline-flex; gap: 11px; align-items: center; color: inherit; text-decoration: none; font: 700 11px var(--display); letter-spacing: 1.5px; }
.mark { width: 27px; height: 27px; display: grid; place-items: center; background: var(--lime); color: var(--forest); border-radius: 50%; font: 800 14px var(--display); letter-spacing: 0; }
.topbar-meta { display: flex; align-items: center; gap: 11px; color: #c6d1cb; font: 10px var(--mono); letter-spacing: .35px; }
.live-dot, .party-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--lime); }
.currency-tag { margin-left: 12px; padding: 7px 9px; border: 1px solid #456157; border-radius: 3px; color: #f3f6f2; }
.currency-tag i { padding: 0 4px; color: #93a79b; font-style: normal; }
.shell { max-width: 1216px; margin: 0 auto; padding: 0 28px 40px; }
.ledger-shell { max-width: 1880px; }
.intro { min-height: 280px; padding: 53px 0 42px; display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0 0 12px; color: var(--green); font: 500 10px var(--mono); letter-spacing: 1.1px; }
.eyebrow b { padding: 0 4px; color: var(--coral); }
h1 { margin: 0; font: 800 43px/1.08 var(--display); letter-spacing: 0; }
h1 em { color: var(--green); font-style: normal; }
.intro-copy { margin: 14px 0 0; max-width: 430px; color: #66716b; font-size: 14px; line-height: 1.6; }
.primary-button { min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: 0 16px; border: 0; border-radius: 3px; background: var(--coral); color: white; font-weight: 700; transition: background .15s ease, transform .15s ease; }
.primary-button:hover { background: #b84a33; transform: translateY(-1px); }
.plus { font-size: 20px; font-weight: 400; line-height: 1; }
.overview { padding: 18px 0 26px; border-top: 1px solid #d8e0d9; border-bottom: 1px solid #d8e0d9; }
.section-kicker { display: flex; justify-content: space-between; color: var(--muted); font: 500 10px var(--mono); letter-spacing: .8px; }
.section-kicker .hint { letter-spacing: 0; text-transform: none; font: 12px var(--sans); }
.balance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 13px; }
.balance-card { min-height: 116px; padding: 17px 18px 15px; background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--green); }
.balance-card:nth-child(2) { border-top-color: var(--coral); }
.balance-card:nth-child(3) { border-top-color: #cfaa30; }
.party-heading { display: flex; align-items: center; gap: 8px; font: 700 13px var(--display); }
.party-dot.dot-karwals { background: #358263; }
.party-dot.dot-florent { background: #da7353; }
.party-dot.dot-navdeep { background: #d2ad2b; }
.balance-values { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }
.balance-line { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.balance-line span { color: #89918c; font: 10px var(--mono); }
.balance-line strong { font: 600 13px var(--mono); }
.positive { color: #287853; }
.negative { color: var(--coral); }
.ledger-section { padding-top: 35px; }
.ledger-heading { display: flex; align-items: end; justify-content: space-between; padding-bottom: 17px; }
.ledger-heading .eyebrow { margin-bottom: 6px; }
h2 { margin: 0; font: 800 25px var(--display); }
h2 span { vertical-align: 4px; margin-left: 3px; color: #9ba49e; font: 500 12px var(--mono); }
.search-box { width: 232px; height: 37px; display: flex; align-items: center; gap: 9px; padding: 0 9px 0 11px; border: 1px solid #dbe1dc; background: white; color: #748078; }
.search-box > span { font: 24px/1 var(--sans); transform: rotate(-20deg); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); font-size: 12px; }
.search-box input::placeholder { color: #8c958f; }
kbd { padding: 2px 5px; border: 1px solid #e2e6e2; border-radius: 2px; background: #f8f9f7; color: #78817b; font: 10px var(--mono); }
.table-wrap { width: 100%; min-width: 0; max-width: 100%; contain: paint; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; border: 1px solid #e0e5e0; background: var(--white); }
table { width: 100%; min-width: 1040px; border-collapse: collapse; text-align: left; }
thead { background: #f7f9f6; }
th { height: 40px; padding: 0 12px; border-bottom: 1px solid var(--line); color: #7e8982; font: 500 9px var(--mono); letter-spacing: .65px; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 17px; }
th.date-col { width: 120px; }
th.expense-col { min-width: 260px; }
th.total-col { min-width: 175px; }
th.party-col { min-width: 175px; }
th.actions-col { width: 75px; }
td { height: 64px; padding: 9px 12px; border-bottom: 1px solid #edf0ed; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfa; }
.date-cell span, .date-cell small { display: block; }
.date-cell span { font: 600 14px var(--mono); }
.date-cell small { margin-top: 2px; color: #909a93; font: 9px var(--mono); }
.expense-cell strong, .expense-cell small { display: block; }
.expense-cell strong { max-width: 390px; overflow: hidden; color: #29352f; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.expense-cell small { max-width: 390px; overflow: hidden; margin-top: 4px; color: #89918c; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.payer-pill { display: inline-flex; align-items: center; gap: 7px; color: #4e5b54; font-size: 11px; white-space: nowrap; }
.payer-pill .party-dot { width: 7px; height: 7px; flex-basis: 7px; }
.amount-cell { white-space: nowrap; }
.amount-cell .amount-pair { display: inline-flex; align-items: baseline; gap: 10px; }
.amount-cell .amount-eur, .amount-cell .amount-inr { font: 11px var(--mono); display: inline-block; min-width: 76px; }
.amount-cell .amount-eur { color: #445148; }
.amount-cell .amount-inr { color: #66736b; }
.amount-cell .amount-empty { color: #b0b8b2; }
.row-actions { display: flex; align-items: center; gap: 2px; }
.row-actions form { display: inline; }
.icon-button { width: 29px; height: 29px; display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #758078; font-size: 15px; }
.icon-button:hover { border-color: var(--line); background: #f4f7f3; color: var(--forest); }
.delete-button:hover { color: var(--coral); }
.ledger-footer { min-height: 46px; display: flex; justify-content: space-between; align-items: center; padding: 0 12px; color: #849087; font-size: 11px; }
.ledger-footer strong { margin-left: 7px; color: #39473f; font: 500 11px var(--mono); }
.ledger-footer i { margin: 0 2px 0 8px; color: #a6afa8; font-style: normal; }
.sharing-note { display: flex; align-items: center; gap: 8px; margin: 20px 0 0; color: #838d86; font-size: 11px; }
.sharing-note span { color: var(--green); }
.empty-filter { padding: 32px; color: var(--muted); text-align: center; }
.errors { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--coral); background: #fff0ec; color: #843b2b; font-size: 12px; }
.errors p { margin: 2px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.expense-dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 25px; border: 1px solid #dce3dc; border-radius: 5px; background: #fff; color: var(--ink); box-shadow: 0 22px 70px #14271f38; }
.expense-dialog::backdrop { background: #13241fb3; backdrop-filter: blur(2px); }
.expense-dialog form { margin: 0; }
.expense-document-picker { margin: 18px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.expense-document-options { max-height: 190px; overflow-y: auto; border: 1px solid #dce4dd; background: #fff; }
.expense-document-upload { display: grid; grid-template-columns: minmax(0, 1fr) 190px; align-items: end; gap: 10px; margin-top: 12px; }
.expense-document-upload input[type="file"] { height: auto; min-height: 39px; padding: 8px; }
.expense-document-option { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; padding: 8px 10px; border-top: 1px solid #edf1ee; cursor: pointer; }
.expense-document-option:first-child { border-top: 0; }
.expense-document-option > input { margin: 2px 0 0; }
.expense-document-option span { min-width: 0; display: grid; gap: 3px; }
.expense-document-option strong { color: #35483c; font-size: 11px; overflow-wrap: anywhere; }
.expense-document-option small { color: #68766d; font-size: 9px; overflow-wrap: anywhere; }
.expense-document-option[hidden] { display: none; }
.expense-attachment-list { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; }
.expense-attachment-link { max-width: 100%; padding: 0; border: 0; background: none; color: #315c79; font-size: 10px; text-align: left; text-decoration: underline; overflow-wrap: anywhere; cursor: pointer; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 21px; }
.dialog-heading .eyebrow { margin-bottom: 5px; }
.dialog-heading h2 { font-size: 22px; }
.close-dialog { font-size: 21px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 12px; }
.field { display: flex; flex-direction: column; gap: 6px; color: #5c6961; font-size: 11px; font-weight: 600; }
.field.full { grid-column: 1 / -1; }
.field input, .field select { width: 100%; height: 39px; padding: 0 10px; border: 1px solid #dce3dc; border-radius: 2px; outline: none; background: white; color: var(--ink); font-size: 12px; }
.date-input-control { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; width: 100%; }
.date-input-control .date-display-input { width: 100%; min-width: 0; height: 39px; padding: 0 10px; border: 1px solid #dce3dc; border-radius: 2px; outline: none; background: white; color: var(--ink); font: 12px var(--mono); }
.date-input-control .date-display-input:focus { border-color: var(--green); box-shadow: 0 0 0 2px #2c785b1a; }
.date-input-control .date-picker-button { min-width: 76px; min-height: 39px; padding: 0 8px; border: 1px solid #cbd5cd; border-radius: 2px; background: #f7f9f7; color: var(--forest); font-size: 11px; font-weight: 700; }
.date-input-control .date-picker-button:hover { border-color: var(--green); background: #edf4ef; }
.date-input-control .date-native-input { position: absolute; top: 0; left: 0; width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.field input:focus, .field select:focus, .currency-inputs input:focus { border-color: var(--green); box-shadow: 0 0 0 2px #2c785b1a; }
.shares-heading { display: flex; justify-content: space-between; align-items: baseline; margin: 23px 0 8px; color: #748078; font: 500 9px var(--mono); letter-spacing: .7px; }
.shares-heading small { letter-spacing: 0; font: 11px var(--sans); }
.share-party { display: grid; grid-template-columns: 105px 1fr; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #edf0ed; }
.share-party-name { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; }
.currency-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.currency-inputs label { position: relative; }
.currency-inputs label > span { position: absolute; top: 9px; left: 9px; color: #849087; font: 11px var(--mono); }
.currency-inputs input { width: 100%; height: 34px; padding: 0 8px 0 25px; border: 1px solid #e0e5e0; border-radius: 2px; outline: 0; font: 11px var(--mono); }
.dialog-actions { display: flex; align-items: center; justify-content: end; gap: 9px; margin-top: 22px; padding-top: 15px; border-top: 1px solid #edf0ed; }
.dialog-actions .primary-button { min-height: 39px; }
.text-button { min-height: 38px; padding: 0 13px; border: 0; background: transparent; color: #69766e; }
.text-button:hover { color: var(--ink); }
@media (max-width: 760px) {
    .topbar { min-height: 56px; flex-wrap: wrap; gap: 8px 16px; padding: 8px 18px; }
    .topbar-left { min-width: 0; gap: 8px; }
    .top-nav-tabs { gap: 0; }
    .nav-tab { padding: 6px 8px; font-size: 11px; }
    .topbar-meta { gap: 7px; font-size: 8px; }
    .currency-tag { margin-left: 3px; padding: 6px; }
    .shell { padding: 0 18px 30px; }
    .intro { min-height: 0; padding: 43px 0 29px; align-items: end; gap: 16px; }
    h1 { font-size: 37px; }
    .intro-copy { max-width: 350px; font-size: 12px; }
    .intro > .primary-button { flex: 0 0 auto; padding: 0 11px; font-size: 11px; }
    .balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .balance-card { min-height: 108px; padding: 13px 11px; }
    .party-heading { gap: 6px; font-size: 15px; }
    .balance-values { grid-template-columns: 1fr; gap: 6px; margin-top: 10px; }
    .balance-line { justify-content: space-between; gap: 4px; }
    .balance-line span { font-size: 12px; }
    .balance-line strong { font-size: 14px; }
    .ledger-heading { align-items: end; gap: 8px; }
    .search-box { width: min(205px, 54vw); }
}
@media (max-width: 480px) {
    .topbar-meta > span:nth-child(2) { display: none; }
    .intro { display: block; padding-top: 35px; }
    .intro > .primary-button { margin-top: 17px; }
    h1 { font-size: 35px; }
    .section-kicker .hint { max-width: 145px; text-align: right; }
    .balance-grid { grid-template-columns: 1fr; }
    .balance-card { min-height: 0; padding: 12px 14px; }
    .balance-values { grid-template-columns: 1fr 1fr; }
    .balance-line { justify-content: start; gap: 6px; }
    .ledger-section { padding-top: 27px; }
    .ledger-heading { align-items: start; flex-direction: column; }
    .search-box { width: 100%; }
    .ledger-footer { align-items: start; flex-direction: column; justify-content: center; gap: 7px; padding: 10px 12px; }
    .expense-dialog { padding: 20px 16px; }
    .expense-document-upload { grid-template-columns: minmax(0, 1fr); }
    .share-party { grid-template-columns: 85px 1fr; gap: 6px; }
    .currency-inputs { gap: 5px; }
    .currency-inputs input { padding-left: 22px; font-size: 10px; }
    .currency-inputs label > span { left: 7px; }
}

.auth-page { min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse at 15% 80%, #dfe9dc 0, transparent 38%), var(--paper); }
.auth-top-note { color: #c6d1cb; font: 10px var(--mono); letter-spacing: .6px; }
.auth-shell { width: min(920px, calc(100% - 48px)); min-height: calc(100vh - 64px); display: grid; grid-template-columns: 1fr 390px; align-items: center; gap: 70px; margin: 0 auto; padding: 70px 0; }
.auth-intro h1 { font-size: 44px; }
.auth-intro > p:last-child { max-width: 390px; margin: 16px 0 0; color: #66716b; font-size: 14px; line-height: 1.7; }
.auth-form { display: grid; gap: 17px; padding: 26px; border: 1px solid var(--line); background: white; box-shadow: 0 18px 45px #183b3210; }
.auth-submit { width: 100%; justify-content: space-between; margin-top: 4px; }
.auth-error { margin: 0; }
.signed-in-name { color: #f3f6f2; font: 11px var(--sans); letter-spacing: 0; }
.logout-form { margin: 0; }
.logout-button { padding: 6px 9px; border: 1px solid #456157; border-radius: 2px; background: transparent; color: #e2e9e4; font: 10px var(--sans); }
.logout-button:hover { border-color: #9db1a5; color: white; }
.sharing-note { margin-bottom: 34px; }
.account-section { padding: 28px 0 34px; border-top: 1px solid #d8e0d9; }
.account-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.account-section-heading .eyebrow { margin-bottom: 5px; }
.account-section-heading h2 { font-size: 21px; }
.account-section-heading > span { color: var(--muted); font-size: 11px; }
.password-form { display: flex; align-items: end; gap: 12px; max-width: 760px; }
.password-form .field { flex: 1; }
.field select { height: 39px; padding: 0 10px; border: 1px solid #dce3dc; border-radius: 2px; background: white; color: var(--ink); font-size: 12px; }
.secondary-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid #cbd5cd; border-radius: 2px; background: white; color: var(--forest); font-size: 11px; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.secondary-button:hover { border-color: var(--green); background: #f4f8f3; }
.admin-heading { margin: 31px 0 16px; }
.create-account-form { display: grid; grid-template-columns: 1fr 1fr 1fr 1.2fr auto; align-items: end; gap: 10px; padding: 16px; border: 1px solid var(--line); background: #fff; }
.create-account-form .field { min-width: 0; }
.create-account-form .secondary-button { height: 39px; }
.account-list { margin-top: 16px; border-top: 1px solid var(--line); }
.account-list-head, .account-row { display: grid; grid-template-columns: 1fr .7fr minmax(230px, 1.2fr) 32px; align-items: center; gap: 12px; }
.account-list-head { min-height: 34px; color: var(--muted); font: 9px var(--mono); letter-spacing: .6px; }
.account-row { min-height: 58px; border-top: 1px solid #edf0ed; color: #536057; font-size: 11px; }
.account-row strong, .account-row small { display: block; }
.account-row strong { color: var(--ink); font-size: 12px; }
.account-row small { margin-top: 3px; color: var(--muted); }
.reset-form { display: flex; gap: 6px; }
.reset-form input { width: 100%; min-width: 0; height: 34px; padding: 0 8px; border: 1px solid #dce3dc; border-radius: 2px; font-size: 11px; }
.reset-form .secondary-button { min-height: 34px; }
.account-row > div:last-child form { margin: 0; }
.remove-account { width: 28px; height: 28px; border: 0; background: transparent; color: #89918c; font-size: 19px; }
.remove-account:hover { color: var(--coral); }
@media (max-width: 760px) {
    .auth-shell { min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); grid-template-columns: 1fr 1fr; gap: 28px; }
    .auth-form { padding: 20px; }
    .create-account-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .create-account-form .secondary-button { grid-column: 1 / -1; }
    .account-list-head, .account-row { grid-template-columns: 1fr .7fr minmax(200px, 1.2fr) 30px; gap: 8px; }
    .account-list { overflow-x: auto; }
    .account-list-head, .account-row { min-width: 610px; }
}
@media (max-width: 520px) {
    .auth-shell { width: min(410px, calc(100% - 36px)); display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 26px; padding: 40px 0; }
    .auth-intro h1 { font-size: 37px; }
    .auth-form { padding: 19px; }
    .topbar-meta { gap: 7px; }
    .signed-in-name { display: none; }
    .password-form { align-items: stretch; flex-direction: column; }
    .password-form .secondary-button { align-self: start; }
    .account-section-heading { align-items: start; flex-direction: column; gap: 7px; }
    .create-account-form { grid-template-columns: 1fr; padding: 12px; }
    .create-account-form .secondary-button { grid-column: auto; }
}
.settlement-section { padding: 20px 0 25px; border-bottom: 1px solid #d8e0d9; }
.settlement-section h2 { margin-top: 9px; font-size: 21px; }
.settlement-section h2 span { vertical-align: 3px; }
.settlement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.settlement-row { min-width: 0; padding: 14px 15px; border: 1px solid var(--line); border-left: 3px solid var(--coral); background: white; }
.settlement-parties { display: flex; align-items: center; gap: 8px; min-width: 0; }
.settlement-parties strong { overflow: hidden; color: var(--ink); font: 700 12px var(--display); text-overflow: ellipsis; white-space: nowrap; }
.settlement-parties span { flex: 0 0 auto; color: var(--muted); font: 9px var(--mono); text-transform: uppercase; }
.settlement-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.settlement-amounts small, .settlement-amounts strong { display: block; }
.settlement-amounts small { margin-bottom: 4px; color: #89918c; font: 9px var(--mono); }
.settlement-amounts strong { color: #39473f; font: 500 12px var(--mono); white-space: nowrap; }
.settled-state { margin: 13px 0 0; padding: 15px; border: 1px solid var(--line); background: white; color: var(--green); font-size: 12px; }
@media (max-width: 760px) {
    .settlement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .settlement-grid { grid-template-columns: 1fr; }
}
.expense-total-grid, .total-check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.expense-total-grid { margin-top: 17px; }
.total-input-wrap { position: relative; }
.total-input-wrap > span { position: absolute; top: 11px; left: 10px; color: #849087; font: 11px var(--mono); }
.total-input-wrap input { width: 100%; height: 39px; padding: 0 10px 0 28px; border: 1px solid #dce3dc; border-radius: 2px; outline: none; background: white; color: var(--ink); font: 12px var(--mono); }
.total-input-wrap input:focus { border-color: var(--green); box-shadow: 0 0 0 2px #2c785b1a; }
.total-input-wrap input[aria-invalid="true"] { border-color: var(--coral); background: #fff4f0; color: #a83e2a; box-shadow: 0 0 0 1px #cf5d4330; }
.total-check-grid { margin-top: 8px; }
.total-check { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 8px; padding: 8px 10px; border: 1px solid var(--line); background: #f7f9f6; }
.total-check > span { color: #69766e; font-size: 10px; }
.total-check > strong { color: var(--ink); font: 500 11px var(--mono); }
.total-check > small { grid-column: 1 / -1; color: var(--green); font-size: 10px; }
.total-check.is-mismatch { border-color: #e8b3a7; background: #fff4f0; }
.total-check.is-mismatch > strong, .total-check.is-mismatch > small { color: #b7432e; }
@media (max-width: 420px) {
    .expense-total-grid, .total-check-grid { gap: 7px; }
    .total-input-wrap input { padding-right: 5px; font-size: 11px; }
    .total-check { grid-template-columns: 1fr; gap: 3px; padding: 7px; }
    .total-check > small { grid-column: auto; }
}
.balance-line { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 3px 7px; }
.balance-line strong { justify-self: end; }
.balance-line .eur-equivalent { grid-column: 2; justify-self: end; color: #929b95; font: 9px var(--mono); white-space: nowrap; }
.settlement-amounts .eur-equivalent { margin: 4px 0 0; color: #929b95; font-size: 9px; }
.exchange-rate-form { display: flex; align-items: end; gap: 12px; max-width: 760px; margin-bottom: 20px; padding: 14px; border: 1px solid var(--line); background: #fff; }
.exchange-rate-form .field { flex: 0 0 210px; }
.exchange-rate-form .secondary-button { min-height: 39px; }
.exchange-rate-form p { max-width: 360px; margin: 0 0 2px; color: var(--muted); font-size: 10px; line-height: 1.5; }
@media (max-width: 520px) {
    .exchange-rate-form { align-items: stretch; flex-direction: column; gap: 10px; }
    .exchange-rate-form .field { flex-basis: auto; }
    .exchange-rate-form .secondary-button { align-self: start; }
}
/* ==========================================================================
   TOPBAR TABS & BRANDING
   ========================================================================== */
.topbar-left { display: flex; align-items: center; gap: 24px; }
.top-nav-tabs { display: flex; align-items: center; gap: 6px; }
.nav-tab { padding: 6px 12px; border-radius: 4px; color: #a4b8af; text-decoration: none; font: 600 12px var(--display); letter-spacing: 0.3px; transition: all .15s ease; }
.nav-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav-tab.is-active { color: #fff; background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 -2px 0 var(--lime); }

/* ==========================================================================
   PLANNER DASHBOARD & 7-DAY ROLLING GRID
   ========================================================================== */
.planner-shell { max-width: 1880px; }
.planner-section { min-width: 0; }
.planner-intro { min-height: 180px; padding: 36px 0 28px; }
.intro-actions { display: flex; gap: 10px; align-items: center; }

.planner-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; padding: 14px 18px; margin-bottom: 22px; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
.planner-nav-group, .planner-picker-group { display: flex; align-items: center; gap: 8px; }
.planner-window-title { display: flex; flex-direction: column; align-items: center; }
.planner-window-title strong { font: 700 15px var(--display); color: var(--forest); }
.is-active-btn { background: #e3ece6 !important; font-weight: 700 !important; color: var(--forest) !important; }
.jump-form input[type="date"] { height: 36px; padding: 0 8px; border: 1px solid #c9d4cc; border-radius: 3px; font: 12px var(--mono); color: var(--ink); background: #fdfdfd; }

.global-documents { margin-top: 30px; padding-top: 19px; border-top: 2px solid #d3ddd6; }
.global-documents-header { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 12px; }
.global-documents-header .eyebrow { margin-bottom: 5px; }
.global-documents-header h2 { display: flex; align-items: baseline; gap: 9px; margin: 0; color: var(--forest); font: 700 19px var(--display); }
.global-documents-header h2 span { color: #758179; font: 500 11px var(--mono); }
.global-doc-search { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 9px; max-width: 680px; margin-bottom: 14px; }
.global-doc-search label { display: grid; gap: 5px; color: #69776e; font-size: 10px; font-weight: 700; }
.global-doc-search input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #cbd7ce; border-radius: 2px; outline: none; background: #fff; color: var(--ink); font-size: 12px; }
.global-doc-search input:focus { border-color: var(--green); box-shadow: 0 0 0 2px #2c785b1a; }
.document-search-results { max-width: 900px; margin: 0 0 17px; border-left: 2px solid #80a68e; padding-left: 12px; }
.document-search-results h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 7px; color: #42564a; font: 700 12px var(--display); }
.document-search-results h3 span { color: #78857d; font: 500 9px var(--mono); }
.document-search-results ul { margin: 0; padding: 0; list-style: none; }
.document-search-results li { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; gap: 4px 10px; padding: 8px 0; border-top: 1px solid #e8ede9; }
.document-search-results li small, .document-search-results li p { grid-column: 2; margin: 0; color: #758179; font-size: 10px; overflow-wrap: anywhere; }
.document-search-results li p { color: #53645a; line-height: 1.45; }
.global-documents-tree { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; column-gap: 24px; border-bottom: 1px solid #e0e7e1; }
.global-documents-group { min-width: 0; border-top: 1px solid #e0e7e1; }
.global-documents-group summary { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #33463b; font-size: 12px; font-weight: 700; cursor: pointer; list-style-position: inside; }
.global-documents-group summary::marker { color: #73857a; }
.global-documents-count { min-width: 24px; padding: 2px 6px; border: 1px solid #dce4dd; border-radius: 2px; background: #f3f7f3; color: #68776d; text-align: center; font: 500 9px var(--mono); }
.global-documents-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0 0 9px 19px; padding: 0; list-style: none; }
.global-document-row { min-height: 34px; display: grid; grid-template-columns: 80px minmax(0, 1fr) 28px; align-items: center; gap: 10px; padding: 5px 8px; border-top: 1px solid #edf1ee; }
.global-document-row .doc-open-button { min-width: 0; overflow-wrap: anywhere; font-size: 11px; }
.global-document-row .chip-delete { width: 26px; height: 26px; }
@media (max-width: 1023px) {
    .global-documents-tree { grid-template-columns: minmax(0, 1fr); }
}
.doc-open-button { padding: 0; border: 0; background: none; color: var(--forest); text-align: left; font: inherit; cursor: pointer; }
.doc-open-button:hover { color: var(--green); text-decoration: underline; }

.phase-rajasthan { border-top: 2px solid #c79339; }
.phase-meghalaya { border-top: 2px solid #397f5e; }
.phase-kerala { border-top: 2px solid #318c91; }
.phase-return { border-top: 2px solid #bb5e49; }

/* Status Badges */
.status-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 3px; font: 700 9px var(--mono); letter-spacing: 0.5px; text-transform: uppercase; }
.status-confirmed { background: #dcfce7; color: #15803d; border: 1px solid #10b981; }
.status-booked { background: #e0f2fe; color: #0369a1; border: 1px solid #0284c7; }
.status-inprogress { background: #fef3c7; color: #b45309; border: 1px solid #f59e0b; }
.status-action { background: #fee2e2; color: #b91c1c; border: 1px solid #ef4444; }
.status-completed { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.status-planned { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* Responsive 7-day Grid */
.seven-day-scroll { width: 100%; min-width: 0; max-width: 100%; contain: paint; overflow-x: auto; overflow-y: hidden; padding-bottom: 12px; overscroll-behavior-x: contain; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
.table-wrap, .seven-day-scroll, .pdf-js-container { scrollbar-width: auto; scrollbar-color: var(--green) #e8eee9; }
.table-wrap::-webkit-scrollbar, .seven-day-scroll::-webkit-scrollbar, .pdf-js-container::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-track, .seven-day-scroll::-webkit-scrollbar-track, .pdf-js-container::-webkit-scrollbar-track { border-radius: 5px; background: #e8eee9; }
.table-wrap::-webkit-scrollbar-thumb, .seven-day-scroll::-webkit-scrollbar-thumb, .pdf-js-container::-webkit-scrollbar-thumb { border: 2px solid #e8eee9; border-radius: 5px; background: var(--green); }
.seven-day-grid { display: grid; grid-template-columns: 48px repeat(7, minmax(0, 1fr)) 48px; gap: 12px; align-items: stretch; width: 100%; }
@media (max-width: 1100px) { .seven-day-grid { min-width: 1540px; } }
.day-window-button { position: static; width: 48px; height: 48px; align-self: start; display: grid; place-items: center; padding: 0; border: 1px solid #cbd5cd; border-radius: 4px; background: #fff; color: var(--forest); font: 700 24px/1 var(--sans); cursor: pointer; box-shadow: 0 2px 8px #183b3218; }
.day-window-previous { scroll-snap-align: start; }
.day-window-next { scroll-snap-align: end; }
.day-window-button:hover { border-color: var(--green); background: #edf4ef; }
.day-window-button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.day-card { min-width: 0; min-height: 380px; display: flex; flex-direction: column; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 4px; transition: border-color .15s ease, box-shadow .15s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.day-card:hover { border-color: #c0cec4; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.day-card.is-today { border-color: var(--green); border-top: 3px solid var(--green); }

.day-card-header { padding: 10px 12px; background: #fbfdfb; border-bottom: 1px solid #edf1ee; display: flex; flex-direction: column; gap: 7px; }
.day-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.day-card-meta { display: flex; flex-direction: column; }
.day-dow { font: 700 10px var(--mono); color: var(--muted); letter-spacing: 0.5px; }
.day-date { font: 800 14px var(--display); color: var(--forest); }
.day-num { font: 600 10px var(--sans); color: var(--green); }
.day-location-chip { width: fit-content; max-width: 100%; padding: 3px 6px; overflow: hidden; border: 1px solid #dce4dd; border-radius: 2px; background: #f3f7f3; color: #3d5547; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.day-card-empty { padding: 28px 12px; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; flex: 1; }
.empty-text { margin: 0 0 12px; color: #9aa59f; font-size: 12px; font-style: italic; }
.full-btn { width: 100%; font-size: 11px; padding: 6px; }

.day-card-content { min-height: 0; padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 10px; overflow: visible; }
.day-title { margin: 0; font: 700 13px/1.3 var(--display); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.day-summary { margin: 0; font-size: 11px; color: #68746d; line-height: 1.4; background: #f8faf8; padding: 6px 8px; border-radius: 3px; border-left: 2px solid #b3c7bc; }

.day-items-list { display: flex; flex-direction: column; gap: 8px; }
.item-chip { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 4px; row-gap: 4px; padding: 9px; background: #fbfdfb; border: 1px solid #e5ebe6; border-radius: 3px; font-size: 13px; line-height: 1.45; }
.item-type-transport { border-left: 3px solid #3182ce; }
.item-type-stay { border-left: 3px solid #8a5bb5; }
.item-type-activity { border-left: 3px solid #32936b; }
.item-type-logistics { border-left: 3px solid #d18b2c; background: #fffaf0; }
.item-type-logistics.item-risk-critical { border-left-color: #c64d3c; background: #fff4f0; }
.item-top { display: flex; grid-column: 1 / -1; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.item-cat { font: 700 8px var(--mono); padding: 1px 5px; border-radius: 2px; text-transform: uppercase; }
.cat-transport { background: #e0f2fe; color: #0369a1; }
.cat-stay { background: #fef3c7; color: #b45309; }
.cat-activity { background: #dcfce7; color: #15803d; }
.cat-logistics { background: #f3e8ff; color: #7e22ce; }
.cat-other { background: #f1f5f9; color: #475569; }

.item-time { font: 600 9px var(--mono); color: #5a6660; }
.transport-time-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; border: 1px solid #d7e7f3; border-radius: 2px; background: #f1f8fd; color: #315c79; font: 600 9px var(--mono); white-space: nowrap; }
.transport-time-pill small { color: #6688a0; font-size: 7px; }
.passenger-list { display: flex; grid-column: 1 / -1; gap: 3px; margin-top: 5px; }
.passenger-avatar { width: 19px; height: 19px; display: inline-grid; place-items: center; border: 1px solid #cadbd1; border-radius: 50%; background: #eaf2ed; color: #395846; font: 700 9px var(--sans); }
.item-title-row { min-width: 0; grid-column: 1; grid-row: 2; }
.item-title-row strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 650; color: #1e2925; line-height: 1.4; }
.item-actions { display: inline-flex; grid-column: 2; grid-row: 2; align-items: center; gap: 4px; flex-shrink: 0; }
.item-drag-handle { width: 28px; height: 32px; display: inline-grid; place-items: center; padding: 0; border: 1px solid #d5dfd8; border-radius: 3px; background: #fff; color: #627268; font-size: 16px; line-height: 1; cursor: grab; touch-action: none; user-select: none; }
.item-drag-handle:active { cursor: grabbing; }
.item-chip.is-dragging { position: relative; z-index: 1; opacity: 0.72; box-shadow: 0 5px 14px #183b3226; }
.item-chip.is-recently-moved { animation: event-moved-feedback 1.1s ease-out; }
@keyframes event-moved-feedback {
    0%, 30% { outline: 2px solid var(--green); outline-offset: 1px; background-color: #e6f3e7; }
    100% { outline-color: transparent; background-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
    .item-chip.is-recently-moved { animation: none; outline: 2px solid var(--green); outline-offset: 1px; background-color: #e6f3e7; }
}
.item-chip.is-drop-before::before, .item-chip.is-drop-after::after { position: absolute; right: 6px; left: 6px; z-index: 2; height: 3px; border-radius: 2px; background: var(--green); content: ""; pointer-events: none; }
.item-chip.is-drop-before::before { top: -6px; }
.item-chip.is-drop-after::after { bottom: -6px; }
.day-items-list.is-reordering .item-chip { transition: transform 120ms ease; }
.item-link { font-size: 11px; text-decoration: none; }
.item-view-btn { width: 32px; height: 32px; display: inline-grid; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid #d5dfd8; border-radius: 3px; background: #fff; color: #627268; font-size: 18px; cursor: pointer; }
.item-view-btn:hover { border-color: #a6b9ab; background: #eff5f0; color: var(--forest); }
.item-documents { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; }
.item-document-link { max-width: 100%; overflow-wrap: anywhere; font-size: 11px; }
.attachment-icon { display: inline-block; margin-right: 5px; color: var(--green); font-size: 0.9em; }
.item-view-document { display: flex; align-items: center; gap: 6px; text-align: left; overflow-wrap: anywhere; }
.attachment-file-size { margin-left: auto; flex: 0 0 auto; color: #637169; font: 600 11px var(--mono); white-space: nowrap; }
.upload-progress-widget:not([hidden]) { display: grid; gap: 6px; margin-top: 8px; padding: 10px 12px; border: 1px solid #cadbd1; border-radius: 4px; background: #f3f8f4; }
.upload-progress-widget.is-error { border-color: #e4b3a9; background: #fff5f2; }
.upload-progress-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.upload-progress-label { color: var(--forest); font-weight: 600; }
.upload-progress-widget.is-error .upload-progress-label { color: #a63f2d; }
.upload-progress-percent { color: var(--green); font: 700 12px var(--mono); }
.upload-progress-bar { width: 100%; height: 8px; border: 0; border-radius: 4px; overflow: hidden; accent-color: var(--green); }
.upload-progress-meta { color: #59665e; font: 500 11px var(--mono); }
.upload-progress-widget.is-error .upload-progress-meta { color: #a63f2d; font-family: var(--sans); }
.queued-upload-list:not([hidden]) { display: grid; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.queued-upload-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #d7e2da; border-radius: 3px; background: #f7faf8; font-size: 12px; color: var(--ink); }
.queued-upload-name { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; font-weight: 500; }
.queued-upload-rename-field { display: flex; min-width: 140px; flex: 1 1 180px; align-items: center; gap: 4px; }
.queued-upload-name-input { width: 100%; min-width: 0; height: 30px; padding: 0 7px; border: 1px solid #c6d4ca; border-radius: 3px; background: #fff; color: var(--ink); font: 500 12px var(--sans); }
.queued-upload-name-input:focus { border-color: var(--green); outline: 2px solid #2b6b4f26; }
.queued-upload-name-input[aria-invalid="true"] { border-color: var(--coral); background: #fff8f6; }
.queued-upload-ext, .post-upload-rename-ext { flex: 0 0 auto; padding: 2px 6px; border: 1px solid #d5e0d8; border-radius: 3px; background: #eaf1ec; color: #425249; font: 600 11px var(--mono); white-space: nowrap; user-select: none; }
.queued-upload-size { flex: 0 0 auto; color: #637169; font: 600 11px var(--mono); white-space: nowrap; }
.queued-upload-remove { width: 24px; height: 24px; flex: 0 0 24px; display: inline-grid; place-items: center; border: 0; border-radius: 3px; background: transparent; color: #65736a; font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer; }
.queued-upload-remove:hover { background: #ffebe6; color: var(--coral); }
.queued-upload-error, .post-upload-rename-error { flex: 1 0 100%; color: #a63f2d; font-size: 11px; line-height: 1.3; }
.post-upload-rename-panel:not([hidden]) { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid #bdd2c4; border-radius: 4px; background: #f5faf6; }
.post-upload-rename-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.post-upload-rename-header strong { color: var(--forest); font: 700 13px var(--display); }
.post-upload-rename-header small { color: #58665e; font-size: 11px; }
.post-upload-rename-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.post-upload-rename-row { display: grid; gap: 5px; padding: 8px 10px; border: 1px solid #d5e2d8; border-radius: 4px; background: #fff; }
.post-upload-rename-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.post-upload-rename-meta { display: inline-flex; align-items: center; gap: 4px; color: #5c6a61; font: 600 11px var(--mono); }
.post-upload-rename-status { padding: 1px 6px; border-radius: 99px; font: 600 10px var(--mono); background: #e8f2ec; color: var(--green); }
.post-upload-rename-status.is-saving, .post-upload-rename-status.is-pending { background: #fdf3dc; color: #8c5d0b; }
.post-upload-rename-status.is-error { background: #ffebe6; color: #a63f2d; }
.post-upload-rename-field { display: flex; min-width: 0; align-items: center; gap: 6px; }
.post-upload-rename-input { width: 100%; min-width: 0; height: 36px; padding: 0 9px; border: 1px solid #bdd0c3; border-radius: 3px; background: #fff; color: var(--ink); font: 500 13px var(--sans); }
.post-upload-rename-input:focus { border-color: var(--green); outline: 2px solid #2b6b4f26; }
.post-upload-rename-input[aria-invalid="true"] { border-color: var(--coral); background: #fff8f6; }
.item-view-dialog { max-width: 620px; }
.item-view-dialog .modal-content { display: flex; flex-direction: column; }
.item-view-dialog .modal-body { min-width: 0; }
.item-view-date, .item-view-meta, .item-view-description { margin: 0; }
.item-view-date { color: var(--green); font: 600 12px var(--mono); }
.item-view-meta { color: #637169; font-size: 12px; }
.item-view-description { color: var(--ink); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.item-view-documents h4 { margin: 0 0 8px; color: var(--forest); font: 700 12px var(--display); }
.item-view-document-list { display: grid; gap: 6px; }
.item-view-document-list .doc-open-button { width: 100%; min-height: 40px; padding: 8px; border: 1px solid var(--line); background: #f8faf8; }
.delete-item-button { min-height: 44px; margin-right: auto; padding: 0 12px; border: 1px solid #e4b3a9; border-radius: 3px; background: #fff5f2; color: #a63f2d; font-size: 11px; font-weight: 700; }
.delete-item-button:hover { border-color: #cf7868; background: #ffebe6; }
.delete-item-button:disabled { border-color: #e3e6e3; background: #f2f3f2; color: #929a94; cursor: not-allowed; }
#item-modal .dialog-actions .text-button { min-width: 84px; min-height: 44px; padding: 0 14px; border: 1px solid #cbd5cd; border-radius: 3px; background: #f7f9f7; color: var(--forest); font-weight: 700; }
#item-modal .dialog-actions .text-button:hover { border-color: var(--green); background: #edf4ef; }
.delete-confirm-dialog { max-width: 430px; }
.delete-confirm-dialog .modal-body p { margin: 0; color: #59665e; font-size: 12px; line-height: 1.5; }
.delete-confirm-dialog #delete-confirm-input { min-height: 42px; border: 1px solid #cbd5ce; border-radius: 3px; padding: 0 10px; font: 700 15px var(--mono); letter-spacing: 2px; text-align: center; }
.delete-confirm-dialog #delete-confirm-input:focus { border-color: var(--coral); outline: 2px solid #cf5d4330; }
.item-desc { grid-column: 1 / -1; margin-top: 5px; color: #34443b; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.markdown-image-link { display: block; margin: 6px 0; text-decoration: none; }
.markdown-image { display: block; width: 100%; max-width: 100%; max-height: 160px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); background: #eef3ef; }
.item-view-description .markdown-image { max-height: 280px; margin: 8px 0; }

.day-docs-drawer { border-top: 1px dashed #e1e7e2; padding-top: 10px; margin-top: 16px; }
.day-docs-drawer summary { color: #596a60; font: 700 10px var(--mono); cursor: pointer; }
.day-docs-drawer[open] summary { margin-bottom: 7px; }
.day-docs-chips { display: flex; flex-direction: column; gap: 4px; }
.doc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; background: #f1f5f2; border: 1px solid #dbe2dd; border-radius: 3px; font-size: 11px; }
.doc-chip.mini { font-size: 10px; padding: 2px 6px; justify-content: space-between; }
.doc-chip a { color: var(--forest); text-decoration: none; font-weight: 500; }
.doc-chip a:hover { text-decoration: underline; color: var(--green); }
.doc-chip .doc-open-button { min-width: 0; overflow-wrap: anywhere; font-size: 10px; }
.chip-delete { border: 0; background: none; color: #9aa49e; cursor: pointer; padding: 0 2px; font-size: 13px; line-height: 1; }
.chip-delete:hover { color: var(--coral); }

.day-card-footer { padding: 8px 10px; background: #f9fbf9; border-top: 1px solid #edf1ee; display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.tiny-button { border: 1px solid #d4ded6; background: #fff; border-radius: 3px; padding: 3px 7px; font: 600 10px var(--sans); color: #3b4741; cursor: pointer; transition: all .15s ease; }
.tiny-button:hover { background: #eaf1ec; border-color: #b7c7bc; color: var(--forest); }

@media (max-width: 600px) {
    .global-documents-header { align-items: flex-start; flex-direction: column; }
    .global-doc-search { grid-template-columns: minmax(0, 1fr) auto; }
    .global-document-row { grid-template-columns: 66px minmax(0, 1fr) 28px; gap: 7px; }
}

/* Modals */
.modal-dialog { padding: 0; border: 0; border-radius: 6px; box-shadow: 0 16px 40px rgba(0,0,0,0.25); max-width: 580px; width: 92vw; background: #fff; }
.modal-dialog::backdrop { background: rgba(18, 35, 29, 0.55); backdrop-filter: blur(2px); }
.modal-form { display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fbfdfb; }
.modal-header h3 { margin: 0; font: 700 16px var(--display); color: var(--forest); }
.modal-close { border: 0; background: none; font-size: 22px; cursor: pointer; color: #849188; }
.modal-close:hover { color: var(--coral); }
.icon-button.modal-close, .icon-button.close-dialog { width: 48px; height: 48px; flex: 0 0 48px; font-size: 28px; line-height: 1; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; max-height: 70dvh; overflow-y: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-form { display: inline; margin: 0; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #435048; cursor: pointer; font-weight: 500; }

/* Document Viewer Modal */
.doc-modal-content { max-width: 960px; width: 95vw; height: 86vh; display: flex; flex-direction: column; }
.doc-frame-wrap { flex: 1; padding: 0; background: #262c29; display: grid; place-items: center; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; }
.doc-preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.doc-preview-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.doc-viewer-dialog { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: #202522; overflow: hidden; }
.doc-viewer-dialog::backdrop { background: #141815; }
.doc-modal-content { width: 100%; height: 100%; max-width: none; min-height: 0; border-radius: 0; }
.doc-modal-content .modal-header { position: relative; z-index: 2; flex: 0 0 auto; min-height: 58px; padding: 8px 14px; }
.doc-rename-form:not([hidden]) { display: flex; flex: 0 0 auto; align-items: end; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #39433d; background: #292f2c; color: #f5f7f5; }
.doc-rename-fields { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.doc-rename-fields label { display: grid; gap: 5px; color: #d5ddd7; font-size: 11px; }
.doc-rename-fields input { width: 100%; min-width: 0; height: 36px; padding: 0 9px; border: 1px solid #526058; border-radius: 3px; background: #202522; color: #fff; font: 13px var(--sans); }
.doc-rename-error { color: #ffaaa1; font-size: 11px; line-height: 1.35; }
.doc-rename-file-input { display: flex; min-width: 0; align-items: center; gap: 5px; }
.doc-rename-file-input span { flex: 0 0 auto; color: #c1cbc4; font: 12px var(--mono); }
.pdf-viewer-toolbar { min-height: 48px; display: flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 8px; padding: 4px 10px; border-bottom: 1px solid #39433d; background: #202522; color: #f5f7f5; }
.pdf-control { width: 40px; height: 40px; display: inline-grid; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid #526058; border-radius: 3px; background: #303a34; color: #fff; font-size: 22px; line-height: 1; touch-action: manipulation; }
.pdf-control:hover:not(:disabled) { background: #405047; }
.pdf-control:disabled { opacity: .4; cursor: default; }
.pdf-page-count, .pdf-zoom-value { min-width: 40px; color: #d5ddd7; text-align: center; font: 11px var(--mono); white-space: nowrap; }
.pdf-toolbar-divider { width: 1px; height: 24px; margin: 0 3px; background: #526058; }
.pdf-open-original { margin-left: 7px; color: #d6e5db; font-size: 11px; font-weight: 700; text-decoration: underline; white-space: nowrap; }
.doc-modal-content .modal-body { min-height: 0; max-height: none; flex: 1; padding: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; }
.doc-modal-content .doc-frame-wrap { position: relative; display: block; height: 100%; }
.doc-modal-content .doc-preview-frame { display: block; width: 100%; height: 100%; }
.doc-modal-content .doc-preview-img { display: block; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
.pdf-js-container { position: absolute; inset: 0; min-width: 0; min-height: 0; overflow-x: auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.pdf-js-container .pdfViewer { position: relative; min-height: 100%; padding: 12px 0; --scale-factor: 1; }
.pdf-js-container .pdfViewer .page { margin: 0 auto 12px; }
.pdf-scroll-area { width: 100%; height: 100%; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.pdf-page-shell { position: relative; min-width: 100%; min-height: 100%; margin: 0 auto; padding: 12px; box-sizing: border-box; }
.pdf-page-canvas { position: relative; z-index: 0; display: block; max-width: none; background: #fff; box-shadow: 0 3px 18px #0008; }
.pdf-text-layer { position: absolute; top: 12px; left: 12px; z-index: 1; overflow: hidden; color-scheme: only light; text-align: initial; opacity: 1; line-height: 1; letter-spacing: normal; word-spacing: normal; transform-origin: 0 0; forced-color-adjust: none; caret-color: CanvasText; touch-action: auto; --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.pdf-text-layer :is(span, br) { position: absolute; color: transparent; cursor: text; white-space: pre; transform-origin: 0 0; -webkit-user-select: text; user-select: text; }
.pdf-text-layer > :not(.markedContent), .pdf-text-layer .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0; font-size: calc(var(--text-scale-factor) * var(--font-height)); --scale-x: 1; --rotate: 0deg; transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.pdf-text-layer .markedContent { display: contents; }
.pdf-text-layer ::selection { background: rgb(41 112 226 / 35%); color: transparent; }
.pdf-viewer-status { position: absolute; z-index: 2; top: 50%; left: 50%; width: min(520px, calc(100% - 24px)); margin: 0; padding: 16px; transform: translate(-50%, -50%); background: #202522eF; color: #f2f4f2; font-size: 13px; line-height: 1.5; text-align: center; }
@media (max-width: 600px) {
    .doc-rename-form:not([hidden]) { align-items: stretch; flex-direction: column; gap: 8px; }
    .doc-rename-fields { width: 100%; gap: 8px; }
    .pdf-viewer-toolbar { justify-content: space-between; gap: 4px; padding: 4px 7px; }
    .pdf-control { width: 42px; height: 42px; }
    .pdf-toolbar-divider { margin: 0 1px; }
    .pdf-open-original { margin-left: 3px; font-size: 10px; }
}

@media (max-width: 760px) {
    body { font-size: 16px; line-height: 1.5; }
    .planner-nav-group { width: 100%; min-width: 0; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overflow-y: hidden; }
    .planner-nav-group .secondary-button { flex: 0 0 auto; padding-right: 7px; padding-left: 7px; font-size: 12px; }
    .planner-window-title { width: 100%; align-items: flex-start; }
    .planner-picker-group { width: 100%; min-width: 0; flex-wrap: nowrap; }
    .planner-picker-group .jump-form { flex: 1 1 120px; min-width: 0; }
    .planner-picker-group .jump-form input[type="date"] { width: 100%; min-width: 0; }
    .planner-picker-group .primary-button { flex: 0 0 auto; padding-right: 10px; padding-left: 10px; }
    .wordmark, .topbar-meta, .auth-top-note { font-size: 12px; }
    .nav-tab { min-height: 44px; display: inline-flex; align-items: center; font-size: 12px; }
    .eyebrow, .section-kicker { font-size: 12px; }
    .section-kicker .hint { font-size: 13px; }
    .intro-copy { font-size: 15px; }
    .primary-button, .secondary-button, .logout-button, .delete-item-button { min-height: 44px; font-size: 14px; }
    .search-box { height: 44px; }
    .search-box input, .field input, .field select, .currency-inputs input, .date-display-input,
    .total-input-wrap input, .global-doc-search input, .jump-form input[type="date"],
    .reset-form input, .doc-rename-fields input { min-height: 44px; font-size: 16px; }
    .field { font-size: 14px; }
    .date-input-control .date-display-input, .date-input-control .date-picker-button { min-height: 44px; font-size: 16px; }
    .topbar-meta, .section-kicker, .ledger-footer, .sharing-note { font-size: 12px; }
    th { font-size: 12px; }
    .date-cell span, .day-date { font-size: 16px; }
    .date-cell small { font-size: 12px; }
    .expense-cell strong, .day-title, .item-title-row strong { font-size: 15px; }
    .expense-cell small, .item-desc { font-size: 14px; }
    .payer-pill, .amount-cell span, .amount-cell small, .amount-cell .amount-eur, .amount-cell .amount-inr { font-size: 14px; }
    .settlement-parties strong { font-size: 15px; }
    .settlement-parties span, .settlement-amounts small { font-size: 12px; }
    .settlement-amounts strong { font-size: 14px; }
    .ledger-footer { font-size: 14px; }
    .status-badge { font-size: 11px; }
    .day-dow, .day-num, .day-docs-drawer summary { font-size: 12px; }
    .day-date { font-size: 16px; }
    .day-location-chip { font-size: 12px; }
    .empty-text, .day-summary { font-size: 14px; }
    .day-title, .item-title-row strong { font-size: 15px; }
    .item-chip { font-size: 15px; line-height: 1.5; }
    .item-chip { grid-template-columns: minmax(0, 1fr); }
    .item-title-row, .item-actions, .passenger-list, .item-desc { grid-column: 1; grid-row: auto; }
    .item-actions { justify-self: start; margin-top: 4px; }
    .item-cat, .doc-chip.mini { font-size: 11px; }
    .item-time, .transport-time-pill { font-size: 12px; }
    .transport-time-pill small { font-size: 11px; }
    .passenger-avatar { width: 24px; height: 24px; font-size: 11px; }
    .item-desc { font-size: 14px; line-height: 1.55; }
    .item-link, .doc-chip { font-size: 12px; }
    .doc-chip .doc-open-button { font-size: 14px; line-height: 1.35; }
    .global-document-row { grid-template-columns: 64px minmax(0, 1fr) 44px; gap: 6px; padding: 6px 4px; }
    .global-document-row .doc-open-button { font-size: 15px; line-height: 1.35; }
    .global-document-row .chip-delete { width: 44px; height: 44px; }
    .tiny-button { min-height: 40px; font-size: 12px; }
    .icon-button, .item-drag-handle, .item-view-btn { width: 44px; height: 44px; }
    .chip-delete { width: 44px; height: 44px; color: #65736a; font-size: 22px; font-weight: 700; }
    .close-dialog { width: 44px; height: 44px; }
}

@media (max-width: 760px), (pointer: coarse) {
    #item-modal[open] { position: fixed; inset: 0; display: flex; flex-direction: column; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; }
    #item-modal .modal-form { width: 100%; height: 100%; flex: 1 1 auto; min-height: 0; max-height: 100%; overflow: hidden; }
    #item-modal .modal-header { flex: 0 0 auto; padding-top: calc(16px + env(safe-area-inset-top)); }
    #item-modal .dialog-actions { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 0; padding: 12px 16px calc(15px + env(safe-area-inset-bottom)); }
    #item-modal .dialog-actions .delete-item-button { grid-column: 1 / -1; width: 100%; margin: 0; }
    #item-modal .dialog-actions .text-button, #item-modal .dialog-actions .primary-button { width: 100%; min-width: 0; min-height: 44px; margin: 0; }
    #item-modal .modal-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
    html:has(#item-modal[open]), body:has(#item-modal[open]) { overflow: hidden; overscroll-behavior: none; }

    #expense-dialog[open] { position: fixed; inset: 0; display: flex; flex-direction: column; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; }
    #expense-dialog form { width: 100%; height: 100%; flex: 1 1 auto; min-height: 0; max-height: 100%; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
    #expense-dialog .dialog-heading { flex: 0 0 auto; margin-bottom: 16px; padding-top: env(safe-area-inset-top); }
    #expense-dialog .dialog-actions { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 20px; }
    #expense-dialog .dialog-actions .text-button, #expense-dialog .dialog-actions .primary-button { width: 100%; min-width: 0; min-height: 44px; margin: 0; }
    html:has(#expense-dialog[open]), body:has(#expense-dialog[open]) { overflow: hidden; overscroll-behavior: none; }
}

@media (min-width: 761px) {
    body { font-size: 16px; line-height: 1.5; }
    .wordmark, .signed-in-name { font-size: 13px; }
    .topbar-meta, .auth-top-note, .eyebrow, .section-kicker { font-size: 12px; }
    .intro-copy { font-size: 16px; }
    .section-kicker .hint { font-size: 14px; }
    .balance-line span { font-size: 12px; }
    .party-heading { font-size: 15px; }
    .balance-line strong { font-size: 15px; }
    .ledger-footer, .sharing-note { font-size: 14px; }
    th { font-size: 11px; }
    .date-cell span, .day-date { font-size: 16px; }
    .date-cell small { font-size: 12px; }
    .expense-cell strong, .day-title, .item-title-row strong { font-size: 15px; }
    .expense-cell small, .item-desc { font-size: 14px; }
    .payer-pill, .amount-cell span, .amount-cell small, .amount-cell .amount-eur, .amount-cell .amount-inr { font-size: 14px; }
    .search-box input, .field input, .field select, .currency-inputs input, .date-display-input,
    .total-input-wrap input, .global-doc-search input, .jump-form input[type="date"],
    .reset-form input, .doc-rename-fields input { font-size: 16px; }
    .field { font-size: 13px; }
    .shares-heading, .account-list-head { font-size: 12px; }
    .share-party-name, .account-row { font-size: 13px; }
    .account-row strong { font-size: 14px; }
    .account-row small, .account-section-heading > span { font-size: 12px; }
    .settlement-parties strong { font-size: 15px; }
    .settlement-parties span, .settlement-amounts small, .settlement-amounts .eur-equivalent { font-size: 12px; }
    .settlement-amounts strong, .total-check > strong { font-size: 14px; }
    .total-check > span, .total-check > small, .exchange-rate-form p { font-size: 12px; }
    .secondary-button, .logout-button, .delete-item-button { font-size: 14px; }
    .status-badge { font-size: 11px; }
    .day-dow, .day-num, .day-docs-drawer summary { font-size: 12px; }
    .day-date { font-size: 16px; }
    .day-location-chip { font-size: 12px; }
    .empty-text, .day-summary { font-size: 14px; }
    .day-title, .item-title-row strong { font-size: 15px; }
    .item-chip { font-size: 15px; line-height: 1.5; }
    .item-cat, .doc-chip.mini { font-size: 11px; }
    .item-time, .transport-time-pill { font-size: 12px; }
    .transport-time-pill small { font-size: 11px; }
    .passenger-avatar { width: 24px; height: 24px; font-size: 11px; }
    .item-desc { font-size: 14px; line-height: 1.55; }
    .item-link, .doc-chip { font-size: 12px; }
    .doc-chip .doc-open-button { font-size: 14px; line-height: 1.35; }
    .global-documents-header h2 span, .global-documents-count { font-size: 12px; }
    .global-doc-search label, .document-search-results h3 { font-size: 13px; }
    .document-search-results h3 span, .document-search-results li small, .document-search-results li p { font-size: 12px; }
    .global-documents-group summary { font-size: 14px; }
    .global-document-row { grid-template-columns: 80px minmax(0, 1fr) 36px; }
    .global-document-row .doc-open-button { font-size: 14px; line-height: 1.35; }
    .tiny-button { min-height: 32px; font-size: 12px; }
    .icon-button { width: 36px; height: 36px; }
    .item-drag-handle, .item-view-btn { width: 36px; height: 36px; }
    .chip-delete, .global-document-row .chip-delete { width: 32px; height: 32px; color: #65736a; font-size: 20px; font-weight: 700; }
    .doc-rename-fields label { font-size: 13px; }
    .doc-rename-error { font-size: 12px; }
    .pdf-page-count, .pdf-zoom-value, .pdf-open-original { font-size: 12px; }
}

.settings-shell { max-width: 1050px; }
.settings-shell .account-section { padding-top: 24px; }
.settings-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.settings-nav a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); color: var(--forest); font-weight: 700; font-size: 12px; text-decoration: none; }
.settings-nav a:hover, .settings-nav a:focus-visible { border-color: var(--green); }
.settings-sections { display: grid; gap: 16px; }
.settings-card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); scroll-margin-top: 20px; }
.settings-card-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.settings-card-heading .eyebrow { margin-bottom: 6px; }
.settings-card-heading h2 { margin: 0; font-size: 20px; }
.settings-card-heading > p { max-width: 320px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.settings-notice { padding: 12px 14px; border: 1px solid #bddcc9; border-radius: 4px; background: #edf8f1; color: #23583d; }
.settings-shell .password-form { max-width: none; flex-wrap: wrap; }
.settings-shell .password-form .field { min-width: 160px; }
.settings-shell .create-account-form, .settings-shell .exchange-rate-form { max-width: none; margin: 0; padding: 0; border: 0; }
.settings-shell .settings-party-form { grid-template-columns: minmax(0, 320px) auto; justify-content: start; }
.settings-member-list { display: grid; gap: 0; margin-top: 20px; border-top: 1px solid var(--line); }
.settings-member-row { align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.settings-member-row .field { flex: 1; max-width: 360px; }
.settings-member-row .secondary-button { min-height: 39px; }

@media (max-width: 760px) {
    .settings-page .topbar-left, .settings-page .top-nav-tabs { min-width: 0; flex-wrap: wrap; }
    .settings-card { padding: 18px; }
    .settings-card-heading { align-items: start; flex-direction: column; gap: 8px; }
    .settings-shell .settings-party-form { grid-template-columns: minmax(0, 1fr) auto; }
    .settings-shell .settings-party-form .secondary-button { grid-column: auto; }
    .settings-shell .account-list { overflow: visible; }
    .settings-shell .account-list-head { display: none; }
    .settings-shell .account-row { min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 0; }
    .settings-shell .account-row > span { grid-column: 1; }
    .settings-shell .account-row > .reset-form { grid-column: 1; }
    .settings-shell .account-row > div:last-child { grid-column: 2; grid-row: 1; }
}
@media (max-width: 520px) {
    .settings-shell .settings-party-form { grid-template-columns: 1fr; }
    .settings-member-row { align-items: stretch; flex-direction: column; }
    .settings-member-row .field { max-width: none; }
    .settings-member-row .secondary-button { align-self: start; }
}
