:root {
  --ink:#21342c;
  --muted:#6d7a71;
  --green:#265843;
  --green-dark:#1b4332;
  --lime:#d6ebae;
  --line:#dfe4da;
  --paper:#fffefa;
  --wash:#f3f4ed;
  --yellow:#fff0bf;
  --red:#a83932;
  --shadow:0 16px 56px #20382b0b;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  background:var(--wash);
  font-synthesis:none;
  line-height:1.5
}

* {
  box-sizing:border-box
}

body {
  margin:0
}

button,input,select,textarea {
  font:inherit
}

button,a,input,select,textarea,summary {
  touch-action:manipulation
}

button {
  cursor:pointer
}

button:disabled {
  cursor:wait;
  opacity:.6
}

a {
  color:inherit
}

h1,h2,h3,p {
  margin-top:0
}

h1 {
  font-size:clamp(2rem,3.3vw,3rem);
  line-height:1.13;
  letter-spacing:-.055em;
  margin-bottom:12px
}

h2 {
  font-size:1.5rem;
  line-height:1.25;
  letter-spacing:-.035em;
  margin-bottom:12px
}

h3 {
  font-size:1rem;
  margin-bottom:8px
}

p {
  margin-bottom:16px
}

small,.small {
  font-size:.82rem
}

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

[hidden] {
  display:none!important
}

:focus-visible {
  outline:3px solid #809f48;
  outline-offset:3px
}

label {
  display:block;
  font-size:.82rem;
  font-weight:650;
  margin:20px 0 7px
}

input,select,textarea {
  width:100%;
  border:1px solid #cfd8cd;
  border-radius:9px;
  background:#fffefa;
  color:var(--ink);
  padding:11px 13px;
  min-height:44px
}

textarea {
  resize:vertical
}

input:focus,select:focus,textarea:focus {
  border-color:var(--green)
}

button {
  border:0
}

.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:22px;
  border-radius:9px;
  padding:11px 18px;
  min-height:44px;
  font-size:.88rem;
  font-weight:650;
  text-decoration:none;
  transition:background .15s
}

.primary {
  background:var(--green);
  color:white
}

.primary:hover {
  background:var(--green-dark)
}

.secondary {
  background:#e8ece3;
  color:var(--green)
}

.secondary:hover {
  background:#dfe6d8
}

.quiet {
  background:transparent;
  color:var(--muted);
  padding:8px 12px
}

.quiet:hover {
  background:#e7ebdf
}

.danger {
  color:var(--red);
  background:#f9e8e4
}

.full {
  width:100%
}

.icon-button {
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  flex:none;
  border-radius:50%;
  font-size:1.6rem;
  background:#eef0e8;
  color:var(--muted)
}

.link-button {
  background:none;
  color:var(--green);
  font-size:.78rem;
  padding:6px 2px;
  text-decoration:underline;
  text-underline-offset:3px
}

.site-header {
  height:94px;
  padding:0 5%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  background:var(--paper)
}

.brand {
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  font-weight:760;
  letter-spacing:-.025em
}

.brand small {
  display:block;
  font-size:.67rem;
  color:var(--muted);
  font-weight:500;
  letter-spacing:.01em
}

.brand-mark {
  width:43px;
  height:43px;
  display:grid;
  place-items:center;
  border-radius:13px 13px 13px 2px;
  background:var(--green);
  color:var(--lime);
  font-size:1.7rem;
  font-weight:500
}

.header-actions {
  display:flex;
  align-items:center;
  gap:14px;
  font-size:.84rem
}

.header-actions>span {
  color:var(--muted);
  padding-right:14px;
  border-right:1px solid var(--line)
}

main {
  max-width:1550px;
  margin:0 auto;
  padding:0 5%;
  min-height:calc(100vh - 168px)
}

.site-footer {
  display:flex;
  justify-content:space-between;
  padding:24px 5%;
  color:#879187;
  font-size:.7rem
}

.eyebrow {
  font-size:.67rem;
  letter-spacing:.17em;
  text-transform:uppercase;
  color:#70875d;
  font-weight:750;
  margin-bottom:18px
}

.login-layout {
  display:grid;
  grid-template-columns:1.15fr 1fr;
  gap:12%;
  align-items:center;
  max-width:1050px;
  margin:0 auto;
  padding:86px 0 80px
}

.welcome h1 {
  font-size:clamp(2.4rem,4.6vw,4.4rem);
  line-height:1.04;
  margin-bottom:26px
}

.welcome>p:not(.eyebrow) {
  max-width:410px;
  color:var(--muted);
  font-size:1rem;
  line-height:1.8
}

.welcome-note {
  display:flex;
  gap:18px;
  align-items:center;
  border-top:1px solid var(--line);
  margin-top:36px;
  padding-top:24px;
  max-width:390px
}

.welcome-note p {
  font-size:.8rem;
  color:var(--muted);
  margin:0
}

.note-icon {
  font-size:1.5rem;
  flex:none;
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  background:var(--lime);
  border-radius:50%
}

.login-card {
  background:var(--paper);
  padding:36px 34px;
  border-radius:20px;
  box-shadow:var(--shadow);
  border:1px solid var(--line)
}

.section-number {
  display:block;
  font-size:.63rem;
  letter-spacing:.14em;
  color:#86927e;
  margin-bottom:32px
}

.login-card h2 {
  font-size:1.65rem
}

.login-card>.muted {
  font-size:.84rem
}

.login-card .primary {
  margin:26px 0 18px
}

.login-card p:last-child {
  margin-bottom:0
}

.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding:42px 0 28px
}

.page-heading .eyebrow {
  margin-bottom:10px
}

.page-heading h1 {
  font-size:2.35rem;
  margin-bottom:8px
}

.page-heading p:last-child {
  font-size:.86rem;
  margin:0
}

.workspace {
  display:grid;
  grid-template-columns:330px minmax(0,1fr);
  border:1px solid var(--line);
  border-radius:15px;
  overflow:hidden;
  background:var(--paper);
  box-shadow:var(--shadow);
  min-height:620px;
  margin-bottom:18px
}

.ticket-sidebar {
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  background:#fafbf6
}

.list-controls {
  padding:19px 20px 0
}

.search-label {
  margin:0 0 8px;
  font-size:.71rem;
  color:var(--muted)
}

.list-controls input {
  font-size:.8rem;
  background:white
}

.filter-tabs {
  display:flex;
  gap:20px;
  border-bottom:1px solid var(--line);
  margin-top:18px
}

.filter-tabs button {
  background:none;
  padding:9px 0 13px;
  font-size:.81rem;
  color:var(--muted);
  border-bottom:2px solid transparent
}

.filter-tabs button.selected {
  border-color:var(--green);
  color:var(--green);
  font-weight:650
}

.filter-tabs span {
  font-size:.66rem;
  background:#e9ede2;
  border-radius:5px;
  padding:2px 5px;
  margin-left:4px
}

.ticket-list {
  flex:1;
  overflow:auto;
  max-height:650px
}

.ticket-row {
  display:block;
  text-align:left;
  width:100%;
  padding:19px 20px;
  border-bottom:1px solid #e8ebe2;
  background:transparent
}

.ticket-row:hover {
  background:#f0f4e8
}

.ticket-row.selected {
  background:#eaf1df;
  box-shadow:inset 3px 0 var(--green)
}

.row-top,.row-bottom {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px
}

.row-top {
  font-size:.66rem;
  color:var(--muted);
  margin-bottom:7px
}

.row-title {
  display:block;
  font-size:.92rem;
  font-weight:650;
  line-height:1.4;
  margin-bottom:9px;
  overflow-wrap:anywhere
}

.row-bottom {
  font-size:.67rem;
  color:var(--muted)
}

.unread-dot {
  display:inline-block;
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--green);
  margin-right:5px
}

.badge {
  display:inline-block;
  font-size:.63rem;
  line-height:1.3;
  font-weight:650;
  letter-spacing:.01em;
  padding:4px 7px;
  border-radius:5px;
  background:#e8ece1;
  color:#617052;
  white-space:nowrap
}

.badge.urgent {
  background:#fae2dd;
  color:#9e3b30
}

.badge.high {
  background:var(--yellow);
  color:#8c651a
}

.badge.progress {
  background:#e1ede9;
  color:#386655
}

.badge.waiting {
  background:#fff1c8;
  color:#937420
}

.badge.closed {
  background:#eaece8;
  color:#777f73
}

.list-footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:13px 18px;
  font-size:.65rem;
  color:var(--muted);
  border-top:1px solid var(--line)
}

.ticket-detail {
  min-width:0;
  padding:30px 34px
}

.empty-detail {
  text-align:center;
  max-width:320px;
  margin:120px auto 80px;
  color:var(--muted);
  font-size:.87rem
}

.empty-detail h2 {
  color:var(--ink);
  margin:25px 0 10px
}

.empty-symbol {
  display:inline-grid;
  place-items:center;
  width:72px;
  height:72px;
  border:1px solid var(--line);
  border-radius:23px;
  font-size:2.3rem;
  color:#95ac7c;
  background:#f3f6eb
}

.empty-list {
  padding:35px 22px;
  font-size:.8rem;
  color:var(--muted)
}

.detail-heading {
  border-bottom:1px solid var(--line);
  padding-bottom:22px;
  margin-bottom:25px
}

.detail-meta {
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  font-size:.72rem;
  color:var(--muted);
  margin-bottom:13px
}

.detail-heading h2 {
  font-size:1.55rem;
  overflow-wrap:anywhere
}

.detail-byline {
  font-size:.72rem;
  color:var(--muted);
  margin:0
}

.thread {
  display:flex;
  flex-direction:column;
  gap:18px
}

.entry {
  background:#f4f6ef;
  border:1px solid #e8ede0;
  border-radius:2px 12px 12px 12px;
  padding:16px 18px
}

.entry.own {
  background:#fff;
  border-color:#e5e8df;
  margin-left:25px;
  border-radius:12px 2px 12px 12px
}

.entry-heading {
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:12px;
  font-size:.76rem;
  margin-bottom:10px
}

.entry-heading time {
  font-size:.65rem;
  color:var(--muted)
}

.entry-body {
  font-size:.87rem;
  line-height:1.7;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  margin:0
}

.event-entry {
  font-size:.73rem;
  color:var(--muted);
  padding:0 10px;
  border-left:2px solid #d8e1cd
}

.event-entry time {
  font-size:.63rem;
  display:block;
  margin-top:3px
}

.reply-form {
  margin-top:27px;
  padding-top:19px;
  border-top:1px solid var(--line)
}

.reply-form label {
  margin-top:0
}

.reply-form textarea {
  font-size:.84rem
}

.reply-actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  margin-top:12px
}

.reply-actions p {
  font-size:.69rem;
  color:var(--muted);
  margin:0
}

.management {
  margin-top:24px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f9faf5
}

.management summary {
  cursor:pointer;
  font-size:.81rem;
  font-weight:650
}

.management summary small {
  font-weight:400;
  color:var(--muted);
  margin-left:8px
}

.form-row {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px
}

.management label {
  font-size:.72rem;
  margin-top:15px
}

.management input,.management select {
  font-size:.8rem
}

.management .button {
  font-size:.76rem;
  min-height:38px;
  padding:8px 12px;
  margin-top:12px
}

.worklog-list {
  margin:15px 0 0;
  padding:0;
  list-style:none;
  font-size:.7rem;
  color:var(--muted)
}

.worklog-list li {
  padding:8px 0;
  border-top:1px solid var(--line)
}

.worklog-list strong {
  color:var(--ink)
}

.timer-row {
  margin:13px 0;
  font-size:.75rem
}

.timer-active {
  color:var(--green);
  font-weight:650
}

.modal {
  border:1px solid var(--line);
  border-radius:17px;
  width:min(600px,calc(100vw - 32px));
  max-height:calc(100dvh - 50px);
  padding:28px;
  background:var(--paper);
  color:var(--ink);
  box-shadow:0 30px 100px #17322333;
  overflow:auto
}

.modal::backdrop {
  background:#1c322d80;
  backdrop-filter:blur(3px)
}

.modal-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  margin-bottom:25px
}

.modal-heading .eyebrow {
  margin-bottom:8px
}

.modal-heading h2 {
  margin:0
}

.modal .small {
  margin-top:14px
}

.modal-actions {
  display:flex;
  justify-content:flex-end;
  gap:12px;
  margin-top:23px
}

.wide-modal {
  width:min(880px,calc(100vw - 32px))
}

.account-create {
  border:1px solid var(--line);
  border-radius:10px;
  padding:17px;
  margin-bottom:20px
}

.account-create summary {
  cursor:pointer;
  font-size:.85rem;
  font-weight:650
}

.account-create textarea {
  font-size:.76rem
}

.account-create .button {
  margin-top:16px
}

.account-item {
  padding:18px 0;
  border-bottom:1px solid var(--line)
}

.account-item h3 {
  margin:0
}

.account-item p {
  font-size:.73rem;
  color:var(--muted);
  margin:5px 0 10px;
  overflow-wrap:anywhere
}

.account-controls {
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap
}

.account-controls label {
  display:flex;
  gap:7px;
  align-items:center;
  margin:0;
  font-size:.71rem
}

.account-controls input[type=checkbox] {
  width:16px;
  min-height:16px;
  accent-color:var(--green)
}

.account-controls .button {
  font-size:.71rem;
  padding:6px 9px;
  min-height:34px
}

.account-controls select {
  width:auto;
  font-size:.75rem;
  min-height:36px;
  padding:6px
}

.print-modal iframe {
  width:100%;
  height:50vh;
  border:1px solid var(--line);
  background:white
}

.notice {
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  padding:13px 20px;
  border-radius:10px;
  background:var(--green-dark);
  color:white;
  font-size:.82rem;
  z-index:20;
  box-shadow:var(--shadow);
  max-width:min(600px,90vw)
}

.notice.error {
  background:#943d32
}

.loading-view {
  padding:100px 0;
  text-align:center;
  color:var(--muted);
  font-size:.85rem
}

.skip-link {
  position:fixed;
  top:-80px;
  left:20px;
  padding:10px;
  background:white;
  z-index:40
}

.skip-link:focus {
  top:10px
}

.dialog-notice {
  font-size:.82rem;
  padding:12px 15px;
  background:#eaf1df;
  border-radius:8px
}

.dialog-notice.error {
  color:var(--red);
  background:#f9e8e4
}

.load-changes {
  margin-bottom:20px;
  width:100%
}

@media(min-width:1300px) {
  .workspace {
    grid-template-columns:365px minmax(0,1fr)
  }
  .ticket-detail {
    padding:35px 46px
  }
}

@media(max-width:850px) {
  .site-header {
    height:80px;
    padding:0 24px
  }
  main {
    padding:0 24px
  }
  .login-layout {
    gap:7%;
    padding:65px 0
  }
  .login-card {
    padding:26px
  }
  .workspace {
    grid-template-columns:280px minmax(0,1fr)
  }
  .ticket-detail {
    padding:24px
  }
  .site-footer {
    padding:24px
  }
  .header-actions {
    gap:5px
  }
  .header-actions>span {
    display:none
  }
}

@media(max-width:650px) {
  main {
    padding:0 16px
  }
  .site-header {
    padding:0 18px;
    height:76px
  }
  .brand {
    font-size:.9rem
  }
  .brand-mark {
    width:36px;
    height:36px;
    border-radius:10px 10px 10px 2px;
    font-size:1.5rem
  }
  .header-actions .button {
    font-size:.74rem;
    padding:8px
  }
  .login-layout {
    display:block;
    padding:36px 6px
  }
  .welcome h1 {
    font-size:2.7rem
  }
  .welcome>p:not(.eyebrow) {
    font-size:.9rem
  }
  .welcome-note {
    display:none
  }
  .login-card {
    margin-top:28px;
    padding:26px
  }
  .section-number {
    margin-bottom:23px
  }
  .page-heading {
    align-items:flex-start;
    padding:28px 0 22px;
    gap:12px
  }
  .page-heading h1 {
    font-size:1.8rem
  }
  .page-heading .button {
    font-size:.73rem;
    padding:9px 12px;
    white-space:nowrap
  }
  .page-heading p:last-child {
    font-size:.75rem
  }
  .workspace {
    display:flex;
    flex-direction:column;
    min-height:0
  }
  .ticket-sidebar {
    border-right:0;
    border-bottom:1px solid var(--line)
  }
  .ticket-list {
    max-height:255px
  }
  .list-controls {
    padding:15px 16px 0
  }
  .ticket-row {
    padding:14px 17px
  }
  .ticket-detail {
    padding:24px 20px
  }
  .empty-detail {
    margin:40px auto
  }
  .detail-heading h2 {
    font-size:1.35rem
  }
  .entry.own {
    margin-left:12px
  }
  .entry {
    padding:14px
  }
  .reply-actions {
    align-items:flex-end
  }
  .site-footer {
    padding:20px 18px
  }
  .site-footer span:last-child {
    display:none
  }
  .modal {
    padding:22px
  }
  .modal-heading {
    margin-bottom:18px
  }
  .form-row {
    gap:10px
  }
  .account-controls {
    gap:10px
  }
  .account-controls select {
    max-width:100%
  }
  .modal-actions .button {
    font-size:.78rem
  }
  .notice {
    bottom:15px;
    width:90vw
  }
  .page-heading .eyebrow {
    font-size:.6rem
  }
  .page-heading>.button {
    margin-top:22px
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important;
    transition:none!important
  }
}
