.kanban-help {
  margin: 0 0 16px;
  max-width: 80ch;
}
.kanban-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 16px;
  overscroll-behavior-x: contain;
}
.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(5, minmax(205px, 1fr));
  grid-auto-columns: 205px;
  gap: 16px;
  align-items: start;
  min-height: 380px;
}
.kanban-column {
  background: #eef1f3;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px;
  min-height: 340px;
}
.kanban-column.drop-target {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.kanban-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.kanban-heading h2 {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  margin: 0;
  flex: 1;
}
.kanban-count {
  font-size: 12px;
  background: white;
  color: var(--muted);
  padding: 2px 7px;
  border-radius: 4px;
}
.kanban-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #88939e;
}
.kanban-dot.tone-1 {
  background: #557fa6;
}
.kanban-dot.tone-2 {
  background: #a67d37;
}
.kanban-dot.tone-3 {
  background: #766b9f;
}
.kanban-dot.tone-4 {
  background: var(--accent);
}
.kanban-stack {
  display: grid;
  gap: 12px;
  max-height: min(650px, 65vh);
  overflow-y: auto;
  scrollbar-width: thin;
}
.kanban-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}
.kanban-card[draggable="true"] {
  cursor: grab;
}
.kanban-card.dragging {
  opacity: 0.5;
}
.kanban-photo {
  display: block;
  height: 116px;
  border-bottom: 1px solid #eef1f3;
}
.kanban-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  pointer-events: none;
}
.kanban-body {
  padding: 12px;
}
.kanban-title {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 500;
  margin: 6px 0 8px;
  overflow-wrap: anywhere;
}
.kanban-title:hover {
  color: var(--accent);
}
.kanban-body p {
  margin: 7px 0;
}
.kanban-body .btn {
  width: 100%;
  margin-top: 12px;
  font-size: 12px;
}
.kanban-footer {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.kanban-reason {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.kanban-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 20px 4px;
}
@media (max-width: 767px) {
  .kanban-board {
    grid-template-columns: repeat(5, min(280px, 80vw));
    grid-auto-columns: min(280px, 80vw);
  }
  .kanban-body .btn {
    min-height: 44px;
  }
}
.catalog-top {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.catalog-top strong {
  font-size: 20px;
  font-weight: 500;
  margin-right: 6px;
}
.catalog-top > span {
  display: flex;
  gap: 4px;
  align-items: baseline;
  color: var(--muted);
}
.catalog-top .selected {
  color: var(--accent);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.product-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  overflow: hidden;
  transition: border-color 150ms;
}
.product-card:hover {
  border-color: #99bcb6;
}
.product-card .visual {
  display: block;
  position: relative;
  aspect-ratio: 1.8;
  overflow: hidden;
  background: #eef0ee;
}
.visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
  padding: 10px;
}
.visual .sample-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: #fffffff0;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 10px;
  color: #4a5b5a;
  display: flex;
  gap: 4px;
  align-items: center;
}
.sample-tag svg {
  width: 12px;
  height: 12px;
}
.product-body {
  padding: 17px 18px 14px;
}
.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 11px;
}
.product-code {
  font-size: 11px;
  color: #76828a;
}
.product-name {
  font-weight: 500;
  line-height: 1.35;
  font-size: 16px;
  display: block;
  margin-bottom: 5px;
  min-height: 42px;
}
.product-client {
  font-size: 12px;
  color: var(--muted);
}
.product-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}
.record-materials {
  margin-top: 14px;
}
.material-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.material-gallery figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.material-gallery .imagebutton {
  width: 100%;
  background: white;
}
.material-gallery img {
  width: 100%;
  height: 190px;
  object-fit: contain;
}
.material-gallery figcaption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  font-size: 12px;
}
@media (max-width: 600px) {
  .material-gallery {
    grid-template-columns: 1fr;
  }
}
.product-bottom {
  border-top: 1px solid #edf0f2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  font-size: 11px;
}
.person {
  display: flex;
  align-items: center;
  gap: 7px;
}
.product-hero {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 26px;
  margin-bottom: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
.product-hero .imagebutton {
  position: relative;
  display: block;
  border: 0;
  padding: 0;
  border-radius: 9px;
  overflow: hidden;
  background: #e9eeeb;
}
.product-hero img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: white;
}
.imagebutton .expand {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: white;
  padding: 6px;
  border-radius: 6px;
  display: flex;
}
.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.fact dt {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.fact dd {
  margin: 0;
  font-size: 13px;
}
.flow {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  margin-bottom: 24px;
  overflow: auto;
}
.flow-step {
  flex: 1;
  min-width: 130px;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  border-right: 1px solid #edf0f2;
}
.flow-step:last-child {
  border: 0;
}
.flow-step span {
  display: inline-grid;
  place-items: center;
  border: 1px solid #cbd3d9;
  border-radius: 50%;
  width: 21px;
  height: 21px;
  font-size: 10px;
  flex-shrink: 0;
}
.flow-step.done {
  color: var(--accent);
}
.flow-step.done span {
  background: var(--accent-soft);
  border-color: #c7ded9;
}
.flow-step.current {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.flow-step.current span {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.detail-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
}
.tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: start;
  position: sticky;
  top: 16px;
}
.tabs a {
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  line-height: 1.3;
  color: #66707a;
}
.tabs a svg {
  width: 16px;
  height: 16px;
}
.tabs a.active {
  background: white;
  color: var(--accent);
  font-weight: 500;
  border: 1px solid var(--line);
}
.tabs a:hover {
  color: var(--accent);
}
.data-list {
  display: grid;
  gap: 0;
}
.data-list .fact {
  padding: 12px 0;
  border-bottom: 1px solid #edf0f2;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  margin: 0;
}
.data-list dt {
  font-size: 13px;
}
.data-list dd {
  font-size: 14px;
  word-break: break-word;
}
.data-list .fact:last-child {
  border: 0;
}
.note-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
}
.note-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
}
.note-card p {
  font-size: 14px;
  color: #4e5964;
  line-height: 1.6;
  white-space: pre-wrap;
}
.record-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin-top: 12px;
}
.record-fields .fact {
  margin: 0;
}
.sample-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.sample-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.sample-card img {
  width: 100%;
  aspect-ratio: 1.7;
  object-fit: contain;
  background: white;
}
.sample-card .sample-body {
  padding: 18px;
}
.sample-body p {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 12px;
}
.timeline {
  margin-left: 12px;
  border-left: 1px solid #cfdcd8;
}
.event {
  position: relative;
  padding: 0 0 22px 25px;
}
.event::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6b9e94;
  outline: 4px solid white;
}
.event header {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}
.event h3 {
  font-size: 14px;
}
.event p {
  font-size: 12px;
  margin-top: 5px;
  color: var(--muted);
  white-space: pre-wrap;
}
.file-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.file-icon {
  width: 35px;
  height: 39px;
  display: grid;
  place-items: center;
  background: #edf3f2;
  border-radius: 5px;
  color: var(--accent);
}
.file-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}
.idea-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 1fr);
  gap: 20px;
}
.idea-description {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 24px;
  white-space: pre-wrap;
}
.idea-links {
  display: grid;
  gap: 10px;
}
.idea-product {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.idea-product img {
  width: 48px;
  height: 38px;
  object-fit: cover;
  border-radius: 4px;
}
.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: white;
}
.login-story {
  padding: 60px;
  background: #e8efec;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}
.login-story .brand {
  margin: 0;
}
.login-story h1 {
  font-size: 46px;
  line-height: 1.13;
  max-width: 460px;
}
.login-story p {
  max-width: 430px;
  margin-top: 20px;
  color: #526863;
}
.login-story img {
  width: 100%;
  border-radius: 14px;
  margin-top: 30px;
}
.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form > div {
  max-width: 400px;
  width: 100%;
}
.login-form h2 {
  font-size: 28px;
}
.login-form p {
  font-size: 14px;
  margin: 10px 0 24px;
  color: var(--muted);
}
.login-form .btn {
  width: 100%;
  margin-top: 20px;
}
.usercard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.usercard .avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}
.usercard > div {
  flex: 1;
}
.usercard h3 {
  font-size: 14px;
}
.usercard p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.usercard .btn {
  padding: 7px 10px;
}
.permission-table td {
  font-size: 12px;
}
.permission-table svg {
  color: var(--accent);
  width: 16px;
  height: 16px;
}
.permission-table .no {
  color: #b3bbc2;
}
.user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.image-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.statusbar {
  padding: 9px 14px;
  background: var(--amber-soft);
  font-size: 12px;
  color: var(--amber);
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.swatch {
  height: 32px;
  width: 32px;
  border-radius: 6px;
  border: 1px solid #0002;
}
.section-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--muted);
}
@media (min-width: 1650px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1190px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .sidebar {
    padding: 24px 12px;
  }
  .content {
    padding: 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-layout {
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 18px;
  }
  .product-hero {
    grid-template-columns: 200px 1fr;
  }
  .hero-facts {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .sidebar.open {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    z-index: 30;
    box-shadow: var(--shadow);
  }
  .mobile-menu {
    display: flex;
  }
  .topbar {
    height: 62px;
    padding: 0 20px;
  }
  .top-search {
    flex: 1;
    width: auto;
  }
  .profile .avatar {
    display: none;
  }
  .profile select {
    max-width: 150px;
  }
  .content {
    padding: 24px 20px;
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .tabs {
    position: static;
    display: flex;
    flex-direction: row;
    overflow: auto;
    gap: 5px;
    padding-bottom: 5px;
  }
  .tabs a {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .idea-overview {
    grid-template-columns: 1fr;
  }
  .login-story {
    padding: 36px;
  }
  .login-story h1 {
    font-size: 36px;
  }
  .user-grid {
    grid-template-columns: 1fr;
  }
  .top-search input {
    font-size: 12px;
  }
}
@media (max-width: 560px) {
  h1 {
    font-size: 26px;
  }
  .content {
    padding: 20px 16px;
  }
  .topbar {
    padding: 0 16px;
    gap: 8px;
  }
  .top-search {
    display: none;
  }
  .profile {
    margin-left: auto;
  }
  .page-head {
    flex-direction: column;
    gap: 16px;
  }
  .page-head .actions {
    width: 100%;
  }
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .filters {
    width: 100%;
    gap: 6px;
  }
  .filters select,
  .filters input {
    max-width: calc(50% - 4px);
    flex: 1;
    min-width: 130px;
  }
  .product-grid {
    grid-template-columns: 1fr;
  }
  .product-card .visual {
    aspect-ratio: 2;
  }
  .catalog-top {
    gap: 12px;
    font-size: 11px;
  }
  .catalog-top strong {
    font-size: 17px;
  }
  .product-hero {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 18px;
  }
  .product-hero img {
    height: 160px;
  }
  .hero-facts {
    gap: 14px;
  }
  .panel {
    padding: 18px;
  }
  .grid2,
  .sample-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .data-list .fact {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .record-fields {
    grid-template-columns: 1fr;
  }
  .flow-step {
    min-width: 125px;
  }
  .login {
    grid-template-columns: 1fr;
  }
  .login-story {
    padding: 28px;
    gap: 24px;
  }
  .login-story h1 {
    font-size: 30px;
  }
  .login-story img {
    display: none;
  }
  .login-form {
    padding: 32px 24px;
  }
  .dialog-head,
  .dialog-body {
    padding: 18px;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
  .table-wrap {
    max-width: 100%;
  }
  td,
  th {
    padding: 12px;
  }
  .usercard {
    padding: 14px;
  }
  .usercard .btn {
    font-size: 11px;
  }
  .list-footer {
    flex-direction: column;
    gap: 6px;
  }
  .product-name {
    min-height: auto;
  }
  .toast {
    right: 16px;
    bottom: 16px;
  }
  .panel-head {
    align-items: flex-start;
  }
  .panel-head .btn {
    font-size: 11px;
    padding: 8px;
  }
}
@media (max-width: 560px) {
  .topbar {
    height: auto;
    min-height: 62px;
  }
  .top-search {
    display: block;
    order: 3;
    width: 100%;
    flex-basis: 100%;
    background: #f4f6f7;
    border-radius: 7px;
  }
  .top-search svg {
    left: 10px;
  }
  .top-search input {
    padding-left: 36px;
  }
  .filters label {
    flex: 1 0 130px;
    min-height: 36px;
  }
  .filters input[type="checkbox"] {
    flex: 0 0 18px;
    width: 18px;
    min-width: 18px;
    max-width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    margin: 0;
  }
}
h1,
h2,
h3,
.product-name {
  overflow-wrap: anywhere;
}
.page-head > div {
  min-width: 0;
}
main:focus {
  outline: none;
}

/* Server-owned technical IDs remain readable on narrow screens. */
.product-code,.breadcrumb,.page-head p{overflow-wrap:anywhere;}
.page-head>div,.product-hero>div{min-width:0;}

/* Keep wide execution/technical tables inside their own scroll region. */
.stack{grid-template-columns:minmax(0,1fr);min-width:0;}
.detail-layout>.stack,.idea-overview>.stack,.panel,details{min-width:0;}
.table-wrap{max-width:100%;min-width:0;}
@media(max-width:780px){.detail-layout{grid-template-columns:minmax(0,1fr);}.panel-head{flex-wrap:wrap;}}
