.today-panel {
  overflow: hidden;
}

.today-heading {
  border-bottom: 1px solid #edf1f2;
}

.task-count {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #edf8f6;
  color: #087d76;
  font-size: 12px;
  font-weight: 900;
}

.today-task-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  container-type: inline-size;
}

.today-task-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-content: start;
  gap: 12px;
}

.today-task-card {
  min-width: 0;
  border: 1px solid #e0e7ea;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.today-task-media {
  display: grid;
  place-items: center;
  width: 100%;
  height: 190px;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #f5f7f8;
  box-shadow: none;
  cursor: pointer;
  overflow: hidden;
}

.today-task-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.today-task-body {
  display: grid;
  gap: 9px;
  padding: 11px;
}

.today-task-prompt {
  overflow: hidden;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-task-meta,
.today-task-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.today-task-meta {
  color: #84909f;
  font-size: 11px;
}

.today-task-actions button {
  min-height: 27px;
  padding: 0 8px;
  border: 1px solid #e0e6e9;
  border-radius: 5px;
  background: #fff;
  color: #586576;
  cursor: pointer;
  font-size: 11px;
}

.today-load-state {
  grid-column: 1 / -1;
  padding: 12px;
  color: #98a2b3;
  font-size: 12px;
  text-align: center;
}

.history-section {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid #dfe7e9;
  border-radius: 8px;
  background: #fff;
}

.history-heading {
  margin-bottom: 20px;
}

.history-section .history-feed-frame {
  overflow: visible;
  padding: 0;
}

.history-section .generation-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, 320px);
  gap: 18px;
  justify-content: start;
  align-items: start;
  width: 100%;
  min-height: 180px;
  padding: 0;
}

.history-section .feed-item {
  display: grid;
  grid-template-rows: 82px 270px 34px 18px;
  gap: 10px;
  width: 320px;
  height: 468px;
  margin: 0;
  padding: 16px;
  border: 1px solid #e0e7ea;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.history-section .feed-copy {
  gap: 6px;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.history-section .feed-copy h3 {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-section .reference-strip {
  display: none;
}

.history-section .chip-row {
  max-height: 46px;
  gap: 5px;
  overflow: hidden;
}

.history-section .meta-chip {
  min-height: 20px;
  padding: 0 7px;
  font-size: 11px;
}

.history-section .result-frame {
  width: 100%;
  height: 270px;
  aspect-ratio: auto;
  box-shadow: none;
}

.history-section .result-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.history-section .feed-time {
  position: static;
  display: block;
  min-width: 0;
  margin: 0;
}

.history-section .feed-actions {
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
}

.history-section .load-more-button,
.history-section .empty-state {
  grid-column: 1 / -1;
}

.redeem-dialog {
  width: min(460px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(29, 48, 58, 0.25);
}

.redeem-dialog::backdrop {
  background: rgba(16, 24, 40, 0.45);
}

.redeem-dialog-body {
  position: relative;
  padding: 28px;
}

.redeem-dialog .modal-close {
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid #dce5e8;
  box-shadow: none;
}

.redeem-dialog-body > p {
  margin-top: 8px;
  color: #667085;
  font-size: 13px;
  line-height: 1.6;
}

.dialog-kicker {
  color: #13a89e;
  font-size: 11px;
  font-weight: 900;
}

.dialog-balance {
  margin: 20px 0;
  padding: 12px;
  border-radius: 7px;
  background: #eff9f7;
  color: #087d76;
  font-size: 13px;
}

.redeem-form {
  display: grid;
  gap: 9px;
}

.redeem-form input {
  height: 42px;
  padding: 0 12px;
}

.redeem-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 8px;
}

.redeem-actions .purchase-key-button {
  display: grid;
  place-items: center;
  height: 42px;
  text-decoration: none;
}

@media (max-width: 1180px) {
  .workspace-shell { grid-template-columns: 188px minmax(0, 1fr); }
  .creation-workspace { grid-template-columns: minmax(380px, 42%) minmax(0, 1fr); }
  .today-task-feed { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .ratio-options { grid-template-columns: repeat(6, 40px); }
}

@media (max-width: 860px) {
  .workspace-shell { grid-template-columns: 1fr; grid-template-rows: 58px minmax(0, 1fr); height: 100svh; }
  .workspace-sidebar { flex-direction: row; align-items: center; gap: 8px; padding: 7px 10px; border-right: 0; border-bottom: 1px solid #dce5e8; overflow-x: auto; }
  .sidebar-brand { min-height: 40px; padding: 0; }
  .sidebar-brand > span:last-child, .sidebar-section-title, .sidebar-spacer, .sidebar-user { display: none; }
  .workspace-sidebar .provider-list { display: flex; min-width: max-content; }
  .workspace-sidebar .provider-card { width: auto; min-width: 126px; }
  .sidebar-action { flex: 0 0 auto; width: auto; min-height: 40px; }
  .workspace-main { grid-template-rows: 62px minmax(0, 1fr); }
  .workspace-header { padding: 0 14px; }
  .workspace-header .account-pill { display: none; }
  .workspace-scroll { padding: 14px; }
  .creation-workspace { grid-template-columns: 1fr; min-height: 0; }
  .generation-settings-panel, .today-panel { height: auto; min-height: 0; max-height: none; }
  .generation-settings-panel { overflow-y: visible; }
  .today-panel { height: 640px; }
  .history-section { margin-top: 16px; padding: 16px; }
}

@media (max-width: 520px) {
  .workspace-title p { display: none; }
  .workspace-title h2 { max-width: 150px; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  .credit-button { padding: 0 8px; }
  .panel-heading { padding: 16px 16px 12px; }
  .generation-status-slot { left: 16px; right: 16px; }
  .generation-settings-card { padding: 0 16px 18px; }
  .ratio-options { grid-template-columns: repeat(6, 40px); }
  .today-task-feed { grid-template-columns: 1fr; }
  .today-task-media { height: 230px; }
  .history-section .generation-feed { grid-template-columns: minmax(0, 320px); }
  .history-section .feed-item { width: min(320px, 100%); }
  .redeem-actions { grid-template-columns: 1fr; }
}
