/* Tax Check page (/tax). Colours come from base.css :root variables. */

#sidebarlist li.sidebar-active{
    background-color: var(--action_button_white);
    border-radius: 6px;
}
#sidebarlist li.sidebar-active p a{
    color: var(--primarycolor);
    font-weight: 600;
}

/* Logged-out (client demo) layout: no app sidebar, centred content. */
.tax-guestbar{
    display: flex;
    align-items: center;
    padding: 16px 32px;
    background: var(--white);
    border-bottom: 1px solid #e7e7ef;
}
.tax-guestbar img{
    height: 36px;
    display: block;
}
.tax-guest-main{
    display: flex;
    justify-content: center;
}
.tax-guest-main .tax-page{
    width: 100%;
    max-width: 1280px;
    padding-left: 32px;
    padding-right: 32px;
}
/* The results screen gets more room so the whole table fits; upload and processing keep the narrower page. */
.tax-guest-main .tax-page.tax-page-wide{
    max-width: 1600px;
    padding-left: 56px;
    padding-right: 56px;
}

.tax-page{
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 96%;
    padding: 28px 0 48px;
    box-sizing: border-box;
    font-family: "Open Sans", sans-serif;
    color: var(--black);
}
.tax-page *{
    box-sizing: border-box;
}

.tax-pagehead{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.tax-title{
    font-size: var(--title_fontsize);
    margin: 0;
}
.tax-subtitle{
    margin: 6px 0 0;
    font-size: 17px;
    line-height: 1.5;
    color: var(--textcolor);
}
.tax-headactions{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tax-alert{
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
}

.tax-view{
    display: none;
    flex-direction: column;
    gap: 18px;
}

/* Buttons and badges shared by every screen */
.tax-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-family: "Open Sans", sans-serif;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}
.tax-btn-sm{
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}
.tax-btn-primary{
    background: var(--primarycolor);
    color: var(--white);
}
.tax-btn-primary:hover{
    background: #5c2585;
}
.tax-btn-primary:disabled{
    background: #c9b3dc;
    cursor: not-allowed;
}
.tax-btn-outline{
    background: var(--white);
    color: var(--primarycolor);
    border-color: var(--light_button_color);
}
.tax-btn-outline:hover{
    background: var(--action_button_white);
}
.tax-linkbtn{
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--primarycolor);
    text-decoration: underline;
    cursor: pointer;
}
.tax-iconbtn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}
.tax-iconbtn:hover{
    background: #f1f1f5;
}
.tax-iconbtn img{
    width: 18px;
    height: 18px;
}
.tax-badge{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
}
.tax-badge::before{
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}
.tax-badge-green{ background: #ecfdf5; color: #047857; }
.tax-badge-red{ background: #fef2f2; color: #b91c1c; }
.tax-badge-amber{ background: #fffbeb; color: #92400e; }
.tax-badge-grey{ background: #f3f4f6; color: #4b5563; }
.tax-badge-purple{ background: var(--action_button_white); color: var(--primarycolor); }
.tax-muted{
    color: #6b6c72;
    font-size: 13px;
}

/* Screen 1: upload */
.tax-drop{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 24px;
    text-align: center;
    background: var(--white);
    border: 2px dashed var(--light_button_color);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.tax-drop:hover,
.tax-drop-active{
    border-color: var(--primarycolor);
    background: #fbf8fd;
}
.tax-drop-icon{
    width: 44px;
    height: 44px;
}
.tax-drop-title{
    margin: 0;
    font-size: 16px;
}
.tax-drop-hint{
    margin: 0;
    font-size: 13px;
    color: #6b6c72;
}

.tax-card{
    background: var(--white);
    border: 1px solid #e7e7ef;
    border-radius: 12px;
    overflow: hidden;
}
.tax-card[hidden]{
    display: none;
}
.tax-card-head{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #efeff4;
    font-size: 14px;
}
.tax-file-list{
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 380px;
    overflow-y: auto;
}
.tax-file-row{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-top: 1px solid #efeff4;
}
.tax-file-row:first-child{
    border-top: none;
}
.tax-file-icon{
    width: 22px;
    height: 22px;
    flex: none;
}
.tax-file-info{
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}
.tax-file-name{
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tax-file-error{
    font-size: 12px;
    color: #b91c1c;
}
.tax-file-size{
    width: 72px;
    text-align: right;
    font-size: 13px;
    color: #6b6c72;
    flex: none;
}
.tax-file-actions{
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
}

/* Screen 2: processing */
.tax-proc{
    align-self: center;
    width: 100%;
    max-width: 640px;
    margin-top: 24px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.tax-proc[hidden]{
    display: none;
}
.tax-proc-top{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.tax-proc-title{
    margin: 0;
    font-size: 20px;
}
.tax-proc-pct{
    font-size: 28px;
    color: var(--primarycolor);
    font-variant-numeric: tabular-nums;
}
.tax-proc-message{
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}
.tax-error-title{
    color: #b91c1c;
}
.tax-bar{
    height: 10px;
    border-radius: 999px;
    background: #efeaf4;
    overflow: hidden;
}
.tax-bar-fill{
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--primarycolor);
    transition: width .4s ease;
}
.tax-steps{
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.tax-step{
    position: relative;
    display: flex;
    gap: 16px;
    padding-bottom: 26px;
}
.tax-step::before{
    content: "";
    position: absolute;
    left: 15px;
    top: 36px;
    bottom: 4px;
    width: 2px;
    background: #e7e7ef;
}
.tax-step-done::before{
    background: var(--success_green_color);
}
.tax-step-last{
    padding-bottom: 0;
}
.tax-step-last::before{
    display: none;
}
.tax-step-num{
    position: relative;
    z-index: 1;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: #efeff4;
    color: #6b6c72;
}
.tax-step-active .tax-step-num{
    background: var(--primarycolor);
    color: var(--white);
    box-shadow: 0 0 0 5px var(--light_button_color);
}
.tax-step-done .tax-step-num{
    background: var(--success_green_color);
    color: var(--white);
}
.tax-step-body{
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 5px;
}
.tax-step-title{
    margin: 0;
    font-size: 15px;
    color: #6b6c72;
}
.tax-step-active .tax-step-title,
.tax-step-done .tax-step-title{
    color: var(--black);
}
.tax-step-count{
    margin: 2px 0 0;
    font-size: 13px;
    color: #6b6c72;
    font-variant-numeric: tabular-nums;
}
.tax-step-live{
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    background: #fbf8fd;
    border: 1px solid #efe6f6;
    font-size: 13.5px;
    color: var(--primarycolor);
}
.tax-step-live[hidden]{
    display: none;
}
.tax-step-live-text{
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.tax-pulse{
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primarycolor);
    animation: tax-pulse 1.4s ease-in-out infinite;
}
@keyframes tax-pulse{
    0%, 100%{ box-shadow: 0 0 0 0 var(--light_button_color); }
    50%{ box-shadow: 0 0 0 5px var(--light_button_color); }
}
@media (prefers-reduced-motion: reduce){
    .tax-pulse{ animation: none; box-shadow: 0 0 0 4px var(--light_button_color); }
    .tax-bar-fill{ transition: none; }
}
.tax-btn-row{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Screen 3: batch review */
.tax-review-head{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.tax-review-title{
    margin: 0;
    font-size: 18px;
}
.tax-tabs{
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.tax-tab{
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 18px;
    text-align: left;
    background: var(--white);
    border: 1px solid #e7e7ef;
    border-radius: 12px;
    font-family: "Open Sans", sans-serif;
    color: var(--black);
    cursor: pointer;
}
.tax-tab:hover{
    border-color: var(--light_button_color);
}
.tax-tab-active{
    border-color: var(--primarycolor);
    box-shadow: 0 0 0 1px var(--primarycolor);
    background: #fcfafd;
}
.tax-tab-label{
    font-size: 13px;
    color: #6b6c72;
}
.tax-tab-num{
    font-size: 28px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.tax-tab-of{
    font-size: 17px;
    color: #6b6c72;
}

.tax-table-wrap{
    overflow-x: auto;
    background: var(--white);
    border: 1px solid #e7e7ef;
    border-radius: 12px;
}
.tax-table{
    width: 100%;
    min-width: 1240px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}
.tax-table th,
.tax-table td{
    padding: 12px 12px;
    text-align: left;
    vertical-align: middle;
    border-top: 1px solid #efeff4;
    background: var(--white);
}
.tax-table thead th{
    border-top: none;
    background: #f8f8fb;
    color: #6b6c72;
    font-size: 12px;
    white-space: nowrap;
}
.tax-table .tax-num{
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
/* Checkbox and vendor stay visible while the rest of the table scrolls sideways. */
.tax-table .tax-col-select{
    position: sticky;
    left: 0;
    z-index: 1;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    box-sizing: border-box;
    padding-right: 0;
}
.tax-table .tax-col-vendor{
    position: sticky;
    left: 44px;
    z-index: 1;
    min-width: 190px;
    box-shadow: 1px 0 0 #efeff4;
}
.tax-table thead .tax-col-vendor,
.tax-table thead .tax-col-select{
    z-index: 2;
}
.tax-check{
    width: 16px;
    height: 16px;
    margin: 0;
    vertical-align: middle;
    accent-color: var(--primarycolor);
    cursor: pointer;
}
.tax-selection-note{
    align-self: center;
    font-size: 13px;
    color: #6b6c72;
}
.tax-col-open{
    width: 36px;
}
.tax-vendor-name{
    display: block;
    color: var(--black);
}
.tax-vendor-file{
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #6b6c72;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tax-mono{
    font-family: Consolas, "Courier New", monospace;
    font-size: 12.5px;
    white-space: nowrap;
}
.tax-cell-muted{
    color: #6b6c72;
}
.tax-row-clickable{
    cursor: pointer;
}
.tax-row-clickable:hover > td,
.tax-row-clickable:hover > th{
    background: #f8f6fc;
}
.tax-conf{
    font-variant-numeric: tabular-nums;
    margin-right: 6px;
}
.tax-conf-low{
    color: #92400e;
}
.tax-badge-flat{
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}
.tax-badge-flat::before{
    display: none;
}
.tax-badge-outline{
    background: var(--white);
    color: #6b6c72;
    border: 1px dashed #c4c4cf;
}
.tax-table td.tax-table-empty{
    padding: 28px;
    text-align: center;
    color: #6b6c72;
}
.tax-row-failed td{
    background: #fef7f7;
}
.tax-failed-wrap{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    color: #7f1d1d;
}
.tax-failed-reason{
    color: #7f1d1d;
}
.tax-code{
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #fee2e2;
    color: #991b1b;
}
.tax-sr{
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.tax-nowrap{
    white-space: nowrap;
}
.tax-badge-gap{
    margin-left: 6px;
}
.tax-vendor-button{
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
}
.tax-vendor-button:hover{
    color: var(--primarycolor);
    text-decoration: underline;
}
.tax-table .tax-col-open .tax-iconbtn img{
    width: 16px;
    height: 16px;
}
.tax-table td.tax-col-open{
    white-space: nowrap;
    width: 80px;
}
.tax-row-download svg{
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--primarycolor);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tax-iconbtn:disabled{
    cursor: not-allowed;
    opacity: .35;
    background: transparent;
}
.tax-download-note{
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
    font-size: 13px;
}
.tax-download-note[hidden]{
    display: none;
}

/* Screen 4: invoice popup */
.tax-dialog-lg{
    max-width: 1380px;
    display: flex;
    flex-direction: column;
}
.tax-popup-head{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #efeff4;
}
.tax-popup-titles{
    min-width: 0;
}
.tax-popup-titles .tax-dialog-title:focus{
    outline: none;
}
.tax-copy{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    margin-left: 2px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #9a9aa3;
    vertical-align: middle;
    cursor: pointer;
}
.tax-copy svg{
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tax-copy:hover{
    background: #f0edf7;
    color: var(--primarycolor);
}
.tax-copy:focus-visible{
    outline: 2px solid var(--primarycolor);
    outline-offset: 1px;
}
.tax-copy-done,
.tax-copy-done:hover{
    color: #15803d;
}
.tax-popup-meta{
    margin: 6px 0 0;
    font-size: 13px;
    color: #6b6c72;
    word-break: break-word;
}
.tax-popup-nav{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b6c72;
}
.tax-popup-nav .tax-iconbtn img{
    width: 14px;
    height: 14px;
}
.tax-btn:disabled{
    opacity: .5;
    cursor: not-allowed;
}
.tax-popup-sec{
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid #efeff4;
}
.tax-popup-sec[hidden]{
    display: none;
}
.tax-popup-label{
    font-size: 12px;
    color: #6b6c72;
}
.tax-popup-amounts{
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 28px;
}
.tax-popup-amounts .tax-amount{
    align-items: flex-end;
    text-align: right;
}
.tax-amount{
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tax-amount-value{
    font-size: 17px;
    font-variant-numeric: tabular-nums;
}
.tax-popup-kra-sec{
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
}
.tax-popup-kra{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}
.tax-popup-kra-message{
    flex: 1 1 320px;
    min-width: 0;
    font-size: 13.5px;
    color: var(--textcolor);
}
.tax-popup-kra-detail{
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tax-diff-table{
    width: 100%;
    max-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #fde68a;
    border-radius: 10px;
    overflow: hidden;
    font-size: 13.5px;
}
.tax-diff-table th,
.tax-diff-table td{
    padding: 9px 14px;
    text-align: left;
    border-top: 1px solid #fef3c7;
}
.tax-diff-table thead th{
    border-top: none;
    background: #fffbeb;
    color: #78350f;
    font-size: 12px;
}
.tax-diff-kra{
    color: #92400e;
}
.tax-kra-record summary{
    cursor: pointer;
    font-size: 13.5px;
    color: var(--primarycolor);
}
.tax-kra-record-groups{
    display: flex;
    flex-wrap: wrap;
    gap: 14px 48px;
    margin-top: 10px;
}
.tax-kra-record h4{
    margin: 0 0 6px;
}
.tax-kra-record dl{
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 18px;
    margin: 0;
    font-size: 13.5px;
}
.tax-kra-record dt{
    color: #6b6c72;
}
.tax-kra-record dd{
    margin: 0;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.tax-popup-sechead{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.tax-popup-sechead-left{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}
.tax-popup-h3{
    margin: 0;
    font-size: 15px;
}
.tax-select{
    min-height: 34px;
    max-width: 100%;
    padding: 0 8px;
    border: 1px solid var(--light_button_color);
    border-radius: 8px;
    background: var(--white);
    font-family: "Open Sans", sans-serif;
    font-size: 13px;
    color: var(--black);
}
.tax-select:disabled{
    color: #9a9aa3;
    background: #f8f8fb;
}
.tax-cu-edit{
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 320px;
}
.tax-input{
    min-height: 34px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 8px;
    border: 1px solid var(--light_button_color);
    border-radius: 8px;
    background: var(--white);
    color: var(--black);
}
.tax-input:focus{
    outline: 2px solid var(--primarycolor);
    outline-offset: -1px;
}
.tax-cu-warning{
    font-size: 12.5px;
    color: #92400e;
}
.tax-cu-warning:empty{
    display: none;
}
.tax-cu-original{
    font-size: 12.5px;
    color: #6b6c72;
}
.tax-link-button{
    padding: 0;
    border: none;
    background: none;
    font-size: inherit;
    color: var(--primarycolor);
    text-decoration: underline;
    cursor: pointer;
}
.tax-edited-tag{
    font-size: 11px;
    color: #6b6c72;
    text-transform: lowercase;
}
.tax-select-rate{
    min-width: 150px;
}
.tax-lines-table{
    min-width: 1180px;
}
.tax-lines-table td{
    vertical-align: top;
}
.tax-line-desc{
    min-width: 160px;
}
.tax-reason-cell{
    min-width: 170px;
    color: var(--textcolor);
}
.tax-linkbtn-sm{
    font-size: 12.5px;
}
.tax-line-pending td{
    background: #fffbeb;
}
.tax-line-pending:not(.tax-line-sub) td:first-child{
    box-shadow: inset 3px 0 0 #d97706;
}
.tax-line-sub td{
    border-top: none;
    padding-top: 0;
}
.tax-line-note{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 13px;
    color: #92400e;
}
.tax-line-why,
.tax-line-suggestion{
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 860px;
}
.tax-line-suggestion{
    color: #6b6c72;
}
.tax-segment{
    display: inline-flex;
    border: 1px solid var(--light_button_color);
    border-radius: 8px;
    overflow: hidden;
}
.tax-segment-btn{
    min-height: 34px;
    padding: 0 12px;
    border: none;
    background: var(--white);
    font-size: 13px;
    color: var(--textcolor);
    cursor: pointer;
}
.tax-segment-btn + .tax-segment-btn{
    border-left: 1px solid var(--light_button_color);
}
.tax-segment-btn:hover:not(:disabled){
    background: var(--action_button_white);
}
.tax-segment-btn:disabled{
    color: #b4b4bd;
    cursor: not-allowed;
}
.tax-segment-on{
    background: var(--primarycolor);
    color: var(--white);
}
.tax-segment-on:hover:not(:disabled){
    background: #5c2585;
}
.tax-segment-over{
    background: #92400e;
    color: var(--white);
}
.tax-segment-over:hover:not(:disabled){
    background: #7a3509;
}
.tax-issues{
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
}
.tax-popup-foot{
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    font-size: 14px;
}

/* Dialogs */
.tax-overlay.tax-overlay-open{
    display: flex;
}
.tax-dialog{
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    width: 100%;
    font-family: "Open Sans", sans-serif;
    color: var(--black);
}
.tax-dialog-sm{
    max-width: 460px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tax-dialog-title{
    margin: 0;
    font-size: 18px;
}
.tax-dialog-body{
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--textcolor);
}
.tax-btn-row-end{
    justify-content: flex-end;
}
.tax-btn-danger{
    background: #b91c1c;
    color: var(--white);
}
.tax-btn-danger:hover{
    background: #991b1b;
}

.tax-overlay{
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(38, 38, 39, 0.5);
    justify-content: center;
    align-items: flex-start;
    padding: 32px 24px;
    overflow: auto;
    z-index: 1000;
}
.tax-overlay-top{
    z-index: 1010;
    align-items: center;
}

.tax-toast{
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1020;
    max-width: 380px;
    background: var(--black);
    color: var(--white);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.tax-toast-visible{
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px){
    .tax-page{
        width: 92%;
        padding-top: 12px;
    }
    .tax-guestbar{
        padding: 12px 16px;
    }
    .tax-drop{
        padding: 32px 16px;
    }
    .tax-file-row{
        flex-wrap: wrap;
        padding: 10px 14px;
    }
    .tax-file-info{
        flex-basis: calc(100% - 34px);
    }
    .tax-file-size{
        width: auto;
        text-align: left;
        margin-left: 34px;
    }
    .tax-file-actions{
        margin-left: auto;
    }
    .tax-overlay{
        padding: 12px 8px;
    }
    .tax-popup-head,
    .tax-popup-sec,
    .tax-popup-foot{
        padding-left: 14px;
        padding-right: 14px;
    }
    .tax-guest-main .tax-page{
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ---------- Hidden-attribute fix ----------
   .tax-btn sets display, which beat the [hidden] attribute ("Start new batch" showed on the upload screen). */
.tax-btn[hidden],
.tax-subtitle[hidden]{
    display: none;
}

/* "Select all" text only appears in the mobile card list; the desktop header keeps just the checkbox. */
.tax-select-all{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.tax-select-all-text{
    display: none;
}

/* ---------- Module 1: pitch, progress line, upload buttons, invoice count ---------- */
.tax-subtitle{
    font-size: 15.5px;
}

/* Progress line: the processing stepper laid out horizontally. Done = green tick, current = purple with halo. */
.tax-progress{
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
.tax-progress::before,
.tax-progress::after{
    content: "";
    position: absolute;
    top: 15px;
    left: 16.66%;
    right: 16.66%;
    height: 2px;
    background: #e4e1ea;
}
.tax-progress::after{
    right: auto;
    width: 0;
    background: #3aa66a;
}
.tax-progress[data-at="2"]::after{
    width: 33.33%;
}
.tax-progress[data-at="3"]::after{
    width: 66.66%;
}
.tax-progress-step{
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 0 4px;
    text-align: center;
}
.tax-progress-dot{
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fbf8fd;
    background: #efeff3;
    color: #8a8b93;
    font-size: 13px;
    font-weight: 700;
}
.tax-progress-label{
    font-size: 13.5px;
    line-height: 1.25;
    color: #8a8b93;
}
.tax-progress-done .tax-progress-dot{
    background: #3aa66a;
    color: var(--white);
}
.tax-progress-done .tax-progress-label{
    color: var(--black);
}
.tax-progress-now .tax-progress-dot{
    background: var(--primarycolor);
    color: var(--white);
    box-shadow: 0 0 0 5px #e6daf1;
}
.tax-progress-now .tax-progress-label{
    color: var(--primarycolor);
}
@media (prefers-reduced-motion: no-preference){
    .tax-progress::after{
        transition: width .3s ease;
    }
}

/* Upload box: one Upload button, a camera button beside it on touch screens, drag-and-drop on desktop */
.tax-upload-row{
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    justify-content: center;
}
.tax-upload-btn{
    flex: 1 1 auto;
    min-height: 52px;
    font-size: 16px;
    border-radius: 12px;
}
.tax-upload-btn svg,
.tax-camera-btn svg{
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}
.tax-camera-btn{
    display: none;
    flex: none;
    width: 52px;
    min-height: 52px;
    padding: 0;
    border-radius: 12px;
}
.tax-drop-drag{
    margin: 0;
    font-size: 13px;
    color: #6b6c72;
}
.tax-drop-free{
    color: #15803d;
}
@media (hover: none) and (pointer: coarse){
    .tax-camera-btn{
        display: inline-flex;
    }
    .tax-drop-drag{
        display: none;
    }
}

/* Invoice count badge */
.tax-proof{
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 16px;
    border-radius: 999px;
    background: #e8f6ee;
    color: #14532d;
    font-size: 14.5px;
}
.tax-proof[hidden]{
    display: none;
}
.tax-proof strong{
    font-size: 16px;
}
.tax-proof svg{
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #15803d;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Phones and small tablets ---------- */
@media (max-width: 768px){
    /* The wide results layout's 56px side padding was never undone on small screens. */
    .tax-guest-main .tax-page.tax-page-wide{
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Smaller title once past the upload screen */
    .tax-page[data-screen="processing"] .tax-title,
    .tax-page[data-screen="review"] .tax-title{
        font-size: 20px;
    }
    .tax-pagehead{
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
    }
    .tax-pagehead .tax-btn{
        min-height: 36px;
        padding: 0 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* Results actions: Verify full width, Download and Export side by side */
    .tax-review-title{
        font-size: 16px;
    }
    .tax-review-head .tax-btn-row{
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    .tax-review-head .tax-btn-row .tax-btn{
        padding: 0 10px;
        font-size: 13.5px;
    }
    #tax_verify_button,
    #tax_download_all_button,
    #tax_selection_note{
        grid-column: 1 / -1;
    }

    /* Count tabs: four equal chips in one row */
    .tax-tabs{
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }
    .tax-tab{
        min-width: 0;
        padding: 8px;
        justify-content: space-between;
        border-radius: 10px;
    }
    .tax-tab-label{
        font-size: 11.5px;
        line-height: 1.25;
    }
    .tax-tab-num{
        font-size: 18px;
    }
    .tax-tab-of{
        font-size: 12px;
    }

    /* Results table becomes a list of invoice cards */
    .tax-table-wrap{
        overflow: visible;
        background: transparent;
        border: none;
        border-radius: 0;
    }
    #tax_review_table,
    #tax_review_table thead,
    #tax_review_table tbody{
        display: block;
        min-width: 0;
        width: 100%;
    }
    #tax_review_table tbody{
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    #tax_review_table thead tr{
        display: flex;
        padding: 0 0 10px;
    }
    #tax_review_table thead th{
        display: none;
    }
    #tax_review_table thead th.tax-col-select{
        display: block;
        position: static;
        width: auto;
        max-width: none;
        padding: 0;
        background: transparent;
        color: var(--black);
        font-size: 14px;
    }
    .tax-select-all-text{
        display: inline;
    }
    #tax_review_table .tax-check{
        width: 20px;
        height: 20px;
    }
    #tax_review_table tbody tr{
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 4px 12px;
        padding: 12px 12px 12px 44px;
        background: var(--white);
        border: 1px solid #e7e7ef;
        border-radius: 12px;
    }
    #tax_review_table tbody td,
    #tax_review_table tbody th{
        position: static;
        display: block;
        min-width: 0;
        max-width: none;
        width: auto;
        padding: 0;
        border: none;
        background: transparent;
        box-shadow: none;
        text-align: left;
    }
    .tax-row-clickable:hover > td,
    .tax-row-clickable:hover > th{
        background: transparent;
    }
    #tax_review_table tbody tr.tax-row-clickable:hover{
        background: #f8f6fc;
    }
    #tax_review_table tbody .tax-col-select{
        position: absolute;
        left: 12px;
        top: 13px;
    }
    #tax_review_table tbody .tax-col-open{
        position: absolute;
        right: 6px;
        top: 6px;
        display: flex;
        gap: 2px;
    }
    #tax_review_table tbody .tax-col-vendor{
        order: 1;
        flex: 1 1 100%;
        padding-right: 76px;
    }
    .tax-vendor-name{
        font-size: 14.5px;
        line-height: 1.3;
    }
    .tax-vendor-file{
        max-width: 100%;
    }
    #tax_review_table .tax-c-doc,
    #tax_review_table .tax-c-cu{
        order: 2;
        font-size: 12px;
        color: #6b6c72;
        white-space: normal;
        word-break: break-all;
    }
    #tax_review_table .tax-c-doc::before{
        content: "Doc ";
    }
    #tax_review_table .tax-c-cu.tax-mono::before{
        content: "CU ";
        font-family: "Open Sans", sans-serif;
    }
    #tax_review_table .tax-c-cu.tax-cell-muted::before{
        content: "CU number: ";
    }
    #tax_review_table .tax-c-vat{
        display: none;
    }
    #tax_review_table .tax-c-total,
    #tax_review_table .tax-c-wht{
        order: 3;
        flex: 0 0 auto;
        min-width: 40%;
        margin-top: 6px;
        font-size: 14px;
        font-weight: 600;
        color: var(--black);
    }
    #tax_review_table .tax-c-total::before,
    #tax_review_table .tax-c-wht::before{
        display: block;
        font-size: 12px;
        font-weight: 400;
        color: #6b6c72;
    }
    #tax_review_table .tax-c-total::before{
        content: "Total";
    }
    #tax_review_table .tax-c-wht::before{
        content: "WHT";
    }
    #tax_review_table .tax-c-kra,
    #tax_review_table .tax-c-review,
    #tax_review_table .tax-c-conf{
        order: 4;
        margin-top: 6px;
    }
    #tax_review_table .tax-c-conf{
        order: 5;
    }
    /* Confidence only shows when it is Low, as a "Low conf." badge */
    #tax_review_table .tax-c-conf{
        display: none;
    }
    #tax_review_table .tax-c-conf:has(.tax-conf-low){
        display: block;
    }
    #tax_review_table .tax-c-conf .tax-conf{
        display: none;
    }
    #tax_review_table .tax-c-conf .tax-badge::after{
        content: " conf.";
    }
    /* Unreadable and empty rows: one full-width cell */
    #tax_review_table tbody td[colspan]{
        flex: 1 1 100%;
    }
    #tax_review_table tbody tr:not(.tax-row-clickable):not(.tax-row-failed){
        padding-left: 12px;
    }

    /* Invoice popup: full screen, Done always at the bottom */
    #tax_invoice_popup{
        padding: 0;
        background: var(--white);
    }
    .tax-dialog-lg{
        max-width: none;
        min-height: 100%;
        border-radius: 0;
        box-shadow: none;
    }
    .tax-popup-head{
        flex-wrap: nowrap;
        align-items: center;
        padding: 10px 12px;
        gap: 8px;
    }
    .tax-popup-head .tax-dialog-title{
        font-size: 16px;
    }
    .tax-popup-meta{
        font-size: 12px;
        margin-top: 2px;
    }
    .tax-popup-nav{
        flex-shrink: 0;
        gap: 4px;
        font-size: 12px;
    }
    .tax-popup-nav .tax-btn-sm{
        padding: 0 8px;
    }
    .tax-popup-foot{
        position: sticky;
        bottom: 0;
        z-index: 3;
        margin-top: auto;
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        background: var(--white);
        border-top: 1px solid #efeff4;
    }
    .tax-popup-foot .tax-btn-row{
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    .tax-popup-foot .tax-btn{
        min-height: 42px;
        padding: 0 8px;
        font-size: 13px;
        line-height: 1.2;
    }
    #tax_popup_done{
        grid-column: 1 / -1;
    }

    /* Line items become spaced-out cards */
    .tax-lines-table,
    .tax-lines-table thead,
    .tax-lines-table tbody{
        display: block;
        min-width: 0;
        width: 100%;
    }
    .tax-lines-table thead{
        display: none;
    }
    .tax-lines-table tbody{
        display: flex;
        flex-direction: column;
        gap: 14px;
    }
    .tax-lines-table tbody tr{
        display: flex;
        flex-wrap: wrap;
        gap: 8px 12px;
        padding: 12px;
        background: var(--white);
        border: 1px solid #e7e7ef;
        border-radius: 12px;
    }
    .tax-lines-table tbody tr.tax-line-pending{
        background: #fffbeb;
        border-color: #f1d39f;
    }
    /* A "More" or re-check note row joins the card above it */
    .tax-lines-table tbody tr:has(+ tr.tax-line-sub){
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-bottom: none;
    }
    .tax-lines-table tbody tr.tax-line-sub{
        margin-top: -14px;
        padding-top: 0;
        border-top: none;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }
    .tax-lines-table tbody td{
        display: block;
        min-width: 0;
        padding: 0;
        border: none;
        background: transparent;
        box-shadow: none !important;
        text-align: left;
        font-size: 13px;
    }
    .tax-lines-table .tax-l-no{
        flex: 0 0 auto;
        font-weight: 600;
    }
    .tax-lines-table .tax-l-no::after{
        content: ".";
    }
    /* First line: number, description, amount. The wide description basis pushes the rest onto new lines. */
    .tax-lines-table .tax-line-desc{
        flex: 1 1 40%;
        min-width: 0;
        font-weight: 600;
    }
    .tax-lines-table tbody td.tax-num{
        text-align: left;
    }
    .tax-lines-table tbody td.tax-l-gross{
        order: 1;
        text-align: right;
    }
    .tax-lines-table tbody td{
        order: 2;
    }
    .tax-lines-table tbody td.tax-l-no,
    .tax-lines-table tbody td.tax-line-desc{
        order: 0;
    }
    .tax-lines-table .tax-l-gross{
        flex: 0 0 auto;
        font-weight: 700;
    }
    .tax-lines-table .tax-l-qty,
    .tax-lines-table .tax-l-vat,
    .tax-lines-table .tax-l-rate,
    .tax-lines-table .tax-l-wht,
    .tax-lines-table .tax-l-conf{
        flex: 0 0 calc(50% - 6px);
    }
    .tax-lines-table .tax-l-cat,
    .tax-lines-table .tax-l-reason,
    .tax-lines-table .tax-l-decision,
    .tax-lines-table tr.tax-line-sub td{
        flex: 1 1 100%;
    }
    .tax-lines-table .tax-l-qty::before,
    .tax-lines-table .tax-l-vat::before,
    .tax-lines-table .tax-l-cat::before,
    .tax-lines-table .tax-l-rate::before,
    .tax-lines-table .tax-l-wht::before,
    .tax-lines-table .tax-l-conf::before{
        display: block;
        font-size: 11.5px;
        color: #6b6c72;
        font-weight: 400;
    }
    .tax-lines-table .tax-l-qty::before{ content: "Qty"; }
    .tax-lines-table .tax-l-vat::before{ content: "VAT"; }
    .tax-lines-table .tax-l-cat::before{ content: "WHT category"; }
    .tax-lines-table .tax-l-rate::before{ content: "Rate"; }
    .tax-lines-table .tax-l-wht::before{ content: "WHT amount"; }
    .tax-lines-table .tax-l-conf::before{ content: "Confidence"; }
    .tax-lines-table .tax-l-reason{
        color: #6b6c72;
        font-size: 12.5px;
        line-height: 1.45;
    }
    .tax-lines-table .tax-select,
    .tax-lines-table .tax-select-rate{
        width: 100%;
        min-width: 0;
    }
    .tax-lines-table .tax-segment{
        display: flex;
        width: 100%;
    }
    .tax-lines-table .tax-segment-btn{
        flex: 1 1 0;
        min-height: 40px;
    }
}

@media (max-width: 768px){
    .tax-subtitle{
        font-size: 14.5px;
    }
    .tax-progress-label{
        font-size: 12.5px;
    }
    /* Two lines per step on phones: "Upload / Invoices", "Extract + / Assess WHT", "Check KRA + / Results" */
    .tax-progress-label > span{
        display: block;
        white-space: nowrap;
    }
    .tax-drop{
        padding: 22px 16px;
    }
}

/* ---------- Module 2: FAQ, its own section below the upload area ---------- */
.tax-faq{
    display: flex;
    flex-direction: column;
    margin-top: 28px;
    padding-top: 32px;
    border-top: 1px solid #e4e1ea;
}
.tax-faq[hidden]{
    display: none;
}
.tax-faq-title{
    margin: 0 0 14px;
    font-size: 20px;
}
.tax-faq-list{
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid #e7e7ef;
    border-radius: 14px;
    overflow: hidden;
}
.tax-faq details + details{
    border-top: 1px solid #ebe8f0;
}
.tax-faq summary{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    font-size: 14.5px;
    color: var(--black);
    cursor: pointer;
    list-style: none;
}
.tax-faq summary::-webkit-details-marker{
    display: none;
}
.tax-faq summary::after{
    content: "";
    flex: none;
    width: 9px;
    height: 9px;
    margin-top: -4px;
    border-right: 2px solid var(--primarycolor);
    border-bottom: 2px solid var(--primarycolor);
    transform: rotate(45deg);
}
.tax-faq details[open] summary{
    color: var(--primarycolor);
}
.tax-faq details[open] summary::after{
    margin-top: 4px;
    transform: rotate(-135deg);
}
.tax-faq summary:hover{
    background: #fbf8fd;
}
.tax-faq summary:focus-visible{
    outline: 2px solid var(--primarycolor);
    outline-offset: -2px;
}
.tax-faq-answer{
    max-width: 760px;
    padding: 0 24px 22px;
    font-size: 14px;
    line-height: 1.65;
    color: #4a4b52;
}
.tax-faq-answer p{
    margin: 0;
}
.tax-faq-answer p + p{
    margin-top: 8px;
}
@media (max-width: 768px){
    .tax-faq{
        margin-top: 20px;
        padding-top: 24px;
    }
    .tax-faq-title{
        font-size: 18px;
    }
    .tax-faq summary{
        padding: 16px;
        font-size: 13.5px;
    }
    .tax-faq-answer{
        padding: 0 16px 18px;
        font-size: 13px;
    }
}

/* ---------- Module 3: sample invoices ---------- */
.tax-sample-btn{
    align-self: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 12px;
    font-size: 14.5px;
}
.tax-sample-btn svg{
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}
.tax-sample-banner{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #f6f0fb;
    border: 1px solid #e3d3f0;
}
.tax-sample-banner[hidden]{
    display: none;
}
.tax-sample-banner p{
    flex: 1 1 260px;
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #3b2550;
}
.tax-sample-banner strong{
    display: block;
    font-size: 15px;
    color: var(--primarycolor);
}
.tax-sample-banner .tax-btn{
    flex: none;
}
/* More room between the sample button / invoice count and the FAQ */
.tax-faq{
    margin-top: 56px;
    padding-top: 40px;
}
@media (max-width: 768px){
    .tax-faq{
        margin-top: 40px;
        padding-top: 28px;
    }
    .tax-sample-banner{
        padding: 12px 14px;
    }
    .tax-sample-banner p{
        font-size: 13px;
    }
    .tax-sample-banner .tax-btn{
        width: 100%;
    }
}

/* Sample run: strip on upload/processing, and a pulse on Process while it waits for a click */
.tax-sample-strip{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px 16px;
    padding: 10px 16px;
    border-radius: 10px;
    background: #f6f0fb;
    border: 1px solid #e3d3f0;
    font-size: 13.5px;
    color: #3b2550;
}
.tax-sample-strip[hidden]{
    display: none;
}
.tax-sample-strip strong{
    color: var(--primarycolor);
}
@media (prefers-reduced-motion: no-preference){
    .tax-btn-pulse{
        animation: tax-pulse 1s ease-in-out infinite;
    }
    @keyframes tax-pulse{
        0%, 100%{ box-shadow: 0 0 0 0 rgba(112, 48, 160, .45); }
        50%{ box-shadow: 0 0 0 8px rgba(112, 48, 160, 0); }
    }
}
.tax-btn-pulse{
    outline: 2px solid #c9a4ea;
    outline-offset: 2px;
}

/* KRA check, one invoice at a time: spinner on Checking / trying again, a note under the badge, the live count
   on the KRA chip, and a notice above the table while KRA is slow or after a run left invoices unverified. */
.tax-badge-spin::before{
    width: 9px;
    height: 9px;
    background: transparent;
    border: 2px solid currentColor;
    border-right-color: transparent;
    box-sizing: border-box;
    animation: tax-kra-spin .8s linear infinite;
}
@keyframes tax-kra-spin{
    to{ transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce){
    .tax-badge-spin::before{ animation: none; }
}
.tax-c-kra .tax-kra-note{
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    color: #6b6c72;
    white-space: nowrap;
}
.tax-kra-note .tax-linkbtn{
    font-size: 12px;
    padding: 0;
}
.tax-tab-live{
    font-size: 12px;
    color: var(--primarycolor);
}
.tax-kra-notice{
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #374151;
    font-size: 13.5px;
    line-height: 1.45;
}
.tax-kra-notice[hidden]{
    display: none;
}
.tax-kra-notice svg{
    width: 18px;
    height: 18px;
    flex: none;
    margin-top: 1px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tax-kra-notice-slow{
    background: #f6f0fb;
    color: #3b2550;
}
.tax-kra-notice-slow svg{
    stroke: var(--primarycolor);
}

/* Download / email: hint when nothing is ticked, and the "Email me the files" dialog */
.tax-select-hint{
    margin: -4px 0 0;
    font-size: 13px;
    color: #6b6c72;
}
.tax-select-hint[hidden]{
    display: none;
}
.tax-email-form,
.tax-email-sent{
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tax-email-form[hidden],
.tax-email-sent[hidden]{
    display: none;
}
.tax-email-field{
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tax-email-label{
    font-size: 13px;
    color: var(--black);
}
.tax-email-input{
    min-height: 42px;
    font-size: 15px;
    padding: 0 12px;
}
.tax-email-input[aria-invalid="true"]{
    border-color: #b91c1c;
}
.tax-email-error{
    margin: 0;
    font-size: 13px;
    color: #b91c1c;
}
.tax-email-error[hidden]{
    display: none;
}
.tax-email-consent{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--black);
    cursor: pointer;
}
.tax-email-consent .tax-check{
    margin-top: 2px;
    flex: none;
}
.tax-email-fine{
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: #6b6c72;
}
.tax-email-fine a{
    color: var(--primarycolor);
}
.tax-email-done{
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #dcfce7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tax-email-done svg{
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #15803d;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tax-email-sent .tax-dialog-title{
    overflow-wrap: anywhere;
}
.tax-email-sent .tax-dialog-title:focus{
    outline: none;
}
@media (max-width: 768px){
    .tax-email-form .tax-btn-row,
    .tax-email-sent .tax-btn-row{
        flex-direction: column-reverse;
    }
    .tax-email-form .tax-btn,
    .tax-email-sent .tax-btn{
        width: 100%;
    }
}

/* "Are you stuck or have a suggestion?" + "Click here to email me" under the results table */
.tax-contact{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    text-align: center;
}
.tax-contact-q{
    margin: 0;
    font-size: 15px;
    color: var(--black);
}
.tax-contact-anchor{
    position: relative;
}
.tax-contact-btn{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 24px;
    border: 1px solid #dedae5;
    border-radius: 999px;
    background: #efedf2;
    color: var(--primarycolor);
    font-size: 15px;
    cursor: pointer;
}
.tax-contact-btn:hover,
.tax-contact-btn[aria-expanded="true"]{
    background: #e5e2ea;
}
.tax-contact-btn:focus-visible{
    outline: 2px solid var(--primarycolor);
    outline-offset: 2px;
}
.tax-contact-btn svg,
.tax-contact-ic svg{
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tax-contact-menu{
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    min-width: 270px;
    display: flex;
    flex-direction: column;
    padding: 6px;
    background: var(--white);
    border: 1px solid #ebe8f0;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(30, 20, 50, 0.18);
    text-align: left;
}
.tax-contact-menu[hidden],
.tax-contact-shade[hidden]{
    display: none;
}
.tax-contact-menu-h{
    margin: 0;
    padding: 8px 12px 4px;
    font-size: 12px;
    color: #6b6c72;
}
.tax-contact-addr{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 2px 6px 6px;
    padding: 8px 8px 8px 12px;
    border: 1px solid #e4dfea;
    border-radius: 9px;
    background: #faf8fc;
}
.tax-contact-addr-text{
    font-size: 14.5px;
    color: var(--black);
    user-select: all;
    overflow-wrap: anywhere;
}
.tax-contact-copy{
    flex: none;
    padding: 6px 14px;
    border: 1px solid var(--primarycolor);
    border-radius: 7px;
    background: var(--white);
    color: var(--primarycolor);
    font-size: 13px;
    cursor: pointer;
}
.tax-contact-copy:hover,
.tax-contact-copy:focus-visible{
    background: var(--action_button_white);
    outline: none;
}
.tax-contact-copy.is-done{
    border-color: #1e7a45;
    background: #e8f5ec;
    color: #1e7a45;
}
.tax-contact-or{
    border-top: 1px solid #efedf2;
    margin-top: 2px;
    padding-top: 10px;
}
.tax-contact-item{
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--black);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}
.tax-contact-item:hover,
.tax-contact-item:focus-visible{
    background: #f6f0fb;
    outline: none;
}
.tax-contact-item small{
    display: block;
    font-size: 12px;
    color: #6b6c72;
}
.tax-contact-ic{
    width: 28px;
    height: 28px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #efedf2;
    color: #555;
    font-weight: 700;
    font-size: 13px;
}
.tax-contact-ic svg{
    width: 16px;
    height: 16px;
}
.tax-contact-ic-g{
    background: #fdecea;
    color: #c5221f;
}
.tax-contact-ic-o{
    background: #e6f0fb;
    color: #0f62b8;
}
.tax-contact-grab,
.tax-contact-cancel,
.tax-contact-shade{
    display: none;
}
/* Phone: the choice slides up as a bottom sheet */
@media (max-width: 768px){
    .tax-contact-anchor,
    .tax-contact-btn{
        width: 100%;
        justify-content: center;
    }
    .tax-contact-shade{
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1030;
        background: rgba(38, 38, 39, 0.45);
    }
    .tax-contact-menu{
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        z-index: 1031;
        min-width: 0;
        padding: 10px 10px calc(18px + env(safe-area-inset-bottom, 0px));
        border-radius: 18px 18px 0 0;
    }
    .tax-contact-grab{
        display: block;
        width: 40px;
        height: 4px;
        margin: 2px auto 8px;
        border-radius: 2px;
        background: #d6d2dc;
    }
    /* Phones get the address and Copy only: the app links don't fill the address in reliably there. */
    .tax-contact-item,
    .tax-contact-or{
        display: none;
    }
    .tax-contact-addr{
        margin: 4px 2px 4px;
        padding: 12px 10px 12px 14px;
    }
    .tax-contact-addr-text{
        font-size: 15.5px;
    }
    .tax-contact-copy{
        padding: 9px 18px;
        font-size: 14px;
    }
    .tax-contact-cancel{
        display: block;
        margin-top: 6px;
        padding: 12px;
        border: 1px solid #ebe8f0;
        border-radius: 10px;
        background: var(--white);
        color: var(--primarycolor);
        font-size: 14px;
        cursor: pointer;
    }
}

/* KRA comparison table in the invoice popup: as wide as its values, both value columns the same width */
.tax-kra-compare-body{
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}
.tax-cmp-wrap{
    max-width: 100%;
    overflow-x: auto;
}
.tax-cmp{
    width: auto;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #ebe8f0;
    border-radius: 10px;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.3;
}
.tax-cmp th,
.tax-cmp td{
    padding: 5px 12px;
    text-align: left;
    vertical-align: middle;
}
.tax-cmp thead th{
    background: #f8f7fa;
    color: #6b6c72;
    font-size: 12px;
    white-space: nowrap;
}
.tax-cmp tbody th,
.tax-cmp tbody td{
    border-top: 1px solid #ebe8f0;
}
.tax-cmp-f{
    color: #6b6c72;
    font-weight: 400;
    white-space: nowrap;
}
.tax-cmp-v{
    max-width: 300px;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}
.tax-cmp-v .tax-copy{
    vertical-align: middle;
}
.tax-cmp-bad th,
.tax-cmp-bad td{
    background: #fffafa;
}
.tax-cmp-bad .tax-cmp-kra{
    color: #b91c1c;
    font-weight: 600;
}
.tax-cmp-res{
    padding-left: 4px;
    white-space: nowrap;
}
.tax-mark{
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}
.tax-mark i{
    width: 16px;
    height: 16px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-style: normal;
    font-size: 11px;
}
.tax-mark-ok{ color: #047857; }
.tax-mark-ok i{ background: #ecfdf5; }
.tax-mark-close{ color: #92400e; }
.tax-mark-close i{ background: #fffbeb; }
.tax-mark-bad{ color: #b91c1c; }
.tax-mark-bad i{ background: #fef2f2; }
.tax-mark-none{ color: #4b5563; font-weight: 500; }
.tax-mark-none i{ background: #f3f4f6; }
.tax-cmp-res .tax-linkbtn{
    font-size: 12.5px;
}
.tax-kra-compare-foot{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    font-size: 12.5px;
}
.tax-kra-compare-foot a{
    color: var(--primarycolor);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.tax-kra-copied{
    background: #ecfdf5;
    color: #047857;
    border-radius: 8px;
    padding: 4px 10px;
}
.tax-kra-cu-only{
    margin-top: 8px;
    max-width: 420px;
}

/* Phone: one block per detail; a row that agrees shows a single value labelled "Both" */
@media (max-width: 768px){
    .tax-cmp-wrap{
        overflow: visible;
    }
    .tax-cmp,
    .tax-cmp tbody{
        display: block;
        width: 100%;
    }
    .tax-cmp colgroup,
    .tax-cmp thead{
        display: none;
    }
    .tax-cmp tbody tr{
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 1px 10px;
        padding: 7px 12px;
        border-top: 1px solid #ebe8f0;
    }
    .tax-cmp tbody tr:first-child{
        border-top: 0;
    }
    .tax-cmp-bad{
        background: #fffafa;
    }
    .tax-cmp tbody th,
    .tax-cmp tbody td{
        border-top: 0;
        padding: 0;
        background: none;
    }
    .tax-cmp-f{
        color: var(--black);
        font-weight: 600;
    }
    .tax-cmp-res{
        grid-row: 1;
        grid-column: 2;
        justify-self: end;
    }
    .tax-cmp-v{
        grid-column: 1 / -1;
        max-width: none;
        display: grid;
        grid-template-columns: 52px 1fr;
        gap: 8px;
        align-items: baseline;
    }
    .tax-cmp-v::before{
        content: attr(data-label);
        color: #6b6c72;
        font-size: 12px;
    }
    .tax-cmp-same .tax-cmp-kra{
        display: none;
    }
}

/* Quick check-in survey: centred popup on computers, bottom sheet on phones. */
.tax-survey-card{
    max-width: 460px;
    padding: 18px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    outline: none;
}
.tax-survey-grab{ display: none; }
.tax-survey-top{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.tax-survey-title{
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primarycolor);
}
.tax-survey-right{
    display: flex;
    align-items: center;
    gap: 12px;
}
.tax-survey-dots{
    display: flex;
    gap: 5px;
}
.tax-survey-dots i{
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d9d6e0;
}
.tax-survey-dots i.on{ background: var(--primarycolor); }
.tax-survey-x{
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--textcolor);
    font-size: 15px;
    cursor: pointer;
}
.tax-survey-x:hover{ background: #f1eef5; }
.tax-survey-q{
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    color: var(--black);
}
.tax-survey-sub{
    margin: 2px 0 0;
    font-size: 13.5px;
    color: var(--textcolor);
}
.tax-survey-chips{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tax-survey-chip{
    border: 1px solid #d6d2de;
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--white);
    color: var(--black);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}
.tax-survey-chip:hover,
.tax-survey-chip:focus-visible{
    border-color: var(--primarycolor);
    color: var(--primarycolor);
}
.tax-survey-chip.is-on{
    border-color: var(--primarycolor);
    background: var(--action_button_white);
    color: var(--primarycolor);
    font-weight: 600;
}
.tax-survey-card .tax-input{
    width: 100%;
    box-sizing: border-box;
}
.tax-survey-text{
    min-height: 90px;
    resize: vertical;
    font: inherit;
}
.tax-survey-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.tax-survey-row-end{ justify-content: flex-end; }
.tax-survey-fine{
    margin: -4px 0 0;
    font-size: 12px;
    color: var(--textcolor);
}
.tax-survey-fine a{ color: var(--textcolor); }
.tax-survey-done{
    display: flex;
    align-items: center;
    gap: 14px;
}
.tax-survey-done > span{
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--action_button_white);
    color: var(--primarycolor);
    font-weight: 700;
}
@media (max-width: 768px){
    .tax-overlay.tax-survey{
        align-items: flex-end;
        padding: 0;
    }
    .tax-survey-card{
        max-width: none;
        border-radius: 20px 20px 0 0;
        padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    }
    .tax-survey-grab{
        display: block;
        width: 38px;
        height: 4px;
        border-radius: 2px;
        background: #d9d6e0;
        margin: 0 auto -2px;
    }
    .tax-survey-q{ font-size: 16px; }
    .tax-survey-stack{ flex-direction: column; }
    .tax-survey-stack .tax-survey-chip{
        border-radius: 10px;
        padding: 11px 14px;
    }
}

/* ---------- "How it works" text above the FAQ (2026-12-03, gives Google words to read) ---------- */
.tax-howto{
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid #e4e1ea;
}
.tax-howto[hidden]{
    display: none;
}
.tax-howto-list{
    list-style: none;
    counter-reset: taxhowto;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.tax-howto-list li{
    counter-increment: taxhowto;
    background: var(--white);
    border: 1px solid #e7e7ef;
    border-radius: 14px;
    padding: 20px 22px;
}
.tax-howto-list li::before{
    content: counter(taxhowto);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #EEE6F4;
    color: var(--primarycolor);
    font-weight: 700;
    font-size: 13px;
}
.tax-howto-list h3{
    margin: 12px 0 6px;
    font-size: 15px;
    color: var(--black);
}
.tax-howto-list p{
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #4a4b52;
}
/* The FAQ now follows the How it works block, so it needs less of a gap and no second rule line. */
.tax-howto + .tax-faq{
    margin-top: 40px;
    padding-top: 0;
    border-top: 0;
}
@media (max-width: 768px){
    .tax-howto{
        margin-top: 40px;
        padding-top: 28px;
    }
    .tax-howto-list{
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }
    .tax-howto-list li{
        padding: 16px;
    }
    .tax-howto-list p{
        font-size: 13px;
    }
    .tax-howto + .tax-faq{
        margin-top: 28px;
    }
}

/* Link from the FAQ to the blog guide (2026-12-03) */
.tax-faq-more{
    margin: 14px 0 0;
    font-size: 14px;
    color: #4a4b52;
}
.tax-faq-more a{
    color: var(--primarycolor);
    font-weight: 600;
}
