:root { color-scheme: light; }
html { overflow-x: clip; }
body { min-width: 0; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:is(a, button, input, select, textarea):focus-visible { outline: 2px solid #356cc7; outline-offset: 3px; }
.sidebar-toggle { display: none; }
.project-tile { display: block; }
.breadcrumbs, .page-heading, .section-title, .member-row, .auth-card, .message { min-width: 0; }
.breadcrumbs, .member-row, .message { overflow-wrap: anywhere; }
.auth-card input, .auth-card select { min-width: 0; }
.auth-card input:focus, .auth-card select:focus { border-color: #6b95e1; box-shadow: 0 0 0 3px #e9f0ff; outline: 0; }
.avatar-choices { padding: 14px; }
.member-entry { border-top: 1px solid #e8edf3; padding: 16px 0; }
.member-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.member-controls input { width: min(250px, 100%); padding: 9px; border: 1px solid #dfe6ef; border-radius: 8px; }
.permission-form details { background: #f8fafd; border: 1px solid #e7ecf3; border-radius: 10px; padding: 12px; }
.permission-form summary { cursor: pointer; color: #426fae; font-weight: 700; }
.permission-form p { color: #7c8b9d; font-size: 12px; line-height: 1.9; }
.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.permission-grid label { color: #566780; font-size: 12px; }
.permission-grid select { display: block; width: 100%; padding: 9px; margin-top: 6px; border: 1px solid #dfe6ef; border-radius: 8px; background: #fff; }
.project-people { padding: 16px 20px; margin-bottom: 24px; border: 1px solid #e8edf3; border-radius: 13px; background: #fff; }
.project-people summary { cursor: pointer; font-weight: 700; color: #426fae; }
.project-people p { color: #7c8b9d; font-size: 12px; }
.project-people .member-controls { justify-content: space-between; border-top: 1px solid #eef1f5; padding-top: 10px; }

@media (max-width: 700px) {
    .sidebar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; width: 100%; padding: 11px 16px; box-shadow: 0 4px 20px #253f6510; }
    .sidebar .brand { min-width: 0; }
    .sidebar-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 12px; border: 1px solid #dce6f4; border-radius: 10px; background: #f5f8ff; color: #315f9f; font-size: 12px; font-weight: 700; }
    .sidebar-toggle span:first-child { font-size: 18px; line-height: 1; }
    .sidebar nav, .sidebar .sidebar-bottom { display: none; grid-column: 1 / -1; }
    .sidebar.is-open nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding-top: 14px; }
    .sidebar.is-open .sidebar-bottom { display: block; margin-top: 12px; padding: 12px 2px 2px; }
    .sidebar.is-open .sidebar-bottom small { margin-inline-start: 0; }
    .sidebar.is-open .sidebar-bottom .button { min-height: 40px; margin-top: 8px; }
    .sidebar .nav-item { min-width: 0; min-height: 44px; margin: 0; padding: 9px 11px; font-size: 12px; }
    .sidebar .nav-item span { display: inline; flex: none; }
    .topbar { min-height: 48px; height: auto; padding-block: 11px; }
    .breadcrumbs { line-height: 1.8; }
    .page-heading { flex-wrap: wrap; gap: 16px; }
    .page-heading > .button, .board-actions { width: 100%; }
    .board-actions .button { flex: 1 1 auto; }
    .page-wrap { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .project-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-bottom: 26px; padding: 8px 0; }
    .project-strip > div { min-width: 0; padding: 12px 16px; border: 0; }
    .project-strip > div:nth-child(odd) { border-left: 1px solid #edf0f5; }
    .project-strip > div:nth-child(-n+2) { border-bottom: 1px solid #edf0f5; }
    .summary-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .summary-card { min-width: 0; }
    .auth-layout { margin: 16px auto; padding: 16px; }
    .auth-card { width: 100%; margin: 12px 0; padding: 20px; }
    .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .member-row { align-items: flex-start; }
    .member-row > span { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; width: 100%; line-height: 1.9; }
    .member-row form { width: 100%; }
    .member-row form .button { min-height: 40px; }
    .member-row input[name="review_note"] { flex: 1 1 150px; max-width: 100%; }
    .modal { max-height: calc(100dvh - 24px); overflow-y: auto; }
    .modal-body { padding: 20px; }
    .toast { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); text-align: center; }
}

@media (max-width: 420px) {
    .permission-grid { grid-template-columns: 1fr; }
    .summary-row { grid-template-columns: 1fr; gap: 8px; margin-bottom: 26px; }
    .summary-card { height: auto; min-height: 64px; padding: 10px 14px; }
    .summary-icon { display: grid; width: 38px; height: 38px; }
    .summary-card small { font-size: 11px; }
    .summary-card strong { font-size: 19px; }
    .section-title { gap: 8px; }
    .count-pill { flex: none; }
    .project-actions { flex-wrap: wrap; }
    .project-actions .button { flex: 1; }
    .avatar-image { width: 64px; height: 64px; }
    .member-avatar { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .button, .project-tile, .toast { transition: none; }
}
/* Compact profile choices and a single account link in the sidebar. */
.avatar-choices .avatar-image { width: 52px; height: 52px; }
.sidebar-profile { display: flex; align-items: center; gap: 10px; border-radius: 9px; padding: 6px; margin: -6px; }
.sidebar-profile:hover, .sidebar-profile.active { background: #edf3ff; }
.sidebar-profile:focus-visible { outline: 2px solid #4f80df; outline-offset: 3px; }
.sidebar-profile-info { min-width: 0; }
.sidebar-profile-info strong { display: block; overflow-wrap: anywhere; }
.sidebar-bottom .sidebar-profile small { margin: 3px 0 0; }
.auth-card .invitation-consent { display: flex; align-items: center; gap: 9px; line-height: 1.8; }
.auth-card .invitation-consent input { width: 17px; height: 17px; flex: none; margin: 0; }

/* Account menu and account pages */
.sidebar-bottom { position: relative; }
.account-menu summary { cursor: pointer; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.sidebar-profile-info { flex: 1; }
.account-chevron { color: #8b9aab; font-size: 16px; }
.account-dropdown { position: absolute; bottom: calc(100% + 10px); right: 0; left: 0; z-index: 20; padding: 6px; background: #fff; border: 1px solid #e5ebf3; border-radius: 12px; box-shadow: 0 12px 35px #23395c24; }
.account-dropdown a, .account-dropdown button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 7px; background: transparent; color: #52657d; text-align: right; font-size: 12px; }
.account-dropdown a:hover, .account-dropdown button:hover, .account-dropdown a:focus-visible, .account-dropdown button:focus-visible { background: #edf3ff; color: #376ac2; }
.account-dropdown form { border-top: 1px solid #edf1f5; margin-top: 4px; padding-top: 4px; }
.account-dropdown button { color: #bc5360; }
.account-page { max-width: 1200px; }
.account-notice { margin: 0 0 20px; padding: 15px 18px; border: 1px solid #e3ebf8; border-radius: 11px; color: #60748e; background: #f1f6ff; line-height: 2; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.account-card { background: #fff; border: 1px solid #e8edf3; border-radius: 14px; padding: 22px; margin-bottom: 16px; }
.account-grid .account-card { margin: 0; }
.account-card-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: #edf3ff; color: #5282d8; font-size: 21px; }
.account-card h2 { font-size: 15px; margin: 15px 0 8px; }
.account-card p { color: #8291a4; font-size: 12px; line-height: 2; }
.account-status { display: inline-block; color: #75859a; background: #f1f4f8; border-radius: 6px; padding: 4px 9px; font-size: 11px; }
@media (max-width: 700px) {
    .account-grid { grid-template-columns: 1fr; }
    .sidebar.is-open .account-dropdown { position: static; margin-top: 12px; box-shadow: none; }
    .sidebar.is-open .account-dropdown button { margin-top: 0; }
}
.modal textarea { display: block; width: 100%; min-height: 95px; resize: vertical; border: 1px solid #dfe6ef; border-radius: 8px; background: #fff; color: #25334a; padding: 8px 11px; margin-top: 8px; font: inherit; line-height: 1.8; }
.modal textarea:focus { outline: 0; border-color: #6b95e1; box-shadow: 0 0 0 3px #e9f0ff; }
.project-description { padding: 18px 22px; margin-bottom: 18px; border: 1px solid #e8edf3; border-radius: 13px; background: #fff; color: #63748a; font-size: 12px; overflow-wrap: anywhere; }
.project-description p { margin: 8px 0 0; line-height: 2; }
.task input:checked:after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; }
.icon-button .fa-solid, .item-action .fa-solid, .add-task-form button .fa-solid, .reopen-button .fa-solid { font-size: 13px; }
.task-group { border-top: 1px solid #f0f2f5; padding-top: 8px; }
.task-group-title { display: flex; justify-content: space-between; padding: 0 17px 8px; color: #8191a4; font-size: 11px; }
.task-group-title span { color: #9ba9b9; }
.task-check { flex: none; width: 16px; height: 16px; padding: 0; display: grid; place-items: center; border: 1.5px solid #b7c5d6; border-radius: 4px; background: #fff; color: #fff; font-size: 9px; }
.task-check.state-doing { background: #e9a746; border-color: #e9a746; }
.task-check.state-done { background: #5d91dc; border-color: #5d91dc; }
.task-title { flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; color: #223047; text-align: right; font: inherit; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
button.task-title:hover { color: inherit; }
.task-title-editor { flex: 1; min-width: 0; width: 100%; padding: 4px; border: 1px solid #6b95e1; border-radius: 5px; font: inherit; }
.done-task .task-title { text-decoration: line-through; }
.task input.task-title-editor { appearance: auto; flex: 1; min-width: 0; width: auto; height: auto; margin: 0; padding: 4px; border: 1px solid #6b95e1; border-radius: 5px; font: inherit; cursor: text; }

.task input.task-title-editor { background: transparent; border: 0; border-bottom: 1px solid #b7c5d6; border-radius: 0; padding: 0; outline: 0; color: #223047; font-size: 11px; line-height: 1.8; box-shadow: none; }
.task-back { flex: none; border: 0; padding: 3px 5px; background: #edf1f6; border-radius: 5px; color: #697b91; font-size: 9px; white-space: nowrap; }
.task-back:hover, .task-back:focus-visible { background: #e3eaf3; color: #425b77; }
.add-task-form input:focus-visible { outline: none; box-shadow: none; }
.work-card { overflow: visible; }
.task-move { position: relative; flex: none; }
.task-move summary { list-style: none; cursor: pointer; padding: 4px; color: #8d9bad; font-size: 11px; }
.task-move summary::-webkit-details-marker { display: none; }
.task-move summary:hover, .task-move summary:focus-visible { color: #487cda; }
.task-move-menu { position: absolute; z-index: 5; left: 0; top: calc(100% + 5px); width: 190px; max-height: 220px; overflow-y: auto; padding: 6px; border: 1px solid #e5ebf3; border-radius: 9px; background: #fff; box-shadow: 0 10px 28px #23395c24; }
.task-move-menu strong { display: block; padding: 5px 8px; color: #94a2b3; font-size: 10px; }
.task-move-menu button { display: block; width: 100%; border: 0; border-radius: 5px; padding: 7px 8px; background: transparent; color: #52657d; text-align: right; font-size: 11px; overflow-wrap: anywhere; }
.task-move-menu button:hover, .task-move-menu button:focus-visible { background: #edf3ff; }

/* Keep text selection from competing with task dragging. */
.task-grip[draggable="true"] { user-select: none; -webkit-user-select: none; cursor: grab; }
.task-grip[draggable="true"]:active { cursor: grabbing; }
.task-grip[draggable="false"] { cursor: default; }

.permission-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 16px 0; }
.permission-checks label { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid #e5ebf3; border-radius: 8px; font-size: 13px; color: #35445a; }
.permission-checks input { width: auto; margin: 0; accent-color: #426fae; }
.project-person { padding: 12px 0; border-top: 1px solid #eef1f5; }
.project-person summary { color: #35445a; font-size: 13px; }
.project-people > label { display: block; margin: 12px 0; font-size: 13px; }
.project-people > label input { display: block; width: 100%; max-width: 360px; margin-top: 8px; padding: 10px; border: 1px solid #dfe6ef; border-radius: 8px; }
.project-permission-form { padding: 8px 0; }
.permission-group { border: 0; padding: 0; margin: 18px 0; min-width: 0; }
.permission-group legend { font-weight: 700; color: #35445a; font-size: 13px; }
.permission-group .permission-checks { margin: 8px 0; }

.recent-projects-label { color: #a3adbb; font-size: 11px; margin: 22px 15px 8px; }
.recent-project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px !important; }
.project-members-button { display: inline-flex; align-items: center; gap: 10px; border: 1px solid #e4eaf1; background: #fff; color: #60738b; border-radius: 9px; padding: 7px 12px; font-size: 12px; font-weight: 700; }
.project-avatar-stack { display: flex; padding-inline-start: 7px; }
.project-avatar-stack .member-avatar { width: 30px; height: 30px; margin-inline-start: -7px; border: 2px solid #fff; flex: none; }
.project-members-list { max-height: 55vh; overflow: auto; }
.project-member-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f5; }
.project-member-row:last-child { border-bottom: 0; }
@media (max-width: 700px) { .sidebar.is-open .recent-projects-label { grid-column: 1 / -1; margin: 12px 11px 2px; } .board-actions { flex-wrap: wrap; } }

/* Collapsible navigation and project history */
.sidebar-collapse { align-self: flex-end; border: 0; background: #f3f6fb; color: #617999; border-radius: 8px; width: 34px; height: 34px; margin-top: 20px; }
.sidebar.is-collapsed { width: 76px; padding-inline: 10px; }
.sidebar.is-collapsed .brand { padding: 0; justify-content: center; }
.sidebar.is-collapsed .brand-text, .sidebar.is-collapsed .nav-label, .sidebar.is-collapsed .recent-projects-label, .sidebar.is-collapsed .nav-text, .sidebar.is-collapsed .recent-project-name, .sidebar.is-collapsed .sidebar-profile-info, .sidebar.is-collapsed .account-chevron { display: none; }
.sidebar.is-collapsed .sidebar-collapse { align-self: center; transform: rotate(180deg); margin-bottom: 24px; }
.sidebar.is-collapsed .nav-item { justify-content: center; padding-inline: 0; }
.sidebar.is-collapsed .sidebar-bottom { padding-inline: 0; }
.sidebar.is-collapsed .sidebar-profile { justify-content: center; }
.sidebar.is-collapsed .account-dropdown { min-width: 190px; }
.activity-panel[hidden] { display: none; }
.activity-panel { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: min(380px, 100vw); background: #fff; border-right: 1px solid #e5ebf3; box-shadow: 8px 0 35px #233b5d20; display: flex; flex-direction: column; }
.activity-header { display: flex; align-items: center; justify-content: space-between; padding: 22px; border-bottom: 1px solid #edf1f6; }
.activity-header strong, .activity-header small { display: block; }
.activity-header small { color: #94a2b3; margin-top: 5px; font-size: 11px; }
.activity-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 20px 24px; }
.activity-row { display: flex; gap: 12px; padding: 17px 0; border-bottom: 1px solid #edf1f6; font-size: 12px; }
.activity-row .member-avatar { flex: none; }
.activity-row p { margin: 6px 0; line-height: 1.9; overflow-wrap: anywhere; }
.activity-row time, .activity-message { color: #94a2b3; font-size: 10px; }
.activity-more { margin-top: 12px; }
.activity-panel .button[hidden] { display: none; }
@media (max-width: 700px) { .sidebar-collapse { display: none; } .sidebar.is-collapsed { width: 100%; padding: 11px 16px; } .sidebar.is-collapsed .brand-text { display: inline; } .sidebar.is-collapsed .nav-text, .sidebar.is-collapsed .recent-project-name, .sidebar.is-collapsed .sidebar-profile-info { display: inline; } .sidebar.is-collapsed .nav-item { justify-content: flex-start; padding: 9px 11px; } .activity-toggle { font-size: 10px; } }
.sidebar .nav-item .nav-text, .sidebar .nav-item .recent-project-name { font-size: 12px; }
.project-top-actions { display: flex; align-items: center; gap: 8px; }
.project-top-actions .panel-icon { width: 40px; height: 40px; padding: 0; font-size: 15px; }
.comments-form { border-top: 1px solid #edf1f6; padding: 16px 20px; }
.comments-form label { display: block; font-size: 11px; color: #63748a; margin-bottom: 7px; }
.comments-form textarea { display: block; width: 100%; resize: vertical; min-height: 70px; max-height: 180px; border: 1px solid #dfe6ef; border-radius: 8px; padding: 10px; font: inherit; font-size: 12px; }
.comments-hint { display: block; margin-top: 7px; color: #94a2b3; font-size: 10px; }
.comments-error, .comments-readonly { color: #a25258; font-size: 11px; margin: 10px 0 0; }
.comments-readonly { border-top: 1px solid #edf1f6; padding: 16px 20px; margin: 0; color: #7c8b9d; }
.comment-text { white-space: pre-wrap; }

.activity-panel { transform: translateX(-100%); transition: transform 300ms ease; }
.activity-panel.is-visible { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) { .activity-panel { transition-duration: 0ms; } }

@media (max-width: 700px) { .toast { top: 61px; bottom: auto; } }

/* Project settings */
.project-settings { max-width: 1050px; }
.settings-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.settings-nav a { background: #fff; border: 1px solid #e4eaf1; border-radius: 9px; padding: 10px 15px; color: #60738b; font-size: 12px; font-weight: 700; }
.settings-nav a:hover { color: #4378d3; border-color: #b9cdf3; }
.settings-card { background: #fff; border: 1px solid #e8edf3; border-radius: 13px; padding: 25px; margin-bottom: 18px; scroll-margin-top: 20px; }
.settings-card h2 { margin: 0 0 8px; font-size: 16px; }
.settings-card p, .settings-card li { color: #718198; font-size: 12px; line-height: 2; }
.settings-card ul { padding-right: 20px; }
.settings-card .project-people { padding: 0; margin: 0; border: 0; }
.settings-form { margin-top: 22px; }
.settings-form label, .settings-form .date-label { display: block; color: #63748a; font-size: 11px; font-weight: 700; margin-bottom: 17px; }
.settings-form small { font-weight: 400; color: #aab4c0; }
.settings-form input:not([type=hidden]), .settings-form select, .settings-form textarea { display: block; width: 100%; border: 1px solid #dfe6ef; border-radius: 8px; background: #fff; color: #25334a; padding: 8px 11px; margin-top: 8px; font: inherit; }
.settings-form input:not([type=hidden]), .settings-form select { height: 40px; }
.settings-form textarea { min-height: 95px; resize: vertical; line-height: 1.8; }
.settings-form .jalali-display { cursor: pointer; padding-left: 38px; }
.settings-actions { border-top: 1px solid #eef1f5; padding-top: 19px; display: flex; justify-content: flex-end; }
@media(max-width:700px) { .settings-card { padding: 18px; } }

.notifications-toggle { position: relative; }
.notifications-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 10px; background: #e45d65; color: #fff; font-size: 10px; line-height: 18px; text-align: center; }
.notifications-badge[hidden] { display: none; }
.notification-unread { background: #f3f7ff; border-radius: 8px; padding-inline: 8px; }
.notification-link { color: #487cda; font-weight: 700; }

/* Wallet and additional seats */
.billing-wallet-row { margin-top: 16px; margin-bottom: 28px; align-items: stretch; }
.account-card.billing-wallet-card { display: flex; flex-direction: column; min-width: 0; padding: 25px 27px; border: 1px solid #355eb4; background: linear-gradient(135deg, #213f83 0%, #365fb7 58%, #5685db 100%); color: #fff; box-shadow: 0 12px 28px #345ca529; }
.billing-wallet-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.account-card .billing-wallet-heading h2 { color: #fff; margin: 5px 0 0; font-size: 17px; }
.billing-wallet-eyebrow { color: #d4e3ff; font-size: 11px; }
.billing-wallet-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border: 1px solid #ffffff40; border-radius: 12px; background: #ffffff1a; color: #fff; font-size: 17px; }
.billing-wallet-balance { margin: 28px 0 24px; }
.billing-wallet-balance > span { display: block; color: #d4e3ff; font-size: 12px; }
.billing-wallet-amount { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; margin-top: 5px; }
.billing-wallet-amount strong { font-size: clamp(27px, 3vw, 38px); line-height: 1.5; letter-spacing: .3px; overflow-wrap: anywhere; }
.billing-wallet-amount span { color: #e0ebff; font-size: 14px; font-weight: 700; }
.billing-wallet-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: auto; padding-top: 17px; border-top: 1px solid #ffffff30; }
.account-card.billing-wallet-card .billing-wallet-footer p { color: #e1ebff; font-size: 10px; margin: 7px 0 0; }
.billing-wallet-charge { background: #fff; color: #355fb6; }
.billing-seat-card { display: flex; flex-direction: column; align-items: flex-start; }
.billing-seat-card form { margin-top: 8px; }
@media (max-width: 700px) { .account-card.billing-wallet-card { padding: 22px; } .billing-wallet-balance { margin: 22px 0; } }
