.text-memo-widget {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.text-memo-widget__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.text-memo-widget__head-title {
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.text-memo-widget__head-meta {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.layout-playground__pane--surface .text-memo-widget {
  box-sizing: border-box;
  height: calc(100% - 8px);
  min-height: 0;
  padding-bottom: 4px;
}

.text-memo-widget__body {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.text-memo-widget__body--list-open {
  gap: 0;
}

.text-memo-widget__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 0;
  min-width: 0;
  flex-wrap: nowrap;
}

.text-memo-widget__toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex-wrap: nowrap;
}

.text-memo-widget__toolbar .ant-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  color: #6b7280;
  font-size: 13px;
}

.text-memo-widget__toolbar .ant-btn:not(:disabled):hover {
  color: #111827;
  background: rgba(15, 23, 42, 0.06);
}

.text-memo-widget__editor {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.42)),
    repeating-linear-gradient(
      180deg,
      rgba(255, 248, 216, 0.98) 0,
      rgba(255, 248, 216, 0.98) 37px,
      rgba(236, 221, 177, 0.78) 37px,
      rgba(236, 221, 177, 0.78) 38px
    );
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.text-memo-widget--flat {
  gap: 10px;
  padding: 0;
}

.text-memo-widget--flat .text-memo-widget__toolbar {
  padding-top: 0;
}

.text-memo-widget--flat .text-memo-widget__toolbar .ant-btn:not(:disabled):hover {
  background: rgba(14, 116, 144, 0.08);
}

.text-memo-widget--flat .text-memo-widget__editor {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.text-memo-widget--flat .text-memo-widget__meta {
  min-height: 32px;
  padding: 12px 14px 0;
  color: #64748b;
}

.text-memo-widget--flat .text-memo-widget__input.ant-input,
.text-memo-widget--flat .text-memo-widget__editor .ant-input {
  padding: 10px 14px 18px;
  color: #0f172a;
  line-height: 1.65;
}

.text-memo-widget--flat .text-memo-widget__editor .ant-input::placeholder {
  color: #94a3b8;
}

.text-memo-widget--flat .text-memo-widget__sheet {
  border-radius: 18px;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.text-memo-widget--flat .text-memo-widget__list {
  gap: 6px;
  padding: 8px;
}

.text-memo-widget--flat .text-memo-widget__list-item {
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  background: #fff;
}

.text-memo-widget--flat .text-memo-widget__list-item:hover {
  background: #f8fafc;
}

.text-memo-widget--flat .text-memo-widget__list-item--active {
  border-color: rgba(14, 116, 144, 0.26);
  background: rgba(240, 249, 255, 0.96);
}

.text-memo-widget__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  padding: 14px 18px 0;
  color: rgba(100, 116, 139, 0.92);
  font-size: 12px;
  letter-spacing: 0.01em;
  flex-wrap: nowrap;
}

.text-memo-widget__meta > :first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-memo-widget__meta > :last-child {
  flex: 0 0 auto;
  white-space: nowrap;
}

.text-memo-widget__editor .ant-input-textarea {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.text-memo-widget__input.ant-input,
.text-memo-widget__editor .ant-input {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 10px 18px 32px;
  box-sizing: border-box;
  color: #3f3a2f;
  font-size: 16px;
  line-height: 38px;
  background: transparent;
  resize: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.text-memo-widget__editor .ant-input::placeholder {
  color: rgba(120, 113, 91, 0.7);
}

.text-memo-widget__editor .ant-input[readonly] {
  cursor: default;
}

.text-memo-widget__sheet {
  display: flex;
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.text-memo-widget__empty {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 10px 0;
}

.text-memo-widget__list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  overflow: auto;
}

.text-memo-widget__list-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.92);
  text-align: left;
  cursor: pointer;
}

.text-memo-widget__list-item:hover {
  background: rgba(241, 245, 249, 1);
}

.text-memo-widget__list-item--active {
  background: rgba(254, 240, 138, 0.42);
}

.text-memo-widget__list-time {
  color: rgba(100, 116, 139, 0.92);
  font-size: 12px;
}

.text-memo-widget__list-preview {
  color: #111827;
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .text-memo-widget__toolbar {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }

  .text-memo-widget__editor {
    min-height: min(300px, 100%);
  }

  .text-memo-widget__sheet {
    min-height: min(240px, 100%);
  }
}
